Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

TRUE for successful execution or FALSE for failure.

See also

XOGetProperty()-XO_TABLEDESCRIPT$

Remarks

Code Block
* example for QryMethod:
function ExecuteScript(Script)
$insert XO_Equates
* returns @rm/@fm delimited results
Results = ""
* create connection (this could take params if you wanted,
* but calling it with no params lets the user choose what
* connection, etc.  this is how the query window calls it:
hXO  = XOInstance()
hQry = 0
if hXO then
   * create the query handle for the connection handle
   hQry = QryInstance(hXO)
   if hQry then
      * execute a script
      Flag = QryMethod(hQry, QRY_EXECUTE$, Script)
      if Flag then
         /* retrieve results and stick them in an @rm
            delimited array */
         loop
            Flag = QryMethod(hQry, QRY_GETROW$, Row)
         while Flag
            Results := @rm: Row
         repeat
         Results [1,1] = ""
         * cancel script
         Flag = QryMethod(hQry, QRY_CANCEL$)
      end else
         gosub error
      end
      * close the query handle
      Flag = QryMethod(hQry, QRY_DESTROY$)
   end else
      gosub error
   end
  * close the connection
  Flag = XOMethod(hXO, XO_DESTROY$)
end else
   gosub error
end
return Results
* Error handling
Error:
   if hQry then
      Flag = QryMethod(hQry, QRY_GETERROR$, "", "", "",|
                       "",Text)
   end else
      Flag = XOMethod(hXO, QRY_GETERROR$, "", "", "", |
                     "",Text)
   end
   convert @vm to @tm in Text
   Def = ""
   Def<MTEXT$>    = Text
   Def<MCAPTION$> = "ExecuteScript Error"
   Def<MICON$>    = "!"
   Msg(@window, Text)
   Results = ""
return