On Thu, 28 Jan 2021, at 19:44, Jeremy Nicoll wrote:
> On Thu, 28 Jan 2021, at 07:58, David Crayford wrote:
> > I think your the one missing the point. I can't remember the last time I 
> > had to write a macro as I can do the things I need just using commands.
> 
> I used Xedit (with macros I wrote in EXEC or EXEC 2) for a few years in the
> 1980s.

One of those was quite interesting.  I was working in a college where we
taught students to program in WATERLOO BASIC, which was a line-
numbered language with GOTO and GOSUB that were line-number 
based.

I decided to expand the capability of the language to support named 
functions & procedures and remove all the line numbers.  When someone
saved a file written in my improved BASIC an edit macro reinserted the 
line numbers and replaced named function/procedure definitions and calls
with the line-number-based instructions, and placed a flag in a REM 
statement near the start of the file saying this had been done and 
altered other lines so the names the programmer had used were still 
there somewhere (I can't remember the fine details). Of course if there 
were problems with the file it stopped and told the user to fix them,
rather than writing the modified file to disk.

When someone started to edit such a program the line numbers were 
stripped out and their previously-defined names reinserted.  

Both macros obviously had to do a certain amount of checking for things
that could screw-up the process.


We only let the more competent students use the improved BASIC, as
at run-time it was the line-numbered code that they themselves hadn't
written that would run and errors they might see would be in terms of 
the manipulated code.  Ironically it was the less-able students who may
have benefitted most from being able to write 

   call printline

rather than eg 

12010 GOSUB 15000

Even just not having 6 or 7 columns of screen space wasted with the
line numbers was an advantage...


[I think what inspired me to do this may have been our use of a Pascal 
compiler (from a Swiss or German university?) which needed certain 
characters - maybe square brackets? - represented by different byte 
values from those that our UK VM/CMS system generated.  That was 
solved with Xedit macros that fiddled with those program files just 
before a user edited them and just afterwards.]  

-- 
Jeremy Nicoll - my opinions are my own.

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to