Board index » delphi » String ---> Char

String ---> Char

Hello,

how can I change/transfer a string[1] to char ?
Also, If
.
.
.

Var
        str : string[1]
        ch : char;
.
.
str := 'a';
ch := str;        <-- Here occurs an error !
.
.
.

Woh does it work ?

thanx
Sebastian

 

Re:String ---> Char


Quote
> Hello,

Hi

Quote
> how can I change/transfer a string[1] to char ?

Try this:

Quote
> Var
>         str : string[1]
>         ch : char;
> str := 'a';
> ch := str[1];        
> thanx

you are welcome :-)

--
greetings
 Lukasz Nowicki

 Queen, Taekwondo, Pascal, Wiersze, Opowiadania, FreeDOS PL mirror
 http://www.jagoda.kki.pl/
 want to see some action? www.jagoda.kki.pl/luke.mpg

Re:String ---> Char


Try:  ch:=str[1];
Quote
Sebastian Abt wrote:

> Hello,

> how can I change/transfer a string[1] to char ?
> Also, If
> .
> .
> .

> Var
>         str : string[1]
>         ch : char;
> .
> .
> str := 'a';
> ch := str;        <-- Here occurs an error !
> .
> .
> .

> Woh does it work ?

> thanx
> Sebastian

Other Threads