It is currently Sat Jan 16, 2021 10:40 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Get List ObjectPointer
PostPosted: Sat Dec 14, 2019 9:49 am 
Offline
Addict
Addict
User avatar

Joined: Sat Feb 13, 2010 3:45 pm
Posts: 1145
Code:
EnableExplicit


Structure LISTOBJECT
  *ListHeader
  *CurrentElement
EndStructure

Structure LISTHEADER
  *FirstElement
  *LastElement
  *CurrentElement
  *PtrToObject
  ListSize.i
  ListIndex.i
EndStructure


NewList MyList()
Define *ListObject.LISTOBJECT
Define *ListHeader.LISTHEADER

PushListPosition (MyList())
*ListObject = ResetList (MyList()) - SizeOf (Integer)
*ListHeader = *ListObject\ListHeader
PopListPosition (MyList())


AddElement (MyList())
AddElement (MyList())

Debug ""
Debug *ListHeader\FirstElement
Debug *ListHeader\LastElement
Debug *ListHeader\CurrentElement
Debug *ListHeader\ListSize

AddElement (MyList())
AddElement (MyList())

Debug ""
Debug *ListHeader\FirstElement
Debug *ListHeader\LastElement
Debug *ListHeader\CurrentElement
Debug *ListHeader\ListSize


Only testet on Windows
Unfortunately this trick doesn't work for maps :(

_________________
sorry for my bad english


Top
 Profile  
Reply with quote  
 Post subject: Re: Get List ObjectPointer
PostPosted: Sat Dec 14, 2019 10:02 am 
Offline
Addict
Addict
User avatar

Joined: Sun Nov 05, 2006 11:42 pm
Posts: 4835
Location: Lyon - France
Works here :shock:
Thanks for sharing 8)

_________________
ImageThe happiness is a road...
Not a destination


Top
 Profile  
Reply with quote  
 Post subject: Re: Get List ObjectPointer
PostPosted: Sat Dec 14, 2019 11:05 am 
Online
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1804
Location: Uttoxeter, UK
@Josh,
Appears to work on my MacBook Pro.

Output:
Code:
4298439048
4298439080
4298439080
2

4298439048
4298439144
4298439144
4




Model Name: MacBook Pro
Model Identifier: MacBookPro12,1
Processor Name: Dual-Core Intel Core i7

System Version: macOS 10.15.2 (19C57)
Kernel Version: Darwin 19.2.0

_________________
DE AA EB


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 20 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye