[Info-vax] Pascal question
John Reagan
xyzzy1959 at gmail.com
Mon Jan 21 12:00:28 EST 2019
On Monday, January 21, 2019 at 11:40:02 AM UTC-5, Arne Vajhøj wrote:
> On 1/21/2019 11:19 AM, Emilio Moreno wrote:
> > Here is another one. upcase
>
> Weird. I don't seem to be able to find anything better
> than:
>
> program uc(input,output);
>
> type
> string = varying [255] of char;
>
> function upcase(s : string) : string;
>
> var
> tmp : string;
>
> begin
> str$upcase(tmp.body, s.body);
> tmp.length := s.length;
> upcase := tmp;
> end;
>
> var
> s1, s2 : string;
>
> begin
> s1 := 'abc';
> s2 := upcase(s1);
> writeln(s1,'->',s2);
> end.
>
> Arne
str$upcase is about the best you'll get from Pascal. Some folks like to use the undocumented, but popular, DBAS$EDIT() from the BASIC RTL.
More information about the Info-vax
mailing list