Computer Science Canada [Help] [Blitz] Functions |
Author: | Cervantes [ Sat Feb 21, 2004 10:41 am ] |
Post subject: | [Help] [Blitz] Functions |
In Turing a function is like a procedure that has a result correct? (I never did funcs in class, and not much outside of class) Functions in Blitz seem to be a bit different to me, though I'm really not too sure ![]() Much oblidged ![]() |
Author: | shorthair [ Sat Feb 21, 2004 10:58 am ] | ||
Post subject: | |||
Blitz Help ( if you dont get it , il write my own for you )
{funcname} is any valid identifier. {typetag} is the type of value returned by the function. If {typetag} is omitted, the function returns an integer value by default. {params} is a comma separated list of variables which is passed to the function when it is called, each parameter may be given an optional type tag. Parameters are always local. A function may use the 'Return' statement to return a result. Just like turing , functions are very useful, If there is no Return statement, or a Return without any expression is used, the function returns a default value of 0 for numeric functions, an empty string ("") for string functions, or a 'Null' object for custom type functions. [/b] |
Author: | Cervantes [ Sat Feb 21, 2004 11:58 am ] | ||
Post subject: | |||
K I'm kinda understanding these now.
Do you have to have the function return something? Is gosub the closest thing to procedure? |
Author: | shorthair [ Sat Feb 21, 2004 12:13 pm ] |
Post subject: | |
if you dont need hte funtion to return somthing , then you shouldnt be using a function , you know like turing has procedures and functions , they both have their uses |