I have something like this: var ListString: PString; ListString := PString(THackSList(MySList).FList^[Index].FString);
I was trying to do this: Showmessage(ListString^); //but this generates an AV.
I need to do this: Showmessage(String(ListString)); // it works!
Why is that?
Cheers, Ross.
----- Original Message ----- From: "Ross Levis" <[EMAIL PROTECTED]>
Hi Dennis
I know it's a hack but it will save a lot of work if I can get it to work.
I now have a problem which may stuff this idea up completely. A TStringList reallocates memory for the FList array as it gets bigger, as expected, but the location of the string also seems to be moving. For some reason I expected the string to stay where it was, and only the pointer array move location. But after 4 strings are added, the address returned from this code changes.
showmessage(inttostr(integer(@THackSList(MySList).FList^[0].FString)));
I've not been doing pointer manipulation for long so I may be doing it wrong. If I leave off the @, I get a constant address which doesn't change, but it does not appear to be the string location.
Am I stuffed?
Cheers, Ross.
_______________________________________________ Delphi mailing list [EMAIL PROTECTED] http://ns3.123.co.nz/mailman/listinfo/delphi
