The next section of the site looks at
You will find increasing reference to the LitDev extension and although traditional standard Small Basic code solutions are developed, there will also be examples using LitDev to enhance the users code. This is particularly true of Subroutines and Functions.
Most Exam Boards seem to require students to use parameters and return values – something that is not available with the standard Small Basic system. LitDev includes a very useable solution to this in the form of LDCall.FunctionX() group of methods. With these it is possible to call a standard SB subroutine with up to 5 parameters and to have a return value if required. The parameters are pseudo local in that they don’t contain anything on return from the call. However, in order to use any you have to declare an ‘args’ variable before using any call.
Interestingly, LitDev treats this variable as an array, and assigns it args=”” when the subroutine ends. It is therefore possible to use any number of elements of this array within the subroutine and consider them ‘local’. There is also nothing to stop an array being passed as a parameter thus generating two dimensional arrays within the subroutine. AN array can also be passed back in the ‘return’ variable.
Another method used in this section of the site is: LDFile.Exists(). This is useful as it avoids having to read in an array of files in a specified folder just to see if a file exists.