Kbase 20382: Does Progress ABL support multi-dimensional arrays ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  12/23/2008 |
|
Status: Verified
GOAL:
Does Progress ABL support multi-dimensional arrays ?
GOAL:
How to simulate multi-dimensional arrays by use of a temp table.
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
All Supported Operating Systems
FIX:
Progress ABL currently does not support multi-dimensional arrays.
Enhancement request# 0000002755 has been logged for this.
It is possible to simulate a multi-dimensional array using a temp-table and basic ABL techniques:
1) Define a temp-table with an integer field for each array dimension, and a field of the appropriate data type for the value.
For example, if the array is to be two dimensional
(value = mda[i,j]):
define temp-table mda
field i as integer
field j as integer
field value as character.
2) To store, modify or read values, create and update records as required.
For example, to store "test" at i=3, j=5:
find mda where i = 3 and j = 5 no-error.
if not available mda then create mda.
assign i = 3
j = 5
value = "test".
3) It is recommended to create get and set functions to manipulate the temp-table.
Doing so makes it easy to encapsulate the table definition and supporting logic in a single include file, persistent procedure or (starting from OpenEdge 10.1A) class.