Structure mystruc
mylong.l
mystring.s
...
Endstructure
*struc.mystruc = Allocatememory(sizeof(mystruc))
*struc\mylong = sizeof(mystruc)
*struc\mystring = "Loaded dato on the string..."
...
; At end you need to de-allocate string data
*struc\mystring = ""
Freememory(*struc)
Structure mystruc
mylong.l
mystring.s
EndStructure
;-
Procedure FreePBString(*Address)
; Procedure and method of removing structure strings from memory from freak @ http://www.purebasic.fr/english/viewtopic.php?t=23099&start=0
Protected String.String
; The String Structure contains one String element, which is initialized to 0 on procedure start
PokeL(@String, *Address)
; poke our strings address into the structure. When returning, PB's string free routine for the local structure will actually free the passed string.
EndProcedure
;-
*struc.mystruc = AllocateMemory(SizeOf(mystruc))
*struc\mylong = SizeOf(mystruc)
*struc\mystring = "Loaded dato on the string..."
; At end you need to de-allocate string data
FreePBString(@*struc\mystring)
;
FreeMemory(*struc) : *struc = 0
;-
End
;-