Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
custom type variable question
#1
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!!!
#2
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.
#3
thanks.
#4
is possible to store in a file a TOTO variable, and to get it back from the file later?
#5
Macro Macro2762
Code:
Copy      Help
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.
#6
no, only simple variables (int, str)

Just want to know if my Toto type can have variable as graphics or audio or rtf...
#7
Graphics, audio and rtf data can be in str variables.
Graphics also can be as bitmap handles.
#8
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..


Forum Jump:


Users browsing this thread: 1 Guest(s)