Procedures are just like methods, but are not part of an object. They can take a virtually unlimited amount of parameters, and have the option of returning a value.
Though procedures can be built specifically for use with objects, they generally are not.
(procedure public (IsPosOrNeg aNumber )
(if(< aNumber 0)
return( -1)
)
return(> aNumber 0)
)
Examples of using the variables:
= aVariable 100
Wait(aVariable )
= anotherVariable (* aVariable 2 )
= anArray[ 0] 5
(for (= aVariable 0) (< aVariable 10) (++aVariable )
= anArray[ aVariable] 123
)
This example is a procedure called "IsPosOrNeg" with one parameter, labeled"aNumber".
For more information on procedures, have a look at the section in the SCI Studio help file .
You should now have a general idea on what methods and procedures are. If you don't fully understand them yet, don't worry. Continue on with the tutorial, doing the step by step examples. When done, you should have a good grasp on them. If you still do not, come back to this chapter and read it again, and look at the links to the help file.
|