'
' ---------------------------------------------------------------------------
' Jacques Philippe                                                 April 2002
'
' Demo Calling A Asm Routine in RapidQ                     Using Include File
' ---------------------------------------------------------------------------
'
' This Demo Simply Reverse a String Calling an Asm Routine
'
$ESCAPECHARS ON
$TYPECHECK ON
$INCLUDE "RAPIDQ.INC"
'
$INCLUDE "ReverseString.Inc"               ' Simple Include it Here
'
DefInt iTmp
DefStr myString = "What Time is it ?"
DefStr buffer = Space$(Len(MyString) + 5)  ' The asm routine will work there 
'
' Calling The Function Generated in ReverseString.Inc
' ---------------------------------------------------
Print "\I Call the Function Generated in ReverseString.Inc"
Print "    Result : ";myString;"  ASM REVERSED BECOMES  ";
ReverseString (VarPtr(myString), VarPtr(buffer), 0, 0)
Print myString
'
'
' Calling Directly API CallAsmProc with the Pointer Defined in ReverseString.Inc
' ------------------------------------------------------------------------------
Print "\nI Directly Call API CallAsmProc with the Pointer Defined in ReverseString.Inc"
Print "    Result : ";myString;"  ASM REVERSED BECOMES  ";
CallAsmProc (ptrReverseString, VarPtr(myString), VarPtr(buffer), 0, 0)
Print myString
Print "\n   *** It was Reversed, it is now Re Reversed :)"
'
' -------------------------------------------------------------
' EXIT CONSOLE
' ------------
DefStr sExit
Input "\n\n                    CR to QUIT \n\n", sExit
Application.Terminate
End
