PxPlus User Forum

Main Board => Discussions => Language => Topic started by: James Zukowski on September 05, 2023, 12:04:38 PM

Title: 'DROP' mnemonic with ERR= clause
Post by: James Zukowski on September 05, 2023, 12:04:38 PM
Is including an ERR= clause in the 'DROP' mnemonic a valid construct? e.g.:
print 'drop'(Win_Num,err=*next),
It doesn't generate an error, but it also doesn't seem to trap error #57 if the specified (non-zero) window# doesn't exist.
Any insights?
Title: Re: 'DROP' mnemonic with ERR= clause
Post by: PxPlus on September 05, 2023, 02:32:56 PM
The ERR= should be on the print, not on the mnemonic.

e.g.  PRINT (0,ERR-*next) 'DROP'(Win_num),
Title: Re: 'DROP' mnemonic with ERR= clause
Post by: James Zukowski on September 05, 2023, 03:16:45 PM
Thanks. Just surprised it's not a syntax error.
Title: Re: 'DROP' mnemonic with ERR= clause
Post by: PxPlus on September 05, 2023, 03:22:31 PM
Technically the 'DROP' mnemonic is really just a function that returns the escape sequence required to drop the specified window.

For example its perfectly legal to code:

   X$ = 'DROP'(win_num)

This will result in an escape sequence that can be output to console (channel 0).  Any/all mnemonics are really just escape sequences that can be output to a device.

As for the ERR= clause, it would have been triggered if the window number was invalid (such as a negative number or non-integer)