Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
dynamic Linked list
#1
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
Code:
Copy      Help
class node
,int'data
,node*'nextNode

another example:

Macro
Code:
Copy      Help
class node
,SkinControl'data
,node*'nextNode



Thank you.
Regards.
#2
Hello Gintaras:

It worked !! Confusedhock:
for example

Macro
Code:
Copy      Help
;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
Code:
Copy      Help
class Nodes
,int'data


then i have executed the second time with the following code:

Macro
Code:
Copy      Help
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
Code:
Copy      Help
#ifndef FirstDeclare
,int+ FirstDeclare=1
,class Nodes    int'data

#else
,class Nodes    Nodes'*NextNode    int'data
#endif

Thank you.

Regards
#3
With pointers don't use '. QM sees ' and thinks it is not a pointer, and gives error without further parsing.

Macro
Code:
Copy      Help
class Nodes
,Nodes*nextNode
,int'data


Maybe instead you can use IXml/IXmlNode classes. Internally it is implemented as linked list or tree.
#4
Hello Gintaras:

Thank you!!! i didn't notice it :lol:

Regards


Forum Jump:


Users browsing this thread: 1 Guest(s)