Files
harbour-core/tests/ppapi.prg
vszakats 9687850865 2013-03-16 02:10 UTC+0100 Viktor Szakats (harbour syenar.net)
* (all files)
    * stripped svn header
    * minor cleanups
    ; use following command to find out the history of files:
       git log
       git log --follow
       git blame
       git annotate
2013-03-16 02:11:42 +01:00

78 lines
1.5 KiB
Plaintext

REQUEST __pp_StdRules
PROCEDURE Main()
LOCAL cString, l_pp
LOCAL i, j, aScript
l_pp := __pp_Init()
CLS
? "Testing Harbour run-time preprocessing"
? "======================================"
?
cString := "@ 10, 10 SAY 'Hello!'"
? cString
? __pp_Process( l_pp, cString )
?
cString := "? 'Hello mom'"
? cString
? __pp_Process( l_pp, cString )
?
cString := 'SET RELATION TO Something INTO MySelf'
? cString
? __pp_Process( l_pp, cString )
?
cString := 'SET RELATION ADDITIVE TO Something INTO YourSelf'
? cString
? __pp_Process( l_pp, cString )
?
cString := "#xcommand DEFAULT <v1> := <x1> => IF <v1> == NIL ; <v1> := <x1> ; END"
? cString
IF __pp_AddRule( l_pp, cString )
? "Rule added successfully !"
ELSE
? "Rule addition failed ..."
ENDIF
cString := 'DEFAULT x := 100'
? cString
? __pp_Process( l_pp, cString )
?
WAIT "Press any key..."
CLS
aScript := { ;
'cMyDatabase := "dontknow.dbf"', ;
'USE ( cMyDatabase )', ;
'GO TOP', ;
'', ;
'? MYFIELD, YOURFIELD', ;
'', ;
'WAIT "Press any key..."', ;
'', ;
'CLOSE ALL' }
FOR j := 1 TO 2
? iif( j == 1, "Before", "After" ) + " __pp_Process()"
? "==================="
?
FOR i := 1 TO Len( aScript )
? iif( j == 1, aScript[ i ], __pp_Process( l_pp, aScript[ i ] ) )
NEXT
?
WAIT "Press any key..."
CLS
NEXT
RETURN