Page 1 of 1
Posted: Mon Feb 11, 2002 8:50 am
by BackupUser
Restored from previous forum. Originally posted by Stan.
Unless I missed it, there no way to cast pointers, seems PB is VERY
peeky about that ... ( I suppose this is related to the parsing/compilation
method ). As an old C programmer I really miss it !
Any suggestion ?
Stan
Learning and Love are what life is all about ... [ PB. registered user ]
Posted: Mon Feb 11, 2002 12:47 pm
by BackupUser
Restored from previous forum. Originally posted by fred.
What do you want to do exactly ?
Fred - AlphaSND
Posted: Wed Feb 13, 2002 10:06 am
by BackupUser
Restored from previous forum. Originally posted by Stan.
What do you want to do exactly ?
Fred - AlphaSND
Something like :
*Byte_ptr.b
String_one.s = "xxx"
*Byte_ptr = () @String_one
TIA
Learning and Love are what life is all about ... [ PB. registered user ]
Posted: Wed Feb 13, 2002 10:49 am
by BackupUser
Restored from previous forum. Originally posted by Pupil.
Something like :
*Byte_ptr.b
String_one.s = "xxx"
*Byte_ptr = () @String_one
I don't quite understand what you're looking for, but could it possible be something like this:
Code: Select all
Structure chartype
char.b
EndStructure
string.s="hello"
*byte_ptr.chartype=@string
For i=1 To Len(string)
new_string.s+Chr(*byte_ptr\char)
*byte_ptr+1
Next
MessageRequester("",new_string,0)
End
Hope it helps somewhat, if not perhaps a little further explaining of what 'casting' means might clear things for me.
Posted: Wed Feb 13, 2002 1:56 pm
by BackupUser
Restored from previous forum. Originally posted by fred.
Yes, using a pointer (*pointer) and a structure like Pupil have do is the best way to do it. This is the equivalent to a '*(charbuffer) = x' in C.
Fred - AlphaSND