[Info-vax] A SYS$ version of F$EDIT

Dave Froble davef at tsoft-inc.com
Sat Jun 1 22:13:23 EDT 2019


On 6/1/2019 8:55 PM, Arne Vajhøj wrote:
> On 5/31/2019 10:11 PM, John Reagan wrote:
>> Many people used to call BAS$EDIT from non BASIC code on VAX.  It is
>> now called DBAS$EDIT in Alpha going forward.  We use to document all
>> those language RTL entry points.
>
> So like:
>
> $ type edit.pas
> program edit(input,output);
>
> const
>     COLLAPSE = 2;
>     TRIM = 8 + 128;
>     COMPRESS = 16;
>     UPCASE = 32;
>     QUOTE = 256;
>
> type
>     varstr = varying[255] of char;
>
> [external]
> function dbasic$edit(%DESCR newstr : varstr;
>                       %DESCR oldstr : varstr;
>                       %IMMED editlist : integer) :  integer; external;
>
> procedure test(s : varstr; editlist : integer);
>
> var
>     res : varstr;
>
> begin
>     dbasic$edit(res, s, editlist);
>     writeln('|' + s + '| -> |' + res + '|');
> end;
>
> begin
>     test('Test', UPCASE);
>     test(' X ', TRIM);
>     test('X   X', COMPRESS);
>     test('X X X', COLLAPSE);
>     test(' x  x  x ', COMPRESS + TRIM + UPCASE);
>     test('x x " x x " x x', COLLAPSE + UPCASE);
>     test('x x " x x " x x', COLLAPSE + UPCASE + QUOTE);
> end.
> $ pas edit
> $ lin edit + sys$input/opt
> sys$share:dec$basrtl/share
> $
> run edit
> |Test| -> |TEST|
> | X | -> |X|
> |X   X| -> |X X|
> |X X X| -> |XXX|
> | x  x  x | -> |X X X|
> |x x " x x " x x| -> |XX"XX"XX|
> |x x " x x " x x| -> |XX" x x "XX|
>
> Arne
>
>

Now I'm totally confused.  Same old territory for me ...

John wrote that the routine name is DBAS$EDIT.  You declared an external 
function named dbasic$edit, if I understand your code.  I've never used 
Pascal.  So, how do you reach an external routine when you don't use 
it's correct (if John is correct) name?


-- 
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