20 lines
467 B
Text
20 lines
467 B
Text
DIM node{pPrev%, pNext%, iData%}
|
|
DIM a{} = node{}, b{} = node{}, c{} = node{}
|
|
|
|
a.pNext% = b{}
|
|
a.iData% = 123
|
|
b.pPrev% = a{}
|
|
b.iData% = 456
|
|
c.iData% = 789
|
|
|
|
PROCinsert(a{}, c{})
|
|
END
|
|
|
|
DEF PROCinsert(here{}, new{})
|
|
LOCAL temp{} : DIM temp{} = node{}
|
|
new.pNext% = here.pNext%
|
|
new.pPrev% = here{}
|
|
!(^temp{}+4) = new.pNext%
|
|
temp.pPrev% = new{}
|
|
here.pNext% = new{}
|
|
ENDPROC
|