The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



DebugFileName


Unit:SDL_math2
Class:TExtractor
Declaration:property DebugFileName: string;

Errors in the extractor script are particularly difficult to find, especially if the sources of unit are not available. In order to cope with such situations you may use the property DebugFileName. Setting this property to a valid file path forces the TExtractor component to write debug information to this file during the execution of the script.

Debug information is always appended to the file addressed by the property DebugFileName. If the file initially does not exist the file is created automatically. For each source line the debug text contains the date and time of execution, the source line, and the list of executed extraction commands, including the associated parameters.

Example: The following example shows the resulting debug text for a single input line if the following script is applied:
 
pos(1); 
copy (4, validline); 
calc(test=validline <= 0); 
exiton (test); 
pos(1); 
copyuntil (',', Num); 
copyuntil (',', LMid); 
emit (Name=LMid); 
copyuntil (',', Lat); 
emit (Latitude=Lat); 
copyuntil (',', Long); 
emit (Longitude=Long); 
find (1, ',,'); 
inc(2); 
find (3, ','); 
inc(1); 
copyuntil (',', H); 
emit (Height=H*0.3048); 
find (1, ',,,'); 
inc(3); 
copyuntil (',', tim); 
emit (Time=tim); 

The resulting debug text reads like this (the variable FSPos is the source character pointer):

 
------------ 2003-07-24  07:19:14 ------------ 
Source data to be interpreted: "1,LMK001,  28.159017, -17.286267,37820.6379137, 
                               0, 1, 3, 0, 65535,, 0, 0, 0, 1975, 6, 0,17,0, 
                               10.0,2,,,2003-07-18 12:40:54" 
Execute "pos(1);" 
  ... FSPos=1 
Execute "copy (4, validline);" 
  ... FSPos=5 
  ... validline=1,LM 
Execute "calc(test=validline <= 0);" 
  ... test=False 
  ... variables used for calc: 
       validline=1,LM 
       test=False 
Execute "exiton (test);" 
  ... test=false 
Execute "pos(1);" 
  ... FSPos=1 
Execute "copyuntil (',', Num);" 
  ... FSPos=3 
  ... Num=1 
Execute "copyuntil (',', LMid);" 
  ... FSPos=10 
  ... LMid=LMK001 
Execute "emit (Name=LMid);" 
  ... result: Name=LMK001 
  ... variables used for emit: 
       validline=1,LM 
       test=False 
       num=1 
       lmid=LMK001 
Execute "copyuntil (',', Lat);" 
  ... FSPos=22 
  ... Lat=  28.159017 
Execute "emit (Latitude=Lat);" 
  ... result: Latitude=  28.159017 
  ... variables used for emit: 
       validline=1,LM 
       test=False 
       num=1 
       lmid=LMK001 
       lat=  28.159017 
Execute "copyuntil (',', Long);" 
  ... FSPos=34 
  ... Long= -17.286267 
Execute "emit (Longitude=Long);" 
  ... result: Longitude= -17.286267 
  ... variables used for emit: 
       validline=1,LM 
       test=False 
       num=1 
       lmid=LMK001 
       lat=  28.159017 
       long= -17.286267 
Execute "find (1, ',,');" 
  ... FSPos=79 
Execute "inc(2);" 
  ... FSPos=81 
Execute "find (3, ',');" 
  ... FSPos=92 
Execute "inc(1);" 
  ... FSPos=93 
Execute "copyuntil (',', H);" 
  ... FSPos=101 
  ... H=   1975 
Execute "emit (Height=H*0.3048);" 
  ... result: Height=601,98 
  ... variables used for emit: 
       validline=1,LM 
       test=False 
       num=1 
       lmid=LMK001 
       lat=  28.159017 
       long= -17.286267 
       h=   1975 
Execute "find (1, ',,,');" 
  ... FSPos=118 
Execute "inc(3);" 
  ... FSPos=121 
Execute "copyuntil (',', tim);" 
  ... FSPos=140 
  ... tim=2003-07-18 12:40:54 
Execute "emit (Time=tim);" 
  ... result: Time=2003-07-18 12:40:54 
  ... variables used for emit: 
       validline=1,LM 
       test=False 
       num=1 
       lmid=LMK001 
       lat=  28.159017 
       long= -17.286267 
       h=   1975 
       tim=2003-07-18 12:40:54 



Last Update: 2012-Oct-20