Posts: 795
Threads: 136
Joined: Feb 2009
Gintaras,
i have a new type defined as:
type TOTO str's str'd int'r
TOTO g
how to reset all g's variables (s,d & i)????
i don't want to do g.s.all, g.d.all and g.i=0...each time, the real type TOTO may contain >20 items!!!
Posts: 12,073
Threads: 140
Joined: Dec 2002
TOTO g
...
TOTO _empty; g=empty
But be careful. The variable must not contain Windows handles that must be closed, etc. Close them all before this reset. Don't need to explicitly free strings, arrays and COM objects.
Posts: 795
Threads: 136
Joined: Feb 2009
Posts: 795
Threads: 136
Joined: Feb 2009
is possible to store in a file a TOTO variable, and to get it back from the file later?
Posts: 12,073
Threads: 140
Joined: Dec 2002
Macro
Macro2762
type TOTO str's str'd int'r
TOTO g
g.s="mmm"; g.d="vvvv"; g.r=8
str file="C:\test\TOTO.txt"
str s1.getstruct(g 1)
s1.setfile(file)
str s2.getfile(file)
;out s2
TOTO g2; s2.setstruct(g2)
out g2.d
;del file
Not all types are supported with setstruct/getstruct. For example types with arrays are not supported.
Posts: 795
Threads: 136
Joined: Feb 2009
no, only simple variables (int, str)
Just want to know if my Toto type can have variable as graphics or audio or rtf...
Posts: 12,073
Threads: 140
Joined: Dec 2002
Graphics, audio and rtf data can be in str variables.
Graphics also can be as bitmap handles.
Posts: 795
Threads: 136
Joined: Feb 2009
as i don't see how imbed an audio file in a str variable, i'll try _s.getfile and return if i can't do this..