Welcome to jBASE's new documentation site! Many answers to your questions can be found by searching the Knowledgebase or viewing the jBASE Documentation. We also have a Google Group for peer discussion about jBASE. If you are unable to find the information you are looking for, jBASE Support will be glad to assist in resolving your technical problems. Enjoy and please provide comments and feedback .

How can we help you?

ICONVS

Description

This function converts each element of a dynamic array to a specified internal storage format. It takes the general form:

ICONVS(dynamic array, conversion)

Where:

  • conversion is an expression that evaluates to one or more valid conversion codes, separated by value marks (ASCII 253).
  • Each element of dynamic array is converted to the internal format specified by conversion and is returned in a dynamic array. If multiple codes are used, they are applied from left to right. The first conversion code converts the value of each element of dynamic array. The second conversion code converts the value of each element of the output of the first conversion, and so on. If dynamic.array evaluates to null, it returns null. If an element of dynamic array is null, null it returns null for that element. If conversion evaluates to null, the ICONVS() function fails and the program terminates with a run-time error message.

The STATUS function reflects the result of the conversion:

Status
Result
0
The conversion is successful.
1
An element of dynamic array is invalid. It returns an empty string, unless dynamic array is null, in which case it returns null.
2
Conversion is invalid.
3
Successful conversion of possibly invalid data.


An example of use is as:

ARR1 = "3 AUGUST 1997" : @AM : "2 MARCH 2017" : @AM :"17 MAY 1987"
INTERN_DATE = ICONVS(ARR1,"D")
CRT CHANGE(INTERN_DATE, @AM, ','):',':STATUS()

to output : 

10808,17959,7077,0.

For information about converting elements in a dynamic array to an external format see OCONVS.


Go back to jBASE BASIC.

Was this article helpful?