JDYNARRAY OBJECT

Man Page Index


The jDynArray Object is a variable length string that uses embedded delimiter characters to implement a 3 dimensional multi valued record structure.

Each record comprises any number of Fields. Each field can contain any number of Values. Each value can contain any number of SubValues.

jDynArray Objects are either the result of methods on the jEDI Object or can be created dynamically.

 

METHODS

 

CHANGE METHOD

Returns a string with all occurrences of a sub string replaced with another.

SYNTAX

jDynArrayobject.Change(Source, FromString,ToString)

jDynArrayobject The name of a jDynArray object that you wish to update.

DEL METHOD

Deletes an element from a jDynArray object.

 

SYNTAX

jDynArrayobject.Del Fieldno[,ValueNo[,SubValueNo]]

jDynArrayobject The name of a jDynArray object that you wish to update.
Fieldno is a numeric expression that is the field number to be deleted.
ValueNo is an optional numeric expression that is the value number to be deleted.
SubValueNo is ann optional numeric expression that is the subvalue number to be deleted.

 

REMARKS

Invalid numeric values for the expressions are ignored without warning. The command operates within the scope specified, i.e. if only a field is specified, then the entire field (including its multivalues and subvalues) is deleted. If a subvalue is specified, then only the subvalue is deleted, leaving its parent multivalue and field intact.

 

EXTRACT METHOD

Returns the value of a specific field, value or subvalue.

 

SYNTAX

DestVar = jDynArrayVar.Extract(Fieldno,[ValueNo,[SubValueNo]])

DestVar is the name of a String or Variant that receives the extracted data.
JDynArrayVar is the name of a jDynArray you wish to extract data from.
Fieldno is a numeric expression that is the field number to extract.
ValueNo is an optional numeric expression that is the value number to extract.
SubValueNo is an optional numeric expression that is the subvalue number to extract.

 

REMARKS

If the extracted field or value comprises multiple values or subvalues, then the Dest Var will contain embedded delimiter characters.

 

EXTRACTDYNARRAY METHOD

Returns the value of a specific field or value as a jDynArray object.

 

SYNTAX

Set jDynArrayVar = jDynArrayobject.ExtractDynArray(Fieldno,[ValueNo])

jDynArrayVar is the name of a jDynArray variable that receives the extracted data.
jDynArrayobject is the name of a jDynArray object that you wish to extract the data from.
Fieldno is a numeric expression that is the field number to extract.
ValueNo is an optional numeric expression that is the value number to extract.

 

FIND METHOD

Allows the location of a specified string within a jDynArray object.

 

SYNTAX

jDynArrayobject.Find(SearchString,OccurenceNo,fieldVar,[ValueVar,[SubValueVar]])

jDynArrayobject is the name of a jDynArray object that you wish to search.
SearchString is the string to find.
OccurrenceNo is a numeric expression that is the occurrence to be found.
FieldVar is the name of a numeric or Variant that receives the field position in which the string was found.
ValueVar is an optional name of a numeric or Variant that receives the value position in which the string was found.
SubValueVar is an optional name of a numeric or Variant that receives the sub-value position in which the string was found.

 

REMARKS

The function has a boolean return type that is set true if the string is found. This allows the method to be used in an IF statement.

 

FINDSTR METHOD

Allows the location of a specified substring within a jDynArray object.

 

SYNTAX

jDynArrayobject.FindStr(SearchString,OccurenceNo,FieldVar,[ValueVar,[ SubValueVar]])

jDynArrayobject is the name of a jDynArray object that you wish to search.
SearchString is the substring to find.
OccurenceNo A numeric expression that is the occurrence to be found.
FieldVar The name of a numeric or Variant that receives the field
position is the position in which the substring was found.
ValueVar is an optional name of a numeric or Variant that receives the value position in which the substring was found.
SubValueVar is an optional name of a numeric or Variant that receives the sub-value position in which the substring was found.

REMARKS

The function has a boolean return type that is set true if the substring is found. This allows the method to be used in an IF statement.

 

INS METHOD

Inserts elements into a jDynArray.

 

SYNTAX

jDynArrayobject.Ins ValueToInsert, Fieldno[,ValueNo[,SubValueNo]]

jDynArrayobject is the name of a jDynArray object into which you wish to insert the data.
ValueToInsert is the variable containing the value to be inserted.
Fieldno is a numeric expression that is the field number to insert before.
ValueNo is an optional numeric expression that is the value number to insert before.
SubValueNo is an optional numeric expression that is the subvalue number to insert before.

 

