[Win98 Setup Bug]
Bug DescriptionThe following example:
sub test(a) undef q print a end sub q = 1 test qCauses memory fault.
Bug Reason, What Causes the BugWhen ScriptBasic passes global variables to function it creates a reference variable that references the original variable. This means that changing or accessing the argument changes or accesses the global variable. In the example the argument a is the same as q. When the subroutine undefines the array of which the first element in the example is passed to the function by value the argument variable a still references the original location of q which is at this time is already released and is not a valid memory location.
SolutionThere is no other solution than to wait for the next available release. The bug correction requires deep reorganization of ScriptBasic internal variable handling.
Bug Workaround Until Solution is AvailableDo not undef any global variable in functions.