Computer Science Canada Another Record Error |
Author: | Justin_ [ Fri Jan 20, 2006 6:39 am ] | ||
Post subject: | Another Record Error | ||
I'm getting an error, it highlights ":=o" for both urlNum and url_count. Does this mean I'm initializing my record variables incorrectly? |
Author: | Delos [ Fri Jan 20, 2006 9:06 am ] | ||
Post subject: | |||
The elements in a record cannot be initialized directly. They are basically descriptions of what the variable will contain. You wouldn't want to initialize them right away anyway - that wouldn't be fun. You should, however, create a function to initialize them:
|
Author: | Martin [ Fri Jan 20, 2006 9:14 am ] |
Post subject: | |
If you know how to use them, a class is a better solution than using a record. |
Author: | Justin_ [ Fri Jan 20, 2006 11:24 am ] |
Post subject: | |
Yeah well, my record just so happens to be used in a flexible array, so I really can't see it being too efficient having to initilaize every element inside the array IF it gets created. I wish i knew about classes if they could help. |
Author: | Delos [ Fri Jan 20, 2006 11:48 am ] |
Post subject: | |
Read Cervantes Tut on it. It's a long haul, but it will introduce you and guide you through a fair deal. |
Author: | Cervantes [ Fri Jan 20, 2006 5:11 pm ] | ||||
Post subject: | |||||
The other way of doing it is:
I'm fairly certain the above works, though I doubt if it would work on types:
I highly doubt that would work, but it's worth a try. This calls for a new acronym: NOWNOW Not on Windows now But yes: objects. ![]() |