11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The following globally cataloged program, proc.test, is executed by the preceding<br />

proc. The INPUT statement reads from the currently active output buffer, which the<br />

proc loaded with “ONE”.<br />

1-585 <strong>UniBasic</strong> <strong>Commands</strong> <strong>Reference</strong><br />

*-----------------------------------------------------------------<br />

---------<br />

* subdirectory: interface<br />

* program name: proc.test<br />

* version : 1.6 or later<br />

* compile mode: any<br />

* catalog : y<br />

* catalog flag: local<br />

* test for : accepting passed arguments from a proc and<br />

writing<br />

* data to PROC data buffer (PROCWRITE).<br />

* called by : any proc or executed at the ECL prompt<br />

*-----------------------------------------------------------------<br />

---------*<br />

*<br />

PROGRAM proc.basic<br />

$BASICTYPE 'R'<br />

PRINT '*******************'<br />

PRINT 'TEST --> PROCREAD '<br />

PRINT '*******************'<br />

PROCREAD pname<br />

THEN<br />

len = LEN(pname)<br />

PRINT "The last command executed is stored in the primary input<br />

buffer."<br />

PRINT "The last 10 characters of the 1st buffer are<br />

:":pname[0,len]<br />

PRINT "The length of the primary input buffer is :":LEN(pname)<br />

END ELSE<br />

PRINT "Not run from PROC."<br />

END<br />

PRINT '*******************'<br />

PRINT 'TEST --> PROCWRITE'<br />

PRINT '*******************'<br />

INPUT procname<br />

IF procname = 'ONE' THEN<br />

letters = "abcdefg,1234567,ABCDEFG,tuvwxyz,"<br />

string = ''<br />

limit = 512<br />

FOR I = 1 TO limit STEP 32<br />

string := letters<br />

NEXT I<br />

PRINT "String length = ":LEN(string)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!