Page 1 of 1

DIDX

Posted: Mon May 22, 2017 10:33 am
by cdidan
DIM SLQ(99) SLA(99),ZS(99)
MAT ZS=DIDX(SLQ)
FOR Z=1 TO 99
WORK=SLA(ZS(Z))
NEXT Z

DIM SLQ(99,15),SLA(99,15), ZS(99,15
MAT ZS=DIDX(SLQ)
FOR Y=1 TO 99
FOR X=1 TO 15
WORK=SLA ????????????????
HOW DO I REFERENCE SLA ????????????????????????
NEXT X
NEXT Y

Re: DIDX

Posted: Mon May 22, 2017 12:14 pm
by John
maybe it's sla(zs(z),y), but I'm not sure if you can sort a two dimensional array like that. you may need to pull the one dimension you want to sort into a seperate array and sort it first.

Re: DIDX

Posted: Mon May 22, 2017 2:11 pm
by cdidan
Also check that the program is not trying to index an array larger than three
dimensions (the AIDX and DIDX functions support one-, two- or threedimensional
arrays).
According to the manual AIDX will support up to a 3 dimensional array.

Re: DIDX

Posted: Mon May 22, 2017 5:27 pm
by gordon
I am unaware of any documentation that states AIDX or DIDX work with multi-dimensional arrays. I would suggest that you establish a separate key array to use as a basis for your DIDX sort.

Re: DIDX

Posted: Mon May 22, 2017 5:42 pm
by Gabriel
Gordon,

he's talking about this documentation:

http://brwiki2.brulescorp.com/index.php?title=0123

If its incorrect, please fix it when you're done checking it out and verifying if it can or can't work.

Gabriel

Re: DIDX

Posted: Mon May 22, 2017 6:14 pm
by cdidan
Business Rules Programmer's Manual
Chapter 20 Error Codes 782
1.) An invalid array element has been specified.
2.) (MacIntosh) Reference to mapped network drive lost
Remedy
1.) Check to see that each specified element falls within the array's allowable
range. It must not be larger than the dimensioned (or redimensioned) value,
or negative, or invalid for the BASE in which the program is functioning.
2.) Mount network drive
0123 Dimension conflict
Cause
The number of provided array dimensions does not match the number
specified in the DIM statement.
Remedy
Change the DIM statement or match the required number of dimensions.
Also check that the program is not trying to index an array larger than three
dimensions (the AIDX and DIDX functions support one-, two- or threedimensional
arrays).
0201 RETURN without GOSUB
Cause

Re: DIDX

Posted: Mon May 22, 2017 9:35 pm
by gordon
I checked the code. Only one dimensional arrays are supported.

I removed the error code misstatement. And noted that limitation in the AIDX description on the wiki.

Re: DIDX

Posted: Tue May 23, 2017 6:21 am
by cdidan
Thanks for the help.
I will probably use John's suggestion.

Re: DIDX

Posted: Tue May 23, 2017 11:33 am
by gordon
I have added a section to the wiki MAT description entitled Sorting Multidimensional Arrays. It provides an example program that is instructive on how to sort "arrays of rows." The complicating factor is the need to keep each row intact when sorting on a specific key field.

http://brwiki2.brulescorp.com/index.php ... nal_Arrays

""