$FunSkip: Difference between revisions
m (1 revision) |
mNo edit summary |
||
Line 1: | Line 1: | ||
{{DISPLAYTITLE:$FunSkip}} | {{DISPLAYTITLE:$FunSkip}} | ||
<span class="pageSubtitle"><section begin="desc" />Skip to next output record for $ | <span class="pageSubtitle"><section begin="desc" />Skip to next output record for [[$FunImg]], [[$FunsStr]]<section end="desc" /></span> | ||
This skips the current ''[[Fast/Unload]]'' output record for a request so that subsequent [[$FunImg]] and [[$FunsStr]] calls will operate on the next record. | |||
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 $FunSkip function accepts one argument and returns a numeric result. | ||
Line 18: | Line 14: | ||
<p class="caption">%RESULT is set to 1, or it is set to an error code if there is no record to skip.</p> | <p class="caption">%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 | |||
0 - &FUNL. completed with return code 0; no more data | |||
-1 - Request not found | |||
<-1 - &FUNL. completed with non-zero return code, value | <-1 - &FUNL. completed with non-zero return code, value | ||
returned is negative of return code; no more data | returned is negative of return code; no more data | ||
Line 26: | Line 22: | ||
<p class="caption">$FunSkip Error Codes | <p class="caption">$FunSkip Error Codes | ||
</p> | </p> | ||
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. | 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. | ||
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. | ||
Line 53: | Line 47: | ||
<p class="code"> | <p class="code"> | ||
<ul> | <ul class="smallAndTightList"> | ||
<li>[[Fast/Unload User Language Interface]] | |||
<li> | |||
</ul> | </ul> | ||
</p> | </p> | ||
<p class="caption">Products authorizing $FunSkip | <p class="caption">Products authorizing $FunSkip | ||
</p> | </p> | ||
[[Category:$Functions|$FunSkip]] | [[Category:$Functions|$FunSkip]] | ||
[[Category:Fast/Unload $functions|$FunSkip]] |
Revision as of 17:04, 1 February 2011
<section begin="desc" />Skip to next output record for $FunImg, $FunsStr<section end="desc" />
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
<section begin="syntax" /> %RESULT = $FunSkip(req_num) <section end="syntax" />
1 - Record skipped 0 - &FUNL. completed with return code 0; no more data -1 - Request not found <-1 - &FUNL. completed with non-zero return code, value returned is negative of return code; no more data
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.
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