Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / BUG: Guisetctlvalue and listboxes

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. BUG: Guisetctlvalue and listboxes
#7099
Posted by: misi01 2005-09-29 00:43:20
I ran into this problem (and solution) by chance. I have one application that shows rows of data in a listbox. The user can select a row and the contents are then "moved" to the relevant controls in the window. To make coding easier, I also delete the relevant row from the listbox. I then call Guisetctlvalue to synch the variables and their controls, but kept on getting the error message
Guisetctlvalue reported "Item not found matching the value of xxxx
where xxxx is my listbox control. At the same time, everything appeared correct on the screen. To avoid this message, I simply coded

DO 
  guisetctlvalue()	 
  CATCH SYNTAX
    NOP
END

and my problem disappeared
Michael
Message2. Re: TIP: Guisetctlvalue and listboxes
#7100
Posted by: Jeff Glatt 2005-09-29 04:08:24
Must be a REXX GUI bug in the list box handling. Send along a test script and I'll fix it.
Message3. Re: TIP: Guisetctlvalue and listboxes
#7108
Posted by: misi01 2005-09-29 14:26:05
Found the problem as well. Run this script and click the add button. Now select that first row and click the select button instead. You'll get the error, and the error is dependent on you choosing the first row. Run it again, click Add twice, select the SECOND row and no error occurs.

/*

GUIBEGIN

WINDOW , 0, 0, 220, 86, POPUP|CAPTION|SYSMENU|MINBOX|MAXBOX|THICK, , My Window
	FONT 8, 400, MS Shell Dlg
	LIST 14, 34, 181, 29, NOTIFY|SORT|BORDER|VSCROLL|TABSTOP, INDEX, service_list
	PUSH 174, 70, 40, 14, TABSTOP, , select_button, , Select
	ENTRY 59, 9, 32, 12, H_AUTO|BORDER|TABSTOP, , field1_entry
	ENTRY 135, 9, 67, 12, H_AUTO|BORDER|TABSTOP, , field2_entry
	TEXT 17, 10, 20, 8, GROUP, , , , Field1
	TEXT 104, 12, 20, 8, GROUP, , , , Field2
	PUSH 120, 68, 40, 14, TABSTOP, , add_button, , Add
DEND
GUIEND

*/
OPTIONS "C_CALL LABELCHECK"
NUMERIC DIGITS 10
DO
	RXFUNCADD('rexxgui')
	CATCH FAILURE
		CONDITION("M")
		RETURN
END
line_nr = 0
service.0 = 0
guierr = "SYNTAX"
guiheading = 1
guicreatewindow('NORMAL')
again:
DO FOREVER
	guigetmsg()
	IF EXISTS('GuiObject') == 0 THEN DO
		IF EXISTS('GuiSignal') THEN DO
		END
	END
	ELSE DO
		IF EXISTS('GuiSignal') == 0 THEN DROP (guiobject)
		ELSE SELECT guiobject
			WHEN 0 THEN NOP
			OTHERWISE
		END /* SELECT GuiObject */
	END /* Some child script signaled us */
	CATCH SYNTAX
			CONDITION('M')
			SIGNAL again
	CATCH HALT
	FINALLY
		guidestroywindow()
END
RETURN
wm_click_add_button:
line_nr = line_nr + 1
new_service = 'Added line_'line_nr
service.0 = service.0 + 1
service.line_nr = new_service
err = guisendmsg('service_list', 'ADDSTRING', ,new_service)
RETURN
wm_click_select_button:
guigetctlvalue('service_list')
i = service_list + 1
temp = service.i
PARSE VAR temp field1_entry field2_entry 
CALL delete_service()	
guisetctlvalue()	 
RETURN	
delete_service:
temp = service_list + 1
temp_name = service.temp
guiremovectltext('service_list', '')
ERROR = STEMDELETE('SERVICE', , temp, 1)
RETURN	
Michael
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-4-19  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0