@UNITECH - THANX - I think you pointed out something! That dealing with the pointer directly IS the address and the * is only when dereferencing. Am I correct? I'll play tonight. this means I over complicated it. Just
myAddress=lpPtr;
Should do it! (Simplicity! At Last!)
(No I'm not arbitrarily coming up with addresses.)
I have a home grown double linked list I Ported over from FreePascal I wrote for its pure simplicity (Well... let me qualify) Its not always super simple but its the leanest I've seen compared to the FreePascal "Object Lib" and the C StdLib "Iterator" stuff.
Basically there is a base class for Items...shorthand below:
class JFC_ITEM{
void *lpPtr; // User Use
void *lpPrev;
void *lpNext;
char *saClassName;
};
and the actual "Controller" (Actually has base class of JFC_ITEM to allow multiple dimensions)
class JFC_DL{
void *lpItem; //current item
void *lpFirst;
void *lpLast;
int iNPosition;
...etc
bool Movefirst();
bool MoveNext();
bool MovePrevious();
bool MoveLast();
bool FoundItem(void *p_lpItem);
bool FNextItem(void *p_lpItem);
bool FoundItem_lpPtr(void p_lpPtr); // Find item with JFC_ITEM.lpPtr with eual p_lpPtr
};
Now there are "low level" functions I'm working on that work in FreePascal that make this thing really cool and makes this useful for DarkGDK. It allows you to build anything you want with the Item class JFC_ITEM as the base. Say a class of bad guys in a game. The low level search uses the pointer address of said "Bag guy" class in memory and then Adds the Offset of the member of that class .. say "BadGuy.iBadGuyHealth" and then does a binary search for the value you are looking for using the calculated POINTER+OFFSET to the data, and the data length. This allows you to sort of "Query" the double linked list for things based on exact values and ranges and step through them like a database recordset.
Its this
lpMyPointer=lpBaseAddress + uiOffset; that spaked this thread.
thanx for your help - I'll try the simple syntax (I can't believe I missed that) In FreePascal you have to type cast a pointer to a endian sized unsigned - like C++ unsigned INT... kinda like:
myAddress=@lpMyPointer; <-- ADDRESS OF POINTER
myPointerPointsTo=CARDINAL(lpMyPointer);
From this syntax - I'm trying to do: MyNewMemoryAddress=myPointerPointsTo + MyOffset;
MyNewMemoryAddress=The area in RAM I want to scan during the search - if it matches - great, if not DL->MoveNext() and try again.
It is blazing fast in FReePascal and SO FAR is screaming in C++ as well.