Syntax

From DavinciWiki
(Difference between revisions)
Jump to: navigation, search
Line 16: Line 16:
  
  
'''Definition of Defined Inputs:'''
+
'''Definition of Inputs:'''
  
 
In the explicit definition of inputs, the variable name will appear and be followed by the type of data it accepts.
 
In the explicit definition of inputs, the variable name will appear and be followed by the type of data it accepts.
Line 23: Line 23:
  
  
In non-explicit definition of inputs, the arguement number ($1, $2,...,$n) will be shown follwed by the type of data it accepts.
+
In non-explicit definition of inputs, the argument number ($1, $2,...,$n) will be shown follwed by the type of data it accepts.
  
 
For example: function($1 = VAR, $2 = STRING )
 
For example: function($1 = VAR, $2 = STRING )

Revision as of 14:57, 6 March 2006

Description

Syntax is an important part of using davinci and this page is desined to give the user a better understanding of how to properly input data into various types of functions. There are two main ways to pass information to a function, explicitly or by an ordered list of unnamed arguments or any combination of either.


Input Types:

  • BYTE - values from 0 to 255
  • SHORT - values from -32768 to 32768
  • INT - values from -2,147,483,648 to +2,147,483,647
  • FLOAT - values from blah to blah
  • DOUBLE - values from blah to blah
  • VAR - any type of davinci variable (including arrays, strings and various other data types)
  • STRUCT - a davinci structure containing the specified elements
  • STRING - a arbitrary length item composed of characters
  • TEXT - an array of strings
  • BOOL - values of either 1 or 0


Definition of Inputs:

In the explicit definition of inputs, the variable name will appear and be followed by the type of data it accepts.

For example: function(data = VAR, name = STRING )


In non-explicit definition of inputs, the argument number ($1, $2,...,$n) will be shown follwed by the type of data it accepts.

For example: function($1 = VAR, $2 = STRING )


After the function definition, the meaning each input will be explained regardless of if the inputs are explicitly or non-explicitly defined.


Optional Inputs:

By allowing some inputs to be optional, davinci has the ability to have preset values that the user doesn't need to enter for the function to work. A good example of this usage is assuming a null value in functions like thm.deplaid.

Optional inputs are enclosed by square brackets ( [ ] ) and defined as ususal.


For example:

function(data = VAR, [ ignore = FLOAT ])

function($1 = VAR, [ $2 = FLOAT ])


Last Updated: Feb-2011


More News

Personal tools