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.

OCONV Length (L)<br />

Syntax<br />

OCONV(str.expr, "Ln[,m]")<br />

Description<br />

The OCONV length (L) function extracts a string of a specified length or that falls<br />

within a range of acceptable lengths. If the input value or conversion code is invalid,<br />

UniData returns the input value.<br />

Note: In BASICTYPE P, OCONV returns an empty string if UDT.OPTIONS 56 is on<br />

and the input value or conversion code is invalid.<br />

Parameters<br />

The following table describes each parameter of the syntax.<br />

Parameter Description<br />

str.exp Indicates a string to be searched.<br />

n Specifies the number of characters the string must match to be extracted.<br />

When m is present, n is the shortest string to be extracted.<br />

m Specifies the longest string to be extracted.<br />

OCONV Length (L) Parameters<br />

Example<br />

In the following example, the program segment prints “123” and an empty string<br />

because X has fewer than five characters and more than three:<br />

X = 123; Y = 456789<br />

PRINT OCONV(X,"L3,5")<br />

PRINT OCONV(Y,"L3,5")<br />

OCONV Length (L) 1-496

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

Saved successfully!

Ooh no, something went wrong!