declare
Create a forward reference to functionName or subName. This allows the routine to be
referenced in code before it is actually defined with Function or Sub .
Syntax:
declare function functionName ( args ... )
declare sub subName ( args ... )
You still can't actually execute the routine until it is actually declared. If you encounter problems with forward references that Declare won't fix, try adding Option QBasic .
Example:
option qBasic
declare function mySub()
' option qBasic causes these statements to be deferred
mySub()
end
function mySub()
print "This is my function"
end function
See also option qbasic command.