PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Generic Query  (Read 1182 times)

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 175
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Generic Query
« on: March 07, 2019, 04:35:30 PM »
Hello List,

I tend to always run into these one off situations where I need user input from a list
but the data is not in a file and too many selections for a message box.
and i dislike making a panel for each instance....
so i had this idea for a generic query routine that i could
pass in an associative array
and get a return value
============================================
here is my code ...it is almost working but i dont think i have the OBTAIN right
and the arrows are not working on the list box.....
has anyone ever done this?
can someone help me out

29000 !
29010 GENERIC_QUERY:
29020 enter (PANEL_TITLE$),ARRAY${all},RETURN_VALUE$
29030 if dim(read num(ARRAY$))=0 then exit ! If No Values then Exit
29040 call "CAIREPOS;PRINT_CENTERED_DIALOGUE",50,35,(PANEL_TITLE$) ! This is just my routine to Print a Centered Window (this part works)
29050 let LOAD_THIS$=""
29060 for ARRAY_INDEX$ index ARRAY${all}
29070 let LOAD_THIS$+=ARRAY_INDEX$+sep
29080 next
29090 list_box 100,@(1,1,48,33),fnt="*"
29100 list_box load 100,LOAD_THIS$
29120 list_box write 100,1,err=*next
29121 let NEXT_ID=100
29130 wait .5
29140 repeat
29150 obtain (tim=2)NIU$
29160 let MODE$=""
29170 list_box read 100,RETURN_VALUE$,MODE$,err=*next
29180 until MODE$=$0D$ or MODE$=$02$
29190 print (0,err=*next)'pop',
29990 exit

Jeffrey Ferreira

  • Diamond Member
  • *****
  • Posts: 175
  • I must have taken a wrong turn at Albuquerque.
    • View Profile
Re: Generic Query
« Reply #1 on: March 07, 2019, 05:02:49 PM »
i was told i need to do a set_focus and not next_id