Declaring Arrays
Posted
#1
(In Topic #253)
Regular

I can’t find how and where to declare Arrays.
I think this should be done in the Project’s first form : Fmain
When I try to run for example in Fmain.Class :
Public Sub Form_Open()
Dim A[50] AS String
End
I get : “Embedded arrays are forbidden here in Fmain.Class”
And I get the same notification wherever I try.
In the Beginners Guide I read “Arrays are always initialized as void at startup”
So, where is ‘Startup’ ?
Old african saying:
You eat an elephant one small bite at a time.
You eat an elephant one small bite at a time.
Posted
Guru

Here is a start for you. This small program will run, it will find all the 'hidden' files in your Home folder: -
Code (gambas)
- ' Gambas class file
The iGlobalArray can be used anywhere in this class. If you want to use it in another class add 'Public' to the beginning of the line.
The arrays in Public Sub Form_Open() can only be used in this procedure.
In the Beginners Guide I read “Arrays are always initialized as void at startup”
So, where is ‘Startup’ ?
This says that when you startup your program all arrays will be empty.
Posted
Regular

It will take some time as I did some programming - many years ago - in RealBasic. Gambas feels like it, but it's obviously not quite the same.
Old African proverb says: "One eats an elephant one little bit at a time"
Thanks
Old african saying:
You eat an elephant one small bite at a time.
You eat an elephant one small bite at a time.
1 guest and 0 members have just viewed this.


