why wont this work?
PFloyd36069
Posts: 135
hi guys,
i am trying to send some info to an object but i cant get it to work. im not too good at spin yet so it is most likely not even close. here is my code...
········· pub start | title, album
··········· title:=string("Time")
············album:=string("Dark Side Of The Moon")
··········· info.start(@title, @album)
i am trying to send the title and album info to the object. when i run the program all i get is a P for the title.
thanks,
bryan
·
i am trying to send some info to an object but i cant get it to work. im not too good at spin yet so it is most likely not even close. here is my code...
········· pub start | title, album
··········· title:=string("Time")
············album:=string("Dark Side Of The Moon")
··········· info.start(@title, @album)
i am trying to send the title and album info to the object. when i run the program all i get is a P for the title.
thanks,
bryan
·
Comments
the two variables "title" & "album" you are using are declared as LONG INTEGERS because you are declaring LOCAL variables in the method "Start", all local variables declared this way will be LONG Integers.
If you want to hold a "string" in a variable you will need to declare an array of bytes in the VAR block
eg
VAR
BYTE Title[noparse][[/noparse]25]
BYTE Album[noparse][[/noparse]25]
this declares the variables 'Title" & Album" as string of 25 bytes each, then you can store the strings in them.
Also the @ symbol makes the variable a reference to the address of the variable and not the contents of the variable ( also known as a pointer)
Regards
Dave M
It is however necessary to declare space if you want a copy of the contents of the string for some other use:
Danged editor :<···Added necessary indents in "pub main" lines.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Post Edited (jazzed) : 7/30/2008 4:15:07 AM GMT