Array of Char

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Array of Char

Carsten Bager
We are moving from another Pascal compiler where this is
allowed.
----------------------
Type
  txt_typ=packed array[0..1] of char;

Const
  txt1:txt_typ=('12');
--------------------------

Is there a way around this without having to write
--------
  txt1:txt_typ=('1','2');
--------


Another thing, with the old compiler we can write

Type
  A_typ=array[0..3] of integer;
Var
 A1,A2:A_typ;

Begin
  If A1=A2 then
End;

I have never could understand when this is allowed
A1:=A2;

Why this is not allowed
If A1=A2 then

in most Pascal compilers.

Regards Carsten

--
Carsten Bager
Bøvlingbjerg El-automatik
Brørupvænget 10
7650 Bøvlingbjerg
Tlf. +4597885222 Fax +4597885434
http://www.beas.dk


_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
Reply | Threaded
Open this post in threaded view
|

Re: Array of Char

John Coppens
On Thu, 18 Aug 2005 07:24:46 +0200
"Carsten Bager" <[hidden email]> wrote:

> We are moving from another Pascal compiler where this is  
> allowed.
> ----------------------

Type
   txt_typ = packed array[0..1] of char;
 
Const
   txt1: txt_typ = '12';

without the parenthesis should work.

John

_______________________________________________
fpc-pascal maillist  -  [hidden email]
http://lists.freepascal.org/mailman/listinfo/fpc-pascal