Versions Compared

Key

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

...

Code Block
Loop
   
   Error = PollForReply(hRequest, Status)

   Begin Case

       Case Error
           * An error was returned with the PollForReply function. Retrieve
           * error text and shutdown connection to remote engine.
           GoSub Process_Error
           GoSub Request_Done
           GoSub Return_Results

       Case Status EQ PROCESSING$
           * Only used with PollForReply. Indicates that the remote engine is
           * still processing our request.

       Case Status EQ DATA_AVAILABLE$
           * Information is available when the remote engine uses the Send_Dyn
           * routine in the request.
           GoSub Process_Status
           
       Case Status EQ INFO_AVAILABLE$
           * Information is available when the remote engine uses the
           * Send_Info routine in the request.
           GoSub Process_Status
           
       Case Status EQ INFO_REQUEST$
           * The remote engine is requesting information from the client using
           * the Req_Info routine. Use the SendResponse function to reply.

       Case Status EQ COMPLETED$
           * The remote engine has completed our request (i.e. the end of the
           * program has been reached.)
           GoSub Process_Status
           GoSub Request_Done
           GoSub Return_Results

       Case Status EQ PROC_ERROR$
           * An error occured in the remote engine request. Any Set_Status
           * error codes will be returned.
           GoSub Process_Status
           GoSub Request_Done
           GoSub Return_Results

   End Case

   Yield()

Until Error OR Status EQ COMPLETED$ OR Status EQ PROC_ERROR$
Repeat

...

Code Block
compile Insert REVCAPI_EQUATES

// CreateEngine Constants
* Connect to an existing engine if possible, else create a new one.
* Use this to create an engine connected to another database.
equ CREATE_ENGINE_OPEN_EXISTING$ to 0x000

* Always create a new engine.
* Engine will be created on the same machine as the calling engine.
equ CREATE_ENGINE_CREATE_NEW$ to 0x001

* Only connect to engines that already exist.
* This is the best way to connect to a remote engine.
equ CREATE_ENGINE_OPEN_ALWAYS$ to 0x002

* Create an engine in indexing mode.
equ CREATE_ENGINE_INDEXER$ to 0x010

* Create an engine that will not shut down when the connections end.
equ CREATE_ENGINE_WAIT_ON_CLOSE$ to 0x020

* Keep the engine invisible (e.g. BitOr(CREATE_ENGINE_OPEN_ALWAYS$,
REV_CREATE_ENGINE_NO_UI$)
equ REV_CREATE_ENGINE_NO_UI$ to 0x040

equ UNPROCESSED$    to 0        ;* Server has not begun request.
equ PROCESSING$     to 1        ;* Server is processing request.
equ DATA_AVAILABLE$ to 2        ;* Server has data available.
equ COMPLETED$      to 3        ;* Server has completed request, status
                               ;* information is available.
equ PROC_ERROR$     to 4        ;* Server process failed, status information is
                               ;* available.
equ INFO_AVAILABLE$ to 5        ;* Server has intermediate status information
                               ;* available.
equ INFO_REQUEST$   to 10       ;* Server is requesting information from client.

 declaredeclare function CreateEngine
declare function CreateQueue
declare function CreateRequest
declare function PollForReply
declare function WaitForReply
declare function GetReply
declare function SendResponse
declare function GetStatusText
declare function CloseRequest
declare subroutine CloseRequest
declare function CallSubroutine
declare function CallFunction
declare function CloseQueue
declare subroutine CloseQueue
declare function CloseEngine
declare subroutine CloseEngine

...