The WIL Tutorial
|
Apparently, there have been sightings of bug free code. However, chances are you will need to exterminate at least one of your WIL scripts. Luckily, WIL has a handy debug utility which comes with the WIL Interpreter. Debug, a WIL function, is invaluable in determining logic errors. When Debug is initialized, a dialog box which controls the execution of each statement is displayed. Debug works line by line through the script, displaying the current statement, its value and the following statement. In addition, Debug can report on the value of your variables at any given point in the program. Just type the variable into the edit box and select "Show Var". The script will also be executed in conjunction with the display of statements. Initialize Debug by adding Debug(1) or Debug(@ON) to a specific point in your script. Note: For specific instructions see Debug in the WIL Function Reference. See Also: Debugging Options, DebugTrace, Message, Pause Example:
Debug(1) a=TimeYmdHms( ) b=TimeJulianDay(a) c=(b+5) mod 7 day=ItemExtract(c+1, "Sun Mon Tue Wed Thu Fri Sat", " ") line=StrCat("Julian Date= ",b,@CRLF,"Day of week= ",day) Message(TimeDate( ), line)
|