REMARKS

The ValueToInsert can be either a jDynArray object or any other type of variable that can be coerced to a string . Specifying a negative value to any of Fieldno, ValueNo, or SubValueNo will cause the element to appended as the last Field, Value, or Sub-Value rather than at a specific position. Only one of the expressions may be negative, otherwise the first negative value is used correctly but the others are treated as the value 1. The statement will insert NULL Fields, Values, or Sub-Values accordingly if any of the specified insertion points exceeds the number currently existing.

 

LOCATE METHOD

Finds the position of an element within a specified dimension of a jDynArray object.

 

SYNTAX

jDynArrayobject.Locate( searchstring, positionvar [, ordercode[,startposition[, Fieldno[, Valueno]]]])

jDynArrayobject is the name of a jDynArray object that you wish to search.
searchstring is the string to find.
positionvar is the name of a long variable that receives the position.
ordercode is an optional string expression that specifies the ordering.
startposition an optional numeric expression that specifies the field, value or subvalue position from which the search will begin.
Fieldno is an optional numeric expression that specifies the field position to search for a value.
Valueno is an optional numeric expression that specifies the value position to search for a sub value.

 

REMARKS

Specifing ordercode causes the search to expect the elements to be arranged in a specific order, which can considerably improve the performance of some searches. The available string values for ordercode are:

AL Values are in ascending alphanumeric order
AR Values are in right justified, then ascending order
AN Values are in ascending numeric order
DL Values are in descending alphanumeric order
DR Values are in right justified, then descending order
DN Values are in descending numeric order

Positionvar will be set to the position of the Field, Value or Sub-Value in which searchstring was found if indeed, it was found. If it was not found and ordercode was not specified then positionvar will be set to one position past the end of the searched dimension. If ordercode did specify the order of the elements then positionvar will be set to the position before which the element should be inserted to retain the specified order.

The function has a boolean return type that is set true if the string is found. This allows the method to be used in an IF statement.Matparse Method

 

MATPARSE METHOD

Builds an Array from a jDynArray.

 

SYNTAX

DestVar = jDynArrayVar.Matparse

DestVar is the name of a Variant that receives the Array.
JDynArrayVar is the name of a jDynArray the you wish to create an Array from.

 

REMARKS

Matparse returns an array of variants with one element for each field in the jDynArray object. If any field contains multiple values then the corresponding field will contain an array of variants with one element for each value. The process is repeated for sub values. When the contents of a jDynArray object is a single field without any
embedded values,the DestVar is returned as a variant of type string . The Visual Basic function IsArray() is useful for determining the presence of embedded values.

 

REPLACE METHOD

Replaces a specified Field, Value, or Sub-Value in a jDynArray.

 

SYNTAX

jDynArrayobject.Replace ReplacementValue,Fieldno[,ValueNo[,SubValueNo]]

jDynArrayobject is the name of a jDynArray object that you wish to update.
ReplacementValue is the variable containing the data that is to replace existing data.
Fieldno is a numeric expression that is the field number to be replaced.
ValueNo is an optional numeric expression that is the value number to be replaced.
SubValueNo is an optional numeric expression that is the subvalue number to be replaced.

 

REMARKS

The ReplacementValue can be either a jDynArray object or any other type of variable that can be coerced to a string .

 

SELECT METHOD

Returns a jSelectList object that represents all the record keys in the file.

 

SYNTAX

Set jSelectList object = jEDIobject.Select()
Set jSelectList object = jDynArrayobject.Select()

jEDIobject is a variable of a jEDI object data type that represents the file that you are opening.
jSelectList object is a variable of jSelectList data type that will be set up to reference the created select list.

 

SORT METHOD

Sorts the elements of a jDynArray.

 

SYNTAX

jDynArrayobject.Sort

jDynArrayobject is the name of a jDynArray object that you wish to sort.

 

REMARKS

The SORT method will sort a dynamic array by the highest delimiter found in the array. This means that if the jDynArrayobject contains multiple fields, it will sort by field; but if it contains only sub-values, it will sort by sub-values.

 

TEXT METHOD

Converts jDynArray objects into text strings suitable for display.

 

SYNTAX

StringVar = jDynArrayObject.Text()

 

NOTES

The text method is especially useful for populating list boxes since each attribute is separated by a newline sequence.


OBJEX