$Arr Init: Difference between revisions
m (1 revision) |
m (→Syntax) |
||
Line 16: | Line 16: | ||
<p class="caption">%result returns a 0 or, if the array is invalid, a -1.</p> | <p class="caption">%result returns a 0 or, if the array is invalid, a -1.</p> | ||
==Examples== | |||
In the following example | <ol> | ||
<p class="code"> %FXARRAY IS FIXED ARRAY(5) | <li>In the following example, every element of %FXARRAY is set to 0: | ||
<p class="code">%FXARRAY IS FIXED ARRAY(5) | |||
%RC = $Arr_Init(%FXARRAY) | |||
</p> | </p> | ||
In the following example | <li>In the following example, every element of %STARRAY is set to '*** UNKNOWN ***': | ||
<p class="code"> %STARRAY IS STRING LEN 20 ARRAY(5) | <p class="code">%STARRAY IS STRING LEN 20 ARRAY(5) | ||
%RC = $Arr_Init(%STARRAY, '*** UNKNOWN ***') | |||
</p> | </p></ol> | ||
<h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList"> | <h2>Products authorizing {{PAGENAMEE}}</h2><ul class="smallAndTightList"> | ||
<li>[[Sirius functions]]</li> | <li>[[Sirius functions]]</li> |
Revision as of 00:28, 26 October 2012
Initialize every element of array to specific value
Most Sirius $functions have been deprecated in favor of Object Oriented methods. There is no direct OO equivalent for the $Arr_Init function because the OO methods emphasize the use of Collections over the use of arrays.
$Arr_Init can be used to initialize every element of an array to a specific value. $Arr_Init accepts two arguments and returns a numeric code.
The first argument is an array of string, float, or fixed values. This array can be a single or multi-dimensional array and must not be an array in an image.
The second argument is the value with which the array is to be initialized. If this argument is not specified, it defaults to a null string if the first argument is a string array and 0 if the first argument is either a fixed or float array.
Syntax
<section begin="syntax" />%result = $Arr_Init (array, value) <section end="syntax" />
Examples
- In the following example, every element of %FXARRAY is set to 0:
%FXARRAY IS FIXED ARRAY(5) %RC = $Arr_Init(%FXARRAY)
- In the following example, every element of %STARRAY is set to '*** UNKNOWN ***':
%STARRAY IS STRING LEN 20 ARRAY(5) %RC = $Arr_Init(%STARRAY, '*** UNKNOWN ***')
Products authorizing $Arr_Init
- Sirius functions
- Fast/Unload User Language Interface
- Janus Open Client
- Janus Open Server
- Janus Sockets
- Janus Web Server
- Japanese functions
- Sir2000 Field Migration Facility