UniBasic Commands Reference - Rocket Software

UniBasic Commands Reference - Rocket Software UniBasic Commands Reference - Rocket Software

rocketsoftware.com
from rocketsoftware.com More from this publisher
11.04.2013 Views

NEG Syntax NEG(expr) Description The UniBasic NEG function changes the value of expr to its opposite sign. If the value of expr is positive, NEG returns a negative value. If the value of expr is negative, NEG returns a positive value. Example In the following example, the program segment changes the value of variable A to a negative number and prints -1: A = 1 A = NEG(A) PRINT A Related Command UniBasic ABS 1-476 UniBasic Commands Reference

NES Syntax NES(array1, array2) Description The UniBasic NES function compares each value in array1 to its corresponding value in array2. UniData returns an array with a one in each position where the value in array1 is not equal to the value in the corresponding position in array2, and a zero in each position for values that are equal to array2. Example In the following example, the program segment compares ARRAY1 to ARRAY2 and returns ARRAY3. ARRAY3 now contains 0}0}0}1}1. ARRAY1 = 10:@VM:20:@VM:30@VM:40:@VM:50 ARRAY2 = 10:@VM:20:@VM:30:@VM:50:@VM:60 ARRAY3 = NES(ARRAY1,ARRAY2) NES 1-477

NES<br />

Syntax<br />

NES(array1, array2)<br />

Description<br />

The <strong>UniBasic</strong> NES function compares each value in array1 to its corresponding<br />

value in array2. UniData returns an array with a one in each position where the value<br />

in array1 is not equal to the value in the corresponding position in array2, and a zero<br />

in each position for values that are equal to array2.<br />

Example<br />

In the following example, the program segment compares ARRAY1 to ARRAY2 and<br />

returns ARRAY3. ARRAY3 now contains 0}0}0}1}1.<br />

ARRAY1 = 10:@VM:20:@VM:30@VM:40:@VM:50<br />

ARRAY2 = 10:@VM:20:@VM:30:@VM:50:@VM:60<br />

ARRAY3 = NES(ARRAY1,ARRAY2)<br />

NES 1-477

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

Saved successfully!

Ooh no, something went wrong!