Hi,
<snip>
I also tried my own schemata, similar to the String but with no
"Capacity"
field.
If you really mean a schema type, it wouldn't help. All schemas in GPC store their disciminants, as String does Capacity.
I was unable to assign contents directly as "MyStr := 'ABC';" (I was unable to implement
a
custom assignment operator ":=") so I adopted the String() type.
Can't comment on this, without any concrete examples.
I created a schema that would map on SUN Pascal Varying[n] Of Char:
Type SString (Len: Integer) = Record SStr : Array [1..Len] Of Char; End Value [SStr: [Otherwise Chr(0)]]; Var Str20 : SString(20);
Then I tried to create an operator ":=" to be able to do Str20 := 'abcd'; in the program and set Str20.SStr with the value assigned. However it looks like it is not possible to create the operator ":=" (The code does not compile. It stops with a syntax error on the operator declaration).
Anyway, I modified the program so the mapping of the records with the database contents works with GNU Pascal Strings both ways.
So the FillChar and Records mapping are both solved.
Thanks for your useful remarks.
Pascal Viandier pascal@accovia.com