[Info-vax] Pascal question

Dave Froble davef at tsoft-inc.com
Mon Jan 21 13:50:30 EST 2019


On 1/21/2019 11:41 AM, Arne Vajhøj wrote:
> On 1/21/2019 11:40 AM, 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:
>
> [inherit('sys$library:pascal$str_routines')]
>
>> 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
>
>

How about:

	String Function Ucase( Z$ )
		Ucase = EDIT$(Z$,32%)
	End Function

Of course you'll need to compile the function using Basic, but then it 
should be callable from Pascal??????

External String Function Ucase()

<variable> = Ucase( <variable> )

Note, I don't know Pascal, so structure may not be appropriate ...

:-)


-- 
David Froble                       Tel: 724-529-0450
Dave Froble Enterprises, Inc.      E-Mail: davef at tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA  15486



More information about the Info-vax mailing list