Syntax error passing arrays

Here we can discuss about the problem found
Post Reply
bugs
Posts: 143
Joined: Mon Feb 08, 2021 10:10 pm
Location: Scotland
Has thanked: 47 times
Been thanked: 51 times

Syntax error passing arrays

Post by bugs »

Little buggette if passing two arrays:-

Code: [Local Link Removed for Guests]

' passing arrays

dim c(10)
dim d(10)

sub test(a(),by()) 
  'do stuff
end sub

test c(),d()      'this looks like a bug - must have a space after the first comma or get syntax error

wlog "Done"
end
BeanieBots
Posts: 345
Joined: Tue Jun 21, 2022 2:17 pm
Location: South coast UK
Has thanked: 183 times
Been thanked: 112 times

Re: Syntax error passing arrays

Post by BeanieBots »

There needs to be a space between the sub name and the parantheses.
Otherwise the interpreter thinks it's an array name and throws a syntax error. (or not if the array is valid)
This has caught me out in the past. Not sure if it's something that can be fixed.
Name (N) is a sub with parameter N
Name(N) is an array with element N
User avatar
cicciocb
Site Admin
Posts: 2060
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 439 times
Been thanked: 1358 times
Contact:

Re: Syntax error passing arrays

Post by cicciocb »

This has been fixed in the version 1.52.2
Post Reply