5 Replies Latest reply on Dec 4, 2014 7:40 AM by PSI

    Best Practice for writing and debugging Server-Side scripts

    mrwatson-gbs

      Server-Side scripts are going to be BIG....but they are no fun to debug! That won't be easy.

       

      No server-side debugger, no pausing to look, no data-viewer, no dialog-boxes.

       

      I guess logging is soon going to be a big issue!

       

      Thus writing code which does not produce unnecessary errors will be beneficial when checking server-side logs, for-example instead of:

      Go to Record[First]

      Loop

      #Do stuff here

      Go to Record[Next,Exit after last]

      End loop

      - which adds an error 101 to the server log when the last record is reached.

       

      the following code is better because it exits gracefully without logging an error.

      Go to Record[First]

      Loop

      #Do stuff here

      Exit loop if[Get ( RecordNumber ) ≥ Get ( FoundCount ) ]

      Go to Record[Next]

      End loop

       

       

      Got any other tips? Please conribute other best practices here!