![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hi,
could someone help me with this : I'm using a array of type : Sub Globals Dim Type(Dep, Arr, Fic1, Fic2, Tra) Depart (1) Then, in a procedure, I'm reading the size of the array : NbDepart = FileRead (c1) I'm sizing the array : Dim Depart (NbDepart) But then I've got an error when trying : Depart(0).Dep = 1 --- I've tried to put a fixed size on the array of type and it works. I've tried to add 1 to NbDepart, to be sure it's concerted to an integer but it does not work. Any idea ? Is this a bug ? |
|
||||
|
Once you've declared a Global variable, you can't change its size
![]()
__________________
Endemol ![]() Waste of space ![]() O2 XDA Artemis Touch Flo 4.02 Full Cube Rom WM6.1 http://www.taximania.net |
|
||||
|
Quote:
I have used globals before, and have their initial value (set in the globals sub) altered in other subs.... I'm thinking more of a file related error... Code:
NbDepart = FileRead (c1) Are you sure you aren't getting an empty string? EDIT: Erel beat me to the clock and as always he knows best...
__________________
Paulo Gomes Porto, Portugal PC: Dual-Core 1,8Ghz, 2GB RAM, 80GB HD PPC: Qtek9000, 1GB SD DLL Version Listing Last edited by Cableguy : 10-27-2007 at 07:57 PM. |
|
||||
|
Quote:
I stand corrected ![]() But: I'm even more confused now ![]() Code:
Dim Depart(NbDepart,5)
Depart(0).dep = 13331
So shouldn't it be NbDepart(0).dep = 13331 etc ![]()
__________________
Endemol ![]() Waste of space ![]() O2 XDA Artemis Touch Flo 4.02 Full Cube Rom WM6.1 http://www.taximania.net |
|
||||
|
NbDepart is an integer. We like to resize Depart which is an array of structures.
As I wrote, an array of structures is actually a two dimensions array. So: Depart(0).Fic1 = 3 equals to Depart(0,2) = 3 And when we need to resize Depart we write: Dim Depart(100,5) or Dim Depart(NbDepart,5) where 5 is the number of fields. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Different Line Types | ceaser | Code Samples & Tips | 4 | 08-20-2008 02:39 PM |
| Nullifying an Array | mjcoon | Questions & Help Needed | 1 | 06-20-2008 06:20 PM |
| Array but not array | Cableguy | Questions & Help Needed | 1 | 09-22-2007 09:09 PM |
| Array of Array possibility? | Stellaferox | Basic4ppc Wishlist | 0 | 09-18-2007 01:16 PM |
| Undeclared array error with version 5 | mwaite | Questions & Help Needed | 6 | 05-19-2007 11:39 AM |