DIDX

General development discussion.

Moderators: Susan Smith, admin, Gabriel

Post Reply
cdidan
Posts: 9
Joined: Thu Aug 06, 2009 7:10 am
Location: Mount Clemens, MI

DIDX

Post 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
John
Posts: 555
Joined: Sun Apr 26, 2009 8:27 am

Re: DIDX

Post 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.
John Bowman
cdidan
Posts: 9
Joined: Thu Aug 06, 2009 7:10 am
Location: Mount Clemens, MI

Re: DIDX

Post 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.
gordon
Posts: 358
Joined: Fri Apr 24, 2009 6:02 pm

Re: DIDX

Post 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.
Gabriel
Posts: 412
Joined: Sun Aug 10, 2008 7:37 am
Location: Arlington, TX
Contact:

Re: DIDX

Post 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
cdidan
Posts: 9
Joined: Thu Aug 06, 2009 7:10 am
Location: Mount Clemens, MI

Re: DIDX

Post 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
gordon
Posts: 358
Joined: Fri Apr 24, 2009 6:02 pm

Re: DIDX

Post 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.
cdidan
Posts: 9
Joined: Thu Aug 06, 2009 7:10 am
Location: Mount Clemens, MI

Re: DIDX

Post by cdidan »

Thanks for the help.
I will probably use John's suggestion.
gordon
Posts: 358
Joined: Fri Apr 24, 2009 6:02 pm

Re: DIDX

Post 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

""
Post Reply