[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 FN_SQJOBFI()
 Service queue job and open file
------------------------------------------------------------------------------
 Syntax
 
      fn_sQJobFi( nQueueID, nJobType, @nHandle ) -> aJobStruct
 
 Arguments

     <nQueueID> is the bindery object ID of the queue
     <nJobType> is the target job type this queue server will service.
                If you set it to -1, you'll get the first available
                job in the queue.
     <@nHandle> is a numeric, sent in by reference, and will be
                replaced by the DOS file handle of the queue job file
                when the call returns
                MUST BE SENT IN BY REFERENCE!!!

 Returns

      <aJobStruct>, the job entry structure for the queue.
      If <aJobStruct> is empty ( {} ), then there was an error
      that can be retrieved from FN_ERROR().

 Description

      Queue servers use this call to get the next job to service.
      Once called, the specificed queue is searched from front to
      back for a job that meets the following criteria:

            -  The Target Server ID must either be -1 or must
               match the ID of the server that makes the call

            -  The target execution date must either be ctod("")
               or the target execution time must be "99:99:99"
               or must specify a time earlier than the system
               clock

            -  The job type field must match that of the call
               if the call doesn't specify -1 for target job type

            -  The job control flags "Operator Hold", "User Hold",
               and "Entry Open" must be .f.

            -  The Server ID number field must be 0, indicating
               that no other server is working on this job.

     If we get a job, the job entry structure is updated to reflect
     your server's information (server station, server task, server
     ID).

     In addition, the job file is opened and a DOS file handle is
     returned in <nHandle>, suitable for fwrite()ing.

     In order to use this call, the station making the call must
     have attached to the queue as a queue server first and must
     have the proper security (i.e., must be in the queue's
     Q_SERVERS property).

 Examples


 Source: N:\SRC\QMS\SVCQJOB.PRG

 Author: Glenn Scott

This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson