Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Array Poblem with Patch 3

Author
Message
Michael
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 27th Nov 2002 00:51
Hello,

Not sure if anyone else has run into this but

ARRAY COUNT(MapArray())

now generates an error instead of giving me the size of the array.

#100008: Parameter for 'ARRAY COUNT' do not match 'Array Name(0)'

What do I need to change so that my parameters match to run the code.
Lampton Worm
21
Years of Service
User Offline
Joined: 4th Sep 2002
Location: United Kingdom
Posted: 27th Nov 2002 01:12
Hi there, you need a 0 in there..e.g,

dim test(10)
do
text 0,0,str$(array count(test(0)))
sync
loop

I'm using DBP Patch3 also.

Cheers
rapscaLLion
21
Years of Service
User Offline
Joined: 29th Aug 2002
Location: Canada
Posted: 27th Nov 2002 01:44
that's sorta retarted in my opinion, that you have to add a zero, but thats bareable.
What I can't stand is that command returns the product of all the dimensions! Totally useless exept for 1 dimensional arrays!

Alex Wanuch
aka rapscaLLion
Kousen Dev Progress >> Currently Working On Editors
Michael
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 27th Nov 2002 01:49
Actually the (0) has nothing to do with it. Your code will compile with or with out the 0 it will even compile with just array name.

I did a little test and this code replicates the problem. It is really with the TYPE that I used. This code would compile with Patch 2 just not with Patch 3 if you change the array to an Integer array it compiles fine.


TYPE testType
X AS INTEGER
ENDTYPE

GLOBAL DIM TestArray(20) AS testType

main()

FUNCTION main()
SortTestArray()
ENDFUNCTION

FUNCTION SortTestArray()
FOR ctr = 1 to (ARRAY COUNT (TestArray(0)))
TestArray(ctr) = 0
NEXT ctr
ENDFUNCTION

Michael
21
Years of Service
User Offline
Joined: 26th Nov 2002
Location:
Posted: 27th Nov 2002 01:53
sorry forgot the .X on line 20



Login to post a reply

Server time is: 2024-05-07 20:39:04
Your offset time is: 2024-05-07 20:39:04