[fpc-pascal] String to PString assignment?

Graeme Geldenhuys graemeg at opensoft.homeip.net
Tue Sep 29 12:45:05 CEST 2009


I'm converting a project from Sibyl (a old OS/2 IDE implement in
SpeedSoft Pascal).

Below is the code I'm trying to convert to Free Pascal. I see FPC has a
PString type, but not FreePString() or NewPString(). Searching the FPC
source code, I found the FP Text IDE using PString all over. The FP Text
IDE uses this...  <some PString var> :=  NewStr(<string>);

Do I need this when I use String = AnsiString in my projects?  Or can I
simply do the following assignment:  _Title := @NevValue;

_Title: PString;


procedure TTopic.SetTitle( const NewValue: string );
  FreePString( _Title );
  _Title:= NewPString( NewValue );

Sorry if this sounds dumb, but I have never used PString before.

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the fpc-pascal mailing list