Page 1 of 1

Problem with inputwindow

Posted: Thu Aug 27, 2009 3:28 pm
by luisvasquezcl
Hola,
la funcion inputwindow arroja un error:
Date:08/27/09 Time: 10:56:01
Error BASE/1003 Variable does not exist: __INPUTWINDOW_CONTROL_1
Called from GETCONTROLHANDLE(964)
Called from _SETFOCUS(1075)
Called from INPUTWINDOW(3115)
Called from EJECUTA(23)
Called from (b)MAIN(9)
Called from _DOCONTROLEVENTPROCEDURE(4735)
Called from EVENTS(1360)
Called from _DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(4377)
Called from MAIN(13)

la aplicacion.

Code: Select all

#INCLUDE 'MINIGUI.CH'

PROCEDURE MAIN
	DEFINE WINDOW FORM1 AT 0,0 WIDTH 300 HEIGHT 300 TITLE 'Test InputWindow' MAIN
		DEFINE BUTTON BUTTON_1
			ROW 0
			COL 0
			CAPTION "&Ejecutar"
			ACTION EJECUTA()
		END BUTTON
	END WINDOW
	CENTER WINDOW FORM1
	ACTIVATE WINDOW FORM1
RETURN

PROCEDURE EJECUTA
	LOCAL 	aResp 	:= {},;
			cTitle	:='Test de input window',;
			albl	:={'Texto','Numero','Fecha','Logico'},;
			aVal	:={'',1000,date(),.t.},;
			aFrm	:={NIL, '999,999', NIL, NIL}
	LOCAL 	i		:= 1		
	aResp	= Inputwindow( ctitle, albl, aval, AfRM )
	ctitle	= "Resultado "+HB_OSNEWLINE()
	
	FOR i= 1 TO LEN( aResp )
		cTitle += albl[i]+'='+HB_VALTOSTR( aResp[i] )+HB_OSNEWLINE()
	NEXT
				
	MSGINFO( cTitle )
		
RETURN
Saludos cordiales,
Luis Vasquez

Re: Problem with inputwindow

Posted: Thu Aug 27, 2009 9:38 pm
by Roberto Lopez
luisvasquezcl wrote:Hola,
la funcion inputwindow arroja un error:
Date:08/27/09 Time: 10:56:01
Error BASE/1003 Variable does not exist: __INPUTWINDOW_CONTROL_1
Called from GETCONTROLHANDLE(964)
Called from _SETFOCUS(1075)
Called from INPUTWINDOW(3115)
Called from EJECUTA(23)
Called from (b)MAIN(9)
Called from _DOCONTROLEVENTPROCEDURE(4735)
Called from EVENTS(1360)
Called from _DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(4377)
Called from MAIN(13)

la aplicacion.

Code: Select all

#INCLUDE 'MINIGUI.CH'

PROCEDURE MAIN
	DEFINE WINDOW FORM1 AT 0,0 WIDTH 300 HEIGHT 300 TITLE 'Test InputWindow' MAIN
		DEFINE BUTTON BUTTON_1
			ROW 0
			COL 0
			CAPTION "&Ejecutar"
			ACTION EJECUTA()
		END BUTTON
	END WINDOW
	CENTER WINDOW FORM1
	ACTIVATE WINDOW FORM1
RETURN

PROCEDURE EJECUTA
	LOCAL 	aResp 	:= {},;
			cTitle	:='Test de input window',;
			albl	:={'Texto','Numero','Fecha','Logico'},;
			aVal	:={'',1000,date(),.t.},;
			aFrm	:={NIL, '999,999', NIL, NIL}
	LOCAL 	i		:= 1		
	aResp	= Inputwindow( ctitle, albl, aval, AfRM )
	ctitle	= "Resultado "+HB_OSNEWLINE()
	
	FOR i= 1 TO LEN( aResp )
		cTitle += albl[i]+'='+HB_VALTOSTR( aResp[i] )+HB_OSNEWLINE()
	NEXT
				
	MSGINFO( cTitle )
		
RETURN
Saludos cordiales,
Luis Vasquez

It does not work because you filled incorrectly formats array:

Code: Select all

albl :={'Texto','Numero','Fecha','Logico'},;
aVal :={'',1000,date(),.t.},;

// INCORRECT: aFrm :={NIL, '999,999', NIL, NIL}

// OK:        aFrm :={16, '999,999', NIL, NIL}

For an initial character value you must specify a number in format indicating maxlength.

Please, check the syntax in HMG docs.

Regards,

Roberto.

Re: Problem with inputwindow

Posted: Fri Aug 28, 2009 1:48 am
by luisvasquezcl
Estimado Roberto,
muchas gracias por tu pronta respuesta.
Creo que sería conveniente corregir la documentación y especificar que tipo de datos se debe especificar en el array aformat para asi evitar futuros avisos de error como este.
También poner un ejemplo en los Samples ya que ayuda muchisimo como consulta y en la comprensión de la libreria.
saludos cordiales,
Luis Vasquez

Re: Problem with inputwindow

Posted: Fri Aug 28, 2009 11:24 am
by Roberto Lopez
luisvasquezcl wrote:Estimado Roberto,
muchas gracias por tu pronta respuesta.
Creo que sería conveniente corregir la documentación y especificar que tipo de datos se debe especificar en el array aformat para asi evitar futuros avisos de error como este.
También poner un ejemplo en los Samples ya que ayuda muchisimo como consulta y en la comprensión de la libreria.
saludos cordiales,
Luis Vasquez
This is clearly indicated in the documentation:
Screen1.png
Screen1.png (30.38 KiB) Viewed 3437 times

Problem with inputwindow

Posted: Sun Feb 08, 2015 1:03 pm
by Pablo César
Hi all,
Roberto Lopez wrote:
luisvasquezcl wrote:Hola,
la funcion inputwindow arroja un error:
Date:08/27/09 Time: 10:56:01
Error BASE/1003 Variable does not exist: __INPUTWINDOW_CONTROL_1
Called from GETCONTROLHANDLE(964)
Called from _SETFOCUS(1075)
Called from INPUTWINDOW(3115)
Called from EJECUTA(23)
Called from (b)MAIN(9)
Called from _DOCONTROLEVENTPROCEDURE(4735)
Called from EVENTS(1360)
Called from _DOMESSAGELOOP(0)
Called from _ACTIVATEWINDOW(4377)
Called from MAIN(13)

la aplicacion.

Code: Select all

#INCLUDE 'MINIGUI.CH'

PROCEDURE MAIN
	DEFINE WINDOW FORM1 AT 0,0 WIDTH 300 HEIGHT 300 TITLE 'Test InputWindow' MAIN
		DEFINE BUTTON BUTTON_1
			ROW 0
			COL 0
			CAPTION "&Ejecutar"
			ACTION EJECUTA()
		END BUTTON
	END WINDOW
	CENTER WINDOW FORM1
	ACTIVATE WINDOW FORM1
RETURN

PROCEDURE EJECUTA
	LOCAL 	aResp 	:= {},;
			cTitle	:='Test de input window',;
			albl	:={'Texto','Numero','Fecha','Logico'},;
			aVal	:={'',1000,date(),.t.},;
			aFrm	:={NIL, '999,999', NIL, NIL}
	LOCAL 	i		:= 1		
	aResp	= Inputwindow( ctitle, albl, aval, AfRM )
	ctitle	= "Resultado "+HB_OSNEWLINE()
	
	FOR i= 1 TO LEN( aResp )
		cTitle += albl[i]+'='+HB_VALTOSTR( aResp[i] )+HB_OSNEWLINE()
	NEXT
				
	MSGINFO( cTitle )
		
RETURN
Saludos cordiales,
Luis Vasquez
It does not work because you filled incorrectly formats array:

Code: Select all

albl :={'Texto','Numero','Fecha','Logico'},;
aVal :={'',1000,date(),.t.},;

// INCORRECT: aFrm :={NIL, '999,999', NIL, NIL}

// OK:        aFrm :={16, '999,999', NIL, NIL}
For an initial character value you must specify a number in format indicating maxlength.
Now in this new release in HMG 3.4.0, InputWindow has improved. This kind of posible mistake is treated internally by InputWindow() to prevent this error.

So you can take this same code, build it with HMG 3.4.0 and will see is going to work without runtime error.
Screen2.png
Screen2.png (43.57 KiB) Viewed 3419 times
The example was executed but without the first field. Because InputWindow interpreted as a LABEL by the reason aFormats value is NIL.

This running will show clearly to the user when wrong parameter be passed on.

In order to let it registered all improvements on new InputWindow in this last release (3.4.0):
[tr][td]Control to be created[/td][td]aInitValues[/b][/td][td]   [/td][td]aFormats[/b][/td][/tr]
[tr][td]Label[/td][td]""[/td][td][/td][td]Nil[/td][/tr]
[tr][td]TextBox "C"[/td][td]""[/td][td][/td][td]>= 32[/td][/tr]
[tr][td]TextBox "C" (PassWord)[/td][td]""[/td][td][/td][td]"PASSWORD"[/td][/tr]
[tr][td]TextBox "N" (New)[/td][td]9[/td][td][/td][td]9[/td][/tr]
[tr][td]TextBox "N"(INPUTMASK)[/td][td]9[/td][td][/td][td]Ex: "99.99"[/td][/tr]
[tr][td]ComboBox[/td][td]9[/td][td][/td][td]{}[/td][/tr]
[tr][td]CheckBox[/td][td].T. or .F.[/td][td][/td][td][/td][/tr]
[tr][td]DatePicker[/td][td]CtoD() or Date()[/td][td][/td][td][/td][/tr]
[tr][td]EditBox[/td][td]""[/td][td][/td][td]> 32[/td][/tr]
[tr][td]EditBox[/td][td]Dbf Memo field[/td][td][/td][td][/td][/tr]
[tr][td]Grid[/td][td]{{}}[/td][td][/td][td]{{headers},{Widths}}[/td][/tr][/table]
Further examples and descriptions about new resources, you can find in this topic. Probably more some two controls is expecting to be added like as: TimePicker and Spinner. As InputWindow been considered an alternative to in-place-edit feature of Grid, just to be compatible with Grid's ColumnControls.

Indicanting bugs and new ideas and welcome. I hope you enjoy !

This is a very practical tool for simple edition. It's incredible what ARRAYS can do for us !

All the credits to the great master, Roberto Lopez ! :D

Re: Problem with inputwindow

Posted: Mon Feb 09, 2015 2:55 pm
by luisvasquezcl
Hola Pablo,
muchas gracias por la información.
he estado siguiendo las novedades de tu aplicación inputwindow, la considero muy buena, muy bien implementada y con todo el mérito para incluirla en reemplazo del inputwindow original, sin desconocer el mérito que tiene nuestro maestro Roberto Lopez.
saludos cordiales,
Luis Vásquez.

Problem with inputwindow

Posted: Mon Feb 09, 2015 4:44 pm
by Pablo César
Gracias Luiz, por tu reconocimiento y es un verdadero placer siempre atender a tus mensajes.

Un gran abrazo,