Please educate me here friends
Because I want a simple value to be input, I tried this Inputbox, but it will not work as wanted
nOutColorMode:=Val(MsgInfo ( InputBox ( 'Enter Color' , '' " , '33' ) ))
The MsgInfo control returns a NIL, ignoring the value input - ex "33". Val("33") is the wanted result.
Is there another HMG function that would let me input a value and have it returned so that I can assign it
to a variable like nOutColorMode above without creating a new window with a new textbox control.
Like the old clipper at say get idea
Thank you
Getting a simple value without a new window and control
Moderator: Rathinagiri
Re: Getting a simple value without a new window and control
Hola Bluebird, no me queda claro tu "temor" a crear nuevas ventanas,
que de hecho ya estas creando 2 nuevas ventanas con el InputBox() y
el MsgInfo().
El msgInfo() no te regresa nada, el InputBox() sería el que te regresa '33' .
*----------------------------------------------------------------------------------------------
Hello Bluebird, it is not clear your "fear" to create new windows,
Which in fact you are already creating 2 new windows with the InputBox () and
The MsgInfo ().
The MsgInfo () does not return anything, the InputBox () would be the one that returns you ' 33 '.
que de hecho ya estas creando 2 nuevas ventanas con el InputBox() y
el MsgInfo().
El msgInfo() no te regresa nada, el InputBox() sería el que te regresa '33' .
*----------------------------------------------------------------------------------------------
Hello Bluebird, it is not clear your "fear" to create new windows,
Which in fact you are already creating 2 new windows with the InputBox () and
The MsgInfo ().
The MsgInfo () does not return anything, the InputBox () would be the one that returns you ' 33 '.
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
Re: Getting a simple value without a new window and control
No fear, just old fashioned.
Re: Getting a simple value without a new window and control
Hi. The MsgInfo function (it is not a control ) will always returns a NIL value (see: http://www.hmgforum.com/hmgdoc/data/msginfo.htm), if you want to get value of InputBox, you should do this in that way:bluebird wrote: ↑Sun Nov 26, 2017 7:54 pm Please educate me here friends
Because I want a simple value to be input, I tried this Inputbox, but it will not work as wanted
nOutColorMode:=Val(MsgInfo ( InputBox ( 'Enter Color' , '' " , '33' ) ))
The MsgInfo control returns a NIL, ignoring the value input - ex "33". Val("33") is the wanted result.
Is there another HMG function that would let me input a value and have it returned so that I can assign it
to a variable like nOutColorMode above without creating a new window with a new textbox control.
Like the old clipper at say get idea
Thank you
Code: Select all
#include <hmg.ch>
Function Main
SET WINDOW MAIN OFF
nOutColorMode:=VAL( InputBox ( 'Enter Color' , '' , '33' ))
MsgInfo(nOutColorMode)
SET WINDOW MAIN ON
RETURN NIL
Re: Getting a simple value without a new window and control
Thanks.
Please tell me why you turned the main function off??
Please tell me why you turned the main function off??
Re: Getting a simple value without a new window and control
Normally, InputBox is based on a MODAL window that requires a defined parent (Main) window.
With the SET WINDOW MAIN OFF command, I skip the need to define a MAIN window to properly operate the MODAL window, just in case.
With the SET WINDOW MAIN OFF command, I skip the need to define a MAIN window to properly operate the MODAL window, just in case.