PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Generic Input  (Read 353 times)

Jeffrey Ferreira

  • Gold Member
  • ****
  • Posts: 82
    • View Profile
Generic Input
« on: January 20, 2020, 02:26:49 PM »
I'm trying to write a small generic dialogue screen that i can use for quick generic inputs [like enter qty]
on the obtain i was trying to do

i wanted to do something like

repeat
   obtain(0);mode$=hta(eom)
 until mode$=$0D$

i kept getting more data in my mode$ instead of $0D$

20500 ! ^1000
20510 GENERIC_INPUT:
20530 enter (PANEL_TITLE$),(PROMPT$),RETURN_VALUE$,err=*next
20540 let RETURN_VALUE$=""
20550 let PANEL_WIDTH=34
20560 let PANEL_HEIGHT=20
20570 let MULTI_LINE_WIDTH=32
20580 let MULTI_LINE_HEIGHT=1
20590 let MULTI_LINE_Y_POSITION=10
20600 call "CAIREPOS;PRINT_CENTERED_DIALOGUE",PANEL_WIDTH,PANEL_HEIGHT,(PANEL_TITLE$)
20610 print 'caption'(PANEL_TITLE$),
20620 print 'text'(@x(1),@y(3),@x(32),@y(8),PROMPT$,"W")
20630 let MULTI_LINE_CTL=100
20640 multi_line MULTI_LINE_CTL,@(1,MULTI_LINE_Y_POSITION,MULTI_LINE_WIDTH,MULTI_LINE_HEIGHT),fnt="*",opt="X"
20650 if not(nul(PANEL_TITLE$)) then let COLUMN_HEADING$=PANEL_TITLE$
20660 set_focus MULTI_LINE_CTL
20680 let RETURN_VALUE$=""
20690 let MODE$=""
20700 obtain (0)NIU$
20720 multi_line read MULTI_LINE_CTL,RETURN_VALUE$,MODE$
20760 print (0,err=*next)'pop',
20990 exit

keith.mcbride

  • Member
  • **
  • Posts: 7
    • View Profile
Re: Generic Input
« Reply #1 on: January 20, 2020, 02:31:28 PM »
Since you are setting mode$ to the HTA() of eom your check in the until should be

UNTIL mode$="0D"

instead of comparing to $0D$

Jeffrey Ferreira

  • Gold Member
  • ****
  • Posts: 82
    • View Profile
Re: Generic Input
« Reply #2 on: January 20, 2020, 02:40:13 PM »
Hi Keith,

when I do
mode$=hta(eom)
if i stop and print it the value of
mode$ is 00800064

jeff


James Zukowski

  • Diamond Member
  • *****
  • Posts: 155
    • View Profile
Re: Generic Input
« Reply #3 on: January 20, 2020, 04:06:49 PM »
Try checking the MODE variable on the MULTI_LINE directive instead.
James Zukowski
Programmer / ERP Analyst
Beauty Enterprises, Inc.
150 Meadow St.
Hartford, CT 06114
860.296.9303  Ext 231

Mike King

  • Administrator
  • Diamond Member
  • *****
  • Posts: 3361
  • Mike King
    • View Profile
    • PVX Plus Technologies
Re: Generic Input
« Reply #4 on: January 20, 2020, 04:43:45 PM »
The EOM system variable contains the character/event signal that terminated that last OBTAIN.

The EOM you are seeing (0x00800064) indicates a CTL code 100 (Hex 64 is decimal 100, and the preamble of $0080$ indicates the CTL value follows).

So the OBTAIN was terminated by control 100 firing an on change event.

To see why the Multi-line signaled the on change event you need to test the EOM value (mode$) returned in the Multi_line read.