arint
asked on
string to Char coonversion
is there any way to convert "D" as a string type into "D" as a char type with Delphi 3?
What about ?
var
St : String;
Ch : PChar;
begin
Ch := PChar(St);
...
end;
var
St : String;
Ch : PChar;
begin
Ch := PChar(St);
...
end;
itamar's answer will convert string to PChar. If you want to convert string to Char, try this:
var
c: PChar;
s: string;
begin
c := ' ';
if (Length(s) > 0) then
c := @s[1];
...
end;
JB
var
c: PChar;
s: string;
begin
c := ' ';
if (Length(s) > 0) then
c := @s[1];
...
end;
JB
P.S. Should read
c := s[1];
NOT
c := @s[1];
JB
c := s[1];
NOT
c := @s[1];
JB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
HEI !
Isn't this "proposed answer" the JimBob's comment put as an answer ?? :<
Isn't this "proposed answer" the JimBob's comment put as an answer ?? :<
yeah but if you leave the question open it's easy point's !!
You clearly have a good idea of the spirit in which Experts Exchange is run...
ASKER