11.04.2013 Views

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ISNVS<br />

Syntax<br />

ISNVS(dynamic.array)<br />

Description<br />

The <strong>UniBasic</strong> ISNVS function tests dynamic array elements to see if any of them is<br />

the null value. This function is meaningful only when null value handling is on. It<br />

returns an array with 0 or 1 in each element. If the array element is the null value, this<br />

function returns a code of 1. If the element is not null, or if it contains the null value<br />

as well as other characters, this function returns a code of 0.<br />

Note: The udtconfig parameter NULL_FLAG must be on for a program that contains<br />

ISNVS to compile. With this flag on, the null value represents an unknown value<br />

(represented BY @NULL in <strong>UniBasic</strong> programs), as opposed to an empty string<br />

(represented as “”). IBM recommends that you use @ variables to represent UniData<br />

delimiters and the null value because the ASCII value used to represent these<br />

characters can vary with language group.<br />

Example<br />

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

The following program demonstrates the ISNVS function by printing<br />

the return values stored in array D:<br />

B=@FM:"stereo":@FM:@NULL:@FM:"234":@FM<br />

D=ISNVS(B)<br />

STG=B<br />

GOSUB PRINT.SETUP<br />

PRINT "Dynamic array = "<br />

PRINT PRT.STG<br />

FOR X = 1 TO 4<br />

PRINT "D = ":D<br />

NEXT X<br />

PRINT.SETUP:<br />

PRT.STG = CHANGE(STG, @NULL, "@NULL")<br />

PRT.STG = CHANGE(PRT.STG, @FM, "@FM")<br />

PRT.STG = CHANGE(PRT.STG, @AM, "@AM")<br />

PRT.STG = CHANGE(PRT.STG, @VM, "@VM")<br />

RETURN

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

Saved successfully!

Ooh no, something went wrong!