Array Ubound problem

Started by Nicola, November 13, 2023, 11:39:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hi Charles,
Are there any problems with the ubound function?

I've tried this and it gives me some problems..

uses console
redim double a[5]

print "ubound of array: " ubound(a)

sub ff(double *d[])
print "Test attributes of a passed dynamic array" cr cr
int i
print "dims: " tab dims(d) cr
print cr
print "ubound of array: " ubound(d)
end sub
ff a
del a

This is the result I get:

ubound of array: 0
Test attributes of a passed dynamic array

dims:  1995979616

ubound of array: 0

Charles Pegge

Hi Nicola,

It worked perfectly with multidimensional arrays. But I've now fixed it for 1d arrays:

Not quite!
My changes failed the self-compile test so I've withdrawn P9 until I have fixed the problem


In fact, Charles,
I was still having trouble and thought it was me who wasn't declaring the variables correctly... 
I was having incomprehensible results.
Thank you for your valuable help.
Good luck with your work.

I'm looking forward to the new P9.