home *** CD-ROM | disk | FTP | other *** search
- /* shift: */
- /* is used to shift the lines in the */
- /* block to the left or right by n bytes */
- trace o
- parse arg direct count . rows . cols .
- options results
- if rows = ''
- then do
- 'STATUS R'
- 'MACRO 10 shift' direct count result
- 'MARK 1'
- return
- end
- else do
- 'STATUS T'
- tab = result
- 'MACRO 10 shift' direct count
- 'COPY'
- if rc = 0
- then do
- if rows = '' then return(-1)
- 'STATUS R'
- parse value result with . rowe . cole .
- if rows > rowe
- then do
- row = rows
- rows = rowe
- rowe = row
- end
- do t = rows to rowe
- 'JUMP' t
- 'STATUS L'
- linesve = result
- if rc ~= 0 then leave
- 'DLINE'
- p = 1
- do forever
- p = pos('09'x,linesve)
- if p = 0 then leave
- i = (tab - (p//tab))+1
- linesve = delstr(linesve,p,1)
- i = copies(" ",i)
- linesve = insert(i,linesve,p-1)
- end
- if direct = '>'
- then do
- shift = substr(' ',1,count)
- 'I *N'shift''linesve'*N'
- 'UP 2'
- 'DLINE'
- end
- else do
- shift = linesve''substr(' ',1,count+1)
- shift = substr(shift,count+1)
- shift = strip(shift,'t')
- 'I *N'shift'*N'
- 'UP 2'
- 'DLINE'
- end
- end
- end
- end
- 'CMD 0'
- return
-