Posts: 41
Threads: 21
Joined: Apr 2007
Hello Gintaras:
I have two questions
Is it possible to make a linked list in QM? :?
and the second question : Is there a way to define an undefined data type variable i was thinking something like
void* type in
C
Macro
class node
,int'data
,node*'nextNode
another example:
Macro
class node
,SkinControl'data
,node*'nextNode
Thank you.
Regards.
Posts: 41
Threads: 21
Joined: Apr 2007
Hello Gintaras:
It worked !!
hock:
for example
Macro
;This macro will be displayed when you click this class name in the editor and press F1.
;Add class help here. Add code examples below EXAMPLES.
;EXAMPLES
#compile "__Nodes"
Nodes* x
Nodes* i
x._new()
i=x
x.data=9
x.nextNode._new()
x=x.nextNode
x.data=8
out i.data
i=i.nextNode
out i.data
this is strange but i did it making the first declaration as shown:
I have executed the following code:
Macro
then i have executed the second time with the following code:
Macro
class Nodes
,Nodes'*nextNode
,int'data
but now i have another question:
would it cause unhandled memory leaks?, and
is there a way to define it without runing the class definition two times?
Macro
#ifndef FirstDeclare
,int+ FirstDeclare=1
,class Nodes int'data
#else
,class Nodes Nodes'*NextNode int'data
#endif
Thank you.
Regards
Posts: 12,072
Threads: 140
Joined: Dec 2002
With pointers don't use '. QM sees ' and thinks it is not a pointer, and gives error without further parsing.
Macro
class Nodes
,Nodes*nextNode
,int'data
Maybe instead you can use IXml/IXmlNode classes. Internally it is implemented as linked list or tree.
Posts: 41
Threads: 21
Joined: Apr 2007
Hello Gintaras:
Thank you!!! i didn't notice it :lol:
Regards