Syntax
Line 2: | Line 2: | ||
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. | 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: | + | |
+ | '''Input Types:''' | ||
*BYTE - values from 0 to 255 | *BYTE - values from 0 to 255 | ||
*SHORT - values from -32768 to 32768 | *SHORT - values from -32768 to 32768 | ||
Line 14: | Line 15: | ||
*BOOL - values of either 1 or 0 | *BOOL - values of either 1 or 0 | ||
− | |||
− | + | '''Definition of Defined 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 arguement 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: | For example: | ||
− | function(data | + | function(data = VAR, [ ignore = FLOAT ]) |
+ | |||
+ | function($1 = VAR, [ $2 = FLOAT ]) | ||
}} | }} | ||
[[category:Glossary]] | [[category:Glossary]] |
Revision as of 13:32, 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.
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 )
For example: function($1 = VAR, $2 = STRING )
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.
function(data = VAR, [ ignore = FLOAT ]) function($1 = VAR, [ $2 = FLOAT ])
|
Wiki Navigation Bar Contents
Contact Developers
All other topics
Last Updated: Feb-2011
More News
|