[Q]Pascal packed arrary of char and varying of char
- From: stuie_norris@xxxxxxxxxxxx
- Date: Fri, 08 Jun 2007 17:23:34 -0700
Hi Group,
I am trying to update a pascal program, with very little pascal
experience.
The code is full of string of two types - packed array of char and
varying of char.
Most places it uses packed array of char and then copies this to
varying of char.
In the routines that have the varying of char I am trying to work out
the length of the string to display nicely.
In the following code I am trying to obtain the the length the varying
of char string, that has been 'copied' from packed array of char.
However I always get 50.
How do I work out the length of the varying of char string? (I thinks
22 is the correct answer)
Thanks
Stuart
[inherit ('sys$library:starlet', 'sys$library:pascal$lib_routines')]
program test (input, output);
type
mystring = varying [256] of char;
var
namepacked : packed array [1..50] of char;
namevary : mystring;
begin
namepacked := 'the cat sat on the mat';
namevary := namepacked;
writeln ('Length = ', length(namevary), ' .Length
=',namevary.length);
end.
.
- Follow-Ups:
- Re: [Q]Pascal packed arrary of char and varying of char
- From: Bob Koehler
- Re: [Q]Pascal packed arrary of char and varying of char
- From: Arne Vajhøj
- Re: [Q]Pascal packed arrary of char and varying of char
- Prev by Date: Re: Comparative patch installation (was Re:
- Next by Date: Re: Global warming NOT causing more hurricanes UK scientists say
- Previous by thread: OT: Question to Bob
- Next by thread: Re: [Q]Pascal packed arrary of char and varying of char
- Index(es):
Relevant Pages
|