Not as far as I know, but it would be something I'd love to see. I couldn't figure out how to do a semi-nasty hack to get the list base because the links in the elements point to NULL at either end of the list rather than back to the list header.
However, you could probably do some really full on nasty hack and and do something like this, which works but its a hack:
Code: Select all
Structure MyType
a.l
EndStructure
Structure nodeMyType
*next.nodeMyType
*prev.nodeMyType
dat.MyType
EndStructure
Structure ListHead
*head.nodeMyType
*tail.nodeMyType
EndStructure
DefType.ListHead *lh
DefType.nodeMyType *node
NewList mylist.MyType()
If OpenConsole()
If AddElement(mylist())
mylist()\a = 666
EndIf
PrintN("Address of data in first element = 0x"+RSet(Hex(@mylist()), 8, "0"))
PrintN("Address of structure of first element = 0x"+RSet(Hex(@mylist()-8), 8, "0"))
!MOV eax,[e_mylist]
!MOV dword [p_lh],eax
PrintN("Current element of list = 0x"+RSet(Hex(*lh), 8, "0"))
!MOV eax,[t_mylist]
!MOV dword [p_lh],eax
PrintN("1. Base address of list = 0x"+RSet(Hex(*lh), 8, "0"))
PrintN("1. Head pointer in list = 0x"+RSet(Hex(*lh\head), 8, "0"))
PrintN("1. Tail pointer in list = 0x"+RSet(Hex(*lh\tail), 8, "0"))
; Prove it
If AddElement(mylist())
mylist()\a = 123
PrintN("Address of new element (data/structure) = 0x"+RSet(Hex(@mylist()), 8, "0")+"/"+RSet(Hex(@mylist()-8), 8, "0"))
PrintN("2. Head pointer in list = 0x"+RSet(Hex(*lh\head), 8, "0"))
PrintN("2. Tail pointer in list = 0x"+RSet(Hex(*lh\tail), 8, "0"))
EndIf
ResetList(mylist())
While NextElement(mylist())
PrintN("A. data = "+Str(mylist()\a))
Wend
PrintN("")
*node = *lh\head
While *node
PrintN("B. data = "+Str(*node\dat\a))
*node = *node\Next
Wend
PrintN("Press return to exit")
Input()
CloseConsole()
EndIf
End
If you paint your butt blue and glue the hole shut you just themed your ass but lost the functionality.
(WinXPhSP3 PB5.20b14)