Dear Support
1. How are passed the parameters standard in PureBASIC?
2. How do I give byref through in pure basic ?
3. How can I get the memory address to an pointer in PureBASIC ?
Thanks for your answer before
Stephane
Questions about passing parameters
In purebasic paramaters are always passed by value, on the stack in the standard c manner.
Pointer are dealt with explicitly, and the langauge does not attempt to obscure them from you through syntax.
When you pass a pointer to a structure, you are passing a pointer to a structure, the address at which that structure is held, which is a long. There is none of this obfuscating ByRef nonsense.
Pointer are dealt with explicitly, and the langauge does not attempt to obscure them from you through syntax.
When you pass a pointer to a structure, you are passing a pointer to a structure, the address at which that structure is held, which is a long. There is none of this obfuscating ByRef nonsense.
i was asking the same question about ByRef and searched the forums... anyway some experimenting yielded this result.
Code: Select all
Procedure morph(*varbyref)
PokeS(*varbyref, "outside has been changed")
EndProcedure
outside.s = "ok"
Debug outside
morph(@outside)
Debug outside
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
( The path to enlightenment and the PureBasic Survival Guide right here... )
akee,
Be careful poking those strings
Be careful poking those strings
Code: Select all
Procedure morph(*varbyref)
PokeS(*varbyref, "outside has been changed")
EndProcedure
outside.s = "ok"
after.s = "not ok"
Debug outside
Debug after
morph(@outside)
Debug outside
Debug after