$FunSkip: Difference between revisions

From m204wiki
Jump to navigation Jump to search
(Automatically generated page update)
Line 8: Line 8:
The only argument is the request identifier returned by <var>$FunLoad</var> for the request from which data is to be retrieved. This is a required argument.
The only argument is the request identifier returned by <var>$FunLoad</var> for the request from which data is to be retrieved. This is a required argument.
==Syntax==
==Syntax==
<p class="syntax"><span class="term">%result</span> = <span class="literal">$FunSkip</span>(<span class="term">req_num)
<p class="syntax"><span class="term">%result</span> = <span class="literal">$FunSkip</span>(<span class="term">req_num</span>
</p>
<p>
<p>
</p>
<var class="term">%result</var> is set to 1, or it is set to an error code if there is no record to skip.</p>
<p>%result is set to 1, or it is set to an error code if there is no record to skip.</p>
<p class="code">  
<p class="code">  
   1 - Record skipped
   1 - Record skipped
Line 27: Line 25:
<var>$FunSkips</var> can be mixed with [[$FunsStr]] and [[$FunImg]] calls for the same request. In addition, multiple unloads can be performed simultaneously with <var>$FunSkip</var> calls for the different requests mixed freely.  
<var>$FunSkips</var> can be mixed with [[$FunsStr]] and [[$FunImg]] calls for the same request. In addition, multiple unloads can be performed simultaneously with <var>$FunSkip</var> calls for the different requests mixed freely.  


==Example==
The following example compares the first two bytes of each unloaded record with 'XX'. If they are equal, the record is copied into image 'IMAGE' and then processed; otherwise the record is simply skipped.
The following example compares the first two bytes of each unloaded record with 'XX'. If they are equal, the record is copied into image 'IMAGE' and then processed; otherwise the record is simply skipped.
<p class="code"> %REQ = $FunLoad('DATA', , , '*')
<p class="code">%REQ = $FunLoad('DATA', , , '*')
IF %REQ LE 0 THEN
IF %REQ LE 0 THEN
STOP
STOP
END IF
END IF
%RC = 1
REPEAT WHILE %RC > 0
%TEST = $FunsStr( %REQ, 1, 2)
IF %TEST EQ 'XX' THEN
%RC = $FunImg( %REQ, %IMAGE:ITEM )
CALL PROCESS
ELSE
%RC = $FunSkip
END IF
END REPEAT
   
   
%RC = 1
REPEAT WHILE %RC > 0
%TEST = $FunsStr( %REQ, 1, 2)
IF %TEST EQ 'XX' THEN
%RC = $FunImg( %REQ, %IMAGE:ITEM )
CALL PROCESS
ELSE
%RC = $FunSkip
END IF
END REPEAT
</p>
</p>
<p class="code">


==Products authorizing {{PAGENAMEE}}==  
==Products authorizing {{PAGENAMEE}}==  

Revision as of 22:34, 10 April 2013

Skip to next output record for $FunImg, $FunsStr

This skips the current Fast/Unload output record for a request so that subsequent $FunImg and $FunsStr calls will operate on the next record.

The $FunSkip function accepts one argument and returns a numeric result.

The only argument is the request identifier returned by $FunLoad for the request from which data is to be retrieved. This is a required argument.

Syntax

%result = $FunSkip(req_num

%result is set to 1, or it is set to an error code if there is no record to skip.

1 - Record skipped 0 - Fast/Unload completed with return code 0; no more data -1 - Request not found <-1 - Fast/Unload completed with non-zero return code, value returned is negative of return code; no more data

$FunSkip Error Codes

If Fast/Unload has not unloaded any records yet, $FunSkip will wait for the first record. If $FunSkip returns a value less than or equal to 0, the request has completed.

$FunSkips can be mixed with $FunsStr and $FunImg calls for the same request. In addition, multiple unloads can be performed simultaneously with $FunSkip calls for the different requests mixed freely.

Example

The following example compares the first two bytes of each unloaded record with 'XX'. If they are equal, the record is copied into image 'IMAGE' and then processed; otherwise the record is simply skipped.

%REQ = $FunLoad('DATA', , , '*') IF %REQ LE 0 THEN STOP END IF %RC = 1 REPEAT WHILE %RC > 0 %TEST = $FunsStr( %REQ, 1, 2) IF %TEST EQ 'XX' THEN %RC = $FunImg( %REQ, %IMAGE:ITEM ) CALL PROCESS ELSE %RC = $FunSkip END IF END REPEAT

Products authorizing $FunSkip