PxPlus User Forum

Twitter Twitter Twitter

Author Topic: 'DROP' mnemonic with ERR= clause  (Read 1268 times)

James Zukowski

  • Diamond Member
  • *****
  • Posts: 308
    • View Profile
'DROP' mnemonic with ERR= clause
« 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?
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

PxPlus

  • Administrator
  • Diamond Member
  • *****
  • Posts: 1091
    • View Profile
Re: 'DROP' mnemonic with ERR= clause
« Reply #1 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),

James Zukowski

  • Diamond Member
  • *****
  • Posts: 308
    • View Profile
Re: 'DROP' mnemonic with ERR= clause
« Reply #2 on: September 05, 2023, 03:16:45 PM »
Thanks. Just surprised it's not a syntax error.
James Zukowski
Sr. Developer - J&E

BRAND>SAFWAY
Brand Industrial Services

PxPlus

  • Administrator
  • Diamond Member
  • *****
  • Posts: 1091
    • View Profile
Re: 'DROP' mnemonic with ERR= clause
« Reply #3 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)