[SOLVED] How to get Text from a text pointer

Just starting out? Need help? Post your questions and find answers here.
avatar
User
User
Posts: 35
Joined: Fri Apr 16, 2010 11:43 am

[SOLVED] How to get Text from a text pointer

Post by avatar »

I refer to the manual about the pointer, my codes below cannot retrieve the text.
Please help
Example:
Text$ = "Hello"
*Text = @Text$ ; *Text store the address of the string in memory
*Pointer.String = @*Text ; *Pointer points on *Text
Debug *Pointer\s ; Display the string living at the address stored in *Pointer (i.e. @Text$)

Code: Select all

Procedure.s getText(*textAddress)
  ProcedureReturn *textAddress\s ; <----------------- ERROR
EndProcedure
text.s = "testing text"
Debug getText(@text)
Last edited by avatar on Sat Apr 24, 2010 1:51 pm, edited 1 time in total.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: How to get Text from a text pointer

Post by srod »

Code: Select all

Procedure.s getText(address)
  Protected *textAddress.STRING = @address
  ProcedureReturn *textAddress\s ; <----------------- ERROR
EndProcedure
text.s = "testing text"
Debug getText(@text)
I may look like a mule, but I'm not a complete ass.
avatar
User
User
Posts: 35
Joined: Fri Apr 16, 2010 11:43 am

Re: How to get Text from a text pointer

Post by avatar »

Thank you for your help
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: [SOLVED] How to get Text from a text pointer

Post by srod »

You're welcome.
I may look like a mule, but I'm not a complete ass.
Post Reply