Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (19 sloc) 490 Bytes
/*
* Name: TARTAKE REXX
* pass an exact number of bytes
* while consuming an integral number of 512-byte records.
* Copyright 1993, Richard M. Troth
*/
Parse Arg size . '(' . ')' .
If ^Datatype(size,'N') Then Exit
If size = 0 Then Exit
full = size % 512
'CALLPIPE *: | TAKE' full '| *:'
If rc ^= 0 Then Exit rc
part = size // 512
If part = 0 Then Exit
'PEEKTO RECORD'
'OUTPUT' Left(record,part)
'READTO'
If rc ^= 0 Then Exit rc
Exit