Posts: 133
Threads: 19
Joined: Jan 2005
Hi!
Tryed the following but got an error about invalid data types...
Code:
type hiscorestruct
names as string
punkte as integer
end type
dim hiscore(10) as hiscorestruct
temp$ = hiscore(tempnum).names
Is it a bug or did i do something wrong?
So Long, The Werelion!
color=red]Look at you, Hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" - Shodan, AI at Citadel Station orbiting Earth[/color]
Posts: 242
Threads: 29
Joined: Dec 2004
Is there more to your code? What was posted compiled with 0.11 with no problem. It doesn't do anything...
... but it compiles and runs.
The following seems to work correctly:
Code:
type hiscorestruct
names as string
punkte as integer
end type
dim hiscore(10) as hiscorestruct
for counter = 0 to 10
hiscore(counter).names = str$(counter)
next counter
tempnum = 5
temp$ = hiscore(tempnum).names
print temp$
sleep
ature has its way of warning a person away from danger: The distinct black and white coloration on a skunk, the chilling buzz of a rattlesanke, a redneck handing you his beer and saying "Watch this!"
Posts: 922
Threads: 15
Joined: Jun 2003
FB allows dynamic strings on UDT's, but they won't be automatically deallocated when a local UDT (inside a sub-routine) goes off scope, thus leaking if you don't do myudt.mydynstr = "" at end of the sub.
Posts: 133
Threads: 19
Joined: Jan 2005
Quote:FB allows dynamic strings on UDT's, but they won't be automatically deallocated when a local UDT (inside a sub-routine) goes off scope, thus leaking if you don't do myudt.mydynstr = "" at end of the sub.
ARGHHH!!!!!
Thanks for that, i gona hit my head on the wall....
Quess what i forgot to put in the DIM foobar AS UDT... the inevitable shared.
I would fancy it if you would implement a metakeyword.
Code:
$GLOBAL ON
DIM a AS INTEGER
DIM b AS STRING
DIM c AS FLOAT
$GLOBAL OFF
All three above would be globals/shared
So Long, The Werelion!
Please close this >.<
color=red]Look at you, Hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?" - Shodan, AI at Citadel Station orbiting Earth[/color]