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.

Nicola

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
'
'TEST:
ff a
wait
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








http://forum.it-berater.org/index.php?msg=25169

Charles Pegge

#1
Hi Nicola,

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

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

Nicola

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.

Cheers