I chased this down this morning and think that this might be a bug. I am using v 3.6.0. From what I can tell you can omit the 'Call' command when calling a Sub and passing non-array variables, but when you call a Sub and pass an array you must have the 'Call' included. Omitting this when passing an array will generate a 'C++ compilation failed' error.
Here is sample code:
--------------------
Call test(b$())
Sub test (b$())
Print "HI"
End Sub
--------------------
The above compiles and works....but if the first line is any of the below iterations it will generate a 'C++ compilation failed' error - and it is not caught by the IDE:
test (b$())
test (b$)
It does not matter if you DIM or DIM SHARED for b$ either - you get the same results. Also it does not matter if the passed variable is a integer or string - you get the same results. I like to exclude 'Call' as I think the code looks cleaner without it, but in this case it just won't work. It appears that it is only an issue where an array is being passed to the Sub as the code below works fine:
--------------------
test (b$)
Sub test (b$)
Print "HI"
End Sub
--------------------
Also I wonder if the IDE needs help in this area too since the 'test (b$)' line in the FIRST example calls a Sub that requires an array, but the IDE does not catch that.
Thanks to all that dedicate work to this project !!!!
Dano
Here is sample code:
--------------------
Call test(b$())
Sub test (b$())
Print "HI"
End Sub
--------------------
The above compiles and works....but if the first line is any of the below iterations it will generate a 'C++ compilation failed' error - and it is not caught by the IDE:
test (b$())
test (b$)
It does not matter if you DIM or DIM SHARED for b$ either - you get the same results. Also it does not matter if the passed variable is a integer or string - you get the same results. I like to exclude 'Call' as I think the code looks cleaner without it, but in this case it just won't work. It appears that it is only an issue where an array is being passed to the Sub as the code below works fine:
--------------------
test (b$)
Sub test (b$)
Print "HI"
End Sub
--------------------
Also I wonder if the IDE needs help in this area too since the 'test (b$)' line in the FIRST example calls a Sub that requires an array, but the IDE does not catch that.
Thanks to all that dedicate work to this project !!!!
Dano