Code: Select all
s.s = "abcd"
*p.String = @s
PrintN(*p\s)
Code: Select all
Define s.String
s\s = "abcd"
*p.String = @s
PrintN(*p\s)
Code: Select all
s.s = "abcd"
*p.String = @s
PrintN(*p\s)
Code: Select all
Define s.String
s\s = "abcd"
*p.String = @s
PrintN(*p\s)
Try it this way:ktamp wrote:Code: Select all
s.s = "abcd" *p.String = @s PrintN(*p\s)
Code: Select all
Structure MyString
StructureUnion
s.s
p.l
EndStructureUnion
EndStructure
Define s.s = "abcd"
Define p.MyString\p = @s
Debug(p\s)
Code: Select all
n = 100
*p.Long = @n
PrintN(*p\l)
Code: Select all
n = 100
*p.Long = @n
PrintN(*p\l)
Code: Select all
Structure String
s.s
EndStructure
Code: Select all
aString.String
aString\s = "A String"
Debug SizeOf(aString)
Code: Select all
s.String
s\s = "A String"
Debug @s
Debug @s\s
Debug PeekS(@s\s)
Code: Select all
s.String
s\s = "A String"
Debug "@s ..... " + Str( @s )
Debug "@s\s ... " + Str( @s\s )
Debug "String at @s\s .... " + PeekS(@s\s)
Debug ""
Structure MyString
StructureUnion
s.s
p.l
EndStructureUnion
EndStructure
*p.MyString = @s
Debug "*p = " + Str(*p)
Debug "*p\p = " + Str(*p\p)
Code: Select all
s.s = "abcd"
*p.String = @s
PrintN(*p\s)
That standard structure exists and is called String.ktamp wrote:Thank you. It took me almost a day after reading your first post to realize that "@string" returns the pointer value of "string" itself rather than a pointer to "string". I suppose PB should have a standard structure like your "MyString" to compensate for this fact.
Not quite, as "MyStructure" contains a StructureUnion. On the other hand it finally downed on me how I could do the same thing using String and Long:Trond wrote:That standard structure exists and is called String.
Code: Select all
s.s = "abcd"
p.Long\l = @s
*s.String = @p