Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2004-03

how to convert a string to pppchar

3 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

GongYu
i defined
type
 PPPChar=^PPChar
end;

now the question is how to convert a string to pppchar or convert a pppchar to string? please help me.

Peter Vreman
to GongYu
Show quoted text 8 lines
i defined type PPPChar=^PPChar end; now the question is how to convert a string to pppchar or convert a pppchar to string? please help me.

pppchar should be read as 'address of an array of pchars'. converting a string to that depends on the situation.

Steve Williams
to GongYu: i defined type PPPChar=^PPChar end; now the question is how to convert a string to…

To convert a PPPChar to a String, you should be able to do

  MyString := String(MyPPPChar^^);

To convert from String to PPPChar, you will need some intermediate variables

  MyPChar := PChar(MyString);
  MyPPChar := @MyPChar;
  MyPPPChar := @MyPPChar;

Sly

Earlier message 15 lines
----- Original Message ----- From: "GongYu" To: Sent: Friday, March 05, 2004 2:16 PM Subject: [fpc-pascal]how to convert a string to pppchar > i defined > type > PPPChar=^PPChar > end; > > now the question is how to convert a string to pppchar or convert a pppchar to string? > please help me.