Copy method 4 copies the structure and when that copy (i.e. the structured variable) goes out of scope it will be automatically freed.
Copy method 3 copies the structure but the copy is going to go out of scope it likewise needs to have a FreeStructure() called with the address in the structured pointer.
Copy method 1 & 2 is not a copy of the structure. If it works it will end up simply pointing at the structured variable memory of the source that was supposed to instead be copied but wasn't.
@Edit: I missed that method 1 also used a pointer and instead had thought it was the same as method which wasn't posted until later.
Last edited by Demivec on Tue Nov 12, 2024 10:54 am, edited 1 time in total.
No. That's wrong. If you would use `EnableExplicit` you would have get an error message because `*StudentCopy` is not the same variable as `StudentCopy`.
So either you do it like this:
Piero wrote: Mon May 12, 2025 6:46 pm
Thanks!
Forgive my noob confusion about "@variable address" and "*address"
PS: I think AllocateStructure should be mentioned on CopyStructure help (it's very unclear IMHO… anyway this is "advanced" stuff…)
You don't have to apologize. It's normal if you don't understand straight away. But I like to write examples because I can learn well from examples myself. I hope it helps.
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
NicTheQuick wrote: Tue May 13, 2025 10:30 amYou don't have to apologize. It's normal if you don't understand straight away. But I like to write examples because I can learn well from examples myself. I hope it helps.
Why not? * and @ are """basic PB stuff"""
I still didn't really need it, but I was "investigating" PB options for "ultra-fast operations using pointers"
I'm more into """"high-level"""" programming since a long time; I'm "rusty" about that stuff…
So, from my point of view, I must repeat: help was a bit confusing…