About .String
Posted: Thu Oct 05, 2006 6:23 pm
Why this does not work?
Code: Select all
*v.string=@"hihi"
Debug *v\s
Code: Select all
*v.string=@"hihi"
Debug *v\s
Code: Select all
*v.string=@"hihi"
Code: Select all
*v.string = AllocateMemory(10)
*v\s = "hihi"
Debug *v\s
is better written:*v.string = AllocateMemory(10)
Code: Select all
*v.string = AllocateMemory(SizeOf(String))
Because you are assigning the memory address of the string pointer to your structured var, instead you should assign the actual string pointer itself.Psychophanta wrote:Why this does not work?Code: Select all
*v.string=@"hihi" Debug *v\s
Code: Select all
text.s = "Testing..."
*Pointer = @text
*s.STRING = @*Pointer
Debug *s\s
Code: Select all
*Pointer = @"Testing..."
*s.STRING = @*Pointer
Debug *s\s; ; <--- shouldn't be the same result?
Debug PeekS(*s); <-/
he he, no. Again you are trying to peek a string from the address of the string pointer.Psychophanta wrote:i see![]()
Thanks guys!
I think the correct answer is the Kale's one
EDIT: Strings pointers and descriptor cause me headache. Another question:Code: Select all
*Pointer = @"Testing..." *s.STRING = @*Pointer Debug *s\s; ; <--- shouldn't be the same result? Debug PeekS(*s); <-/