Page 1 of 1
Problem with on change
Posted: Thu Apr 07, 2016 9:47 am
by miszler.zoltan
Greetings !
Bug?
If the input mask option is a TextBox t2, when compiled program then this error message:
t3 of Form_Main not defined.
Without inputmask is ok.
#include <hmg.ch>
FUNCTION Main()
DEFINE Window Form_Main at 0,0 width getdesktopwidth() height Getdesktopheight() title 'Error' main on init BizFrissit()
@ 335,20 texTbox t1 height 22 width 100 value '' maxlength 5 on change BizFrissit()
@ 335,130 texTbox t2 height 22 width 100 value '' on change BizFrissit()
//@ 335,130 texTbox t2 height 22 width 100 value '' inputmask '9999-99-99' on change BizFrissit()
@ 335,240 texTbox t3 height 22 width 100 value '' maxlength 40 on change BizFrissit()
END WINDOW
Form_Main.s3.Setfocus; Form_Main.activate
RETURN(NIL)
*--------------------------------------------------------*
FUNCTION BizFrissit()
*--------------------------------------------------------*
IF !Empty (Form_Main.t1.Value)
MsgInfo( Form_Main.t1.Value )
ENDIF
IF !Empty (Form_Main.t2.Value)
MsgInfo( Form_Main.t2.Value )
ENDIF
IF !Empty (Form_Main.t3.Value)
MsgInfo( Form_Main.t3.Value )
ENDIF
RETURN(NIL)
Re: Problem with on change
Posted: Thu Apr 07, 2016 10:09 am
by dragancesu
Try
...numeric inputmask...
Re: Problem with on change
Posted: Thu Apr 07, 2016 11:34 am
by gfilatov
miszler.zoltan wrote:Greetings !
Bug?
If the input mask option is a TextBox t2, when compiled program then this error message:
t3 of Form_Main not defined.
Without inputmask is ok.
Hi Zoltan,
Please be so kind to update your 'On Change' function with the following code:
Code: Select all
*--------------------------------------------------------*
FUNCTION BizFrissit()
*--------------------------------------------------------*
IF !Empty (Form_Main.t1.Value)
MsgInfo( Form_Main.t1.Value )
ENDIF
IF !Empty (Form_Main.t2.Value) .and. !(Form_Main.t2.Value == " - - ")
MsgInfo( Form_Main.t2.Value )
ENDIF
IF !Empty (Form_Main.t3.Value)
MsgInfo( Form_Main.t3.Value )
ENDIF
RETURN(NIL)
Hope that helps

Re: Problem with on change
Posted: Thu Apr 07, 2016 12:54 pm
by miszler.zoltan
Dear Grigory and Dragancesu!
The problem, when in textbox is inputmask (numeric or text), the compiler not compiling the program!
Version: HMG 3.4.2 Stable Patch 3 (32bits)
Called from getproperty(8449)
Called from Bizfrissit(23)...
This line has error:
@ 335,130 texTbox t2 height 22 width 100 value '' inputmask '9999-99-99' on change BizFrissit()
According to the manual does not contain only numeric input textbox mask!
TEXTBOX ( Character InputMask ):
@ <nRow>,<nCol> TEXTBOX <ControlName>
[ OF | PARENT <ParentWindowName> ]
[ HEIGHT <nHeight> ]
[ WIDTH <nWidth> ]
[ FIELD <FieldName> ]
[ VALUE <cValue> ]
[ READONLY ]
[ FONT <cFontName> SIZE <nFontSize> ]
[ BOLD ] [ ITALIC ] [ UNDERLINE ] [ STRIKEOUT ]
[ TOOLTIP <ToolTipText> ]
[ BACKCOLOR <aBackColor> ]
[ FONTCOLOR <aFontColor> ]
[ DISABLEDBACKCOLOR <aDisabledBackColor> ]
[ DISABLEDFONTCOLOR <aDisabledFontColor> ]
INPUTMASK <cMask>
[ ON CHANGE <OnChangeProcedure> ]
Best regards, Zoltan
Re: Problem with on change
Posted: Fri Apr 08, 2016 7:22 am
by mlnr
Szia Zoli,
A probléma nem az inputmask-nak köszönhető, hanem az on change függyvény miatt.
Kipróbáltam és nálam is előjött a hiba, de a Grigory amit tanácsolt, avval tökéletesen működik.
Hi Zoltan,
I'm tried and i have the same issue, but what Grigory advised, program is works perfectly.
Re: Problem with on change
Posted: Fri Apr 08, 2016 7:53 am
by mlnr
Sorry, what i wrote is wrong.
try this
Code: Select all
@ 335,20 texTbox t1 height 22 width 100 value '' maxlength 5 on change BizFrissit()
@ 335,240 texTbox t3 height 22 width 100 value '' maxlength 40 on change BizFrissit()
@ 335,130 texTbox t2 height 22 width 100 value '' inputmask '9999-99-99' on change BizFrissit()
hmmm interesting

Re: Problem with on change
Posted: Fri Apr 08, 2016 8:19 am
by mlnr
It Works
Code: Select all
#include <hmg.ch>
FUNCTION Main()
DEFINE Window Form_Main at 0,0 width getdesktopwidth() height Getdesktopheight() title 'Error' main on init BizFrissit()
@ 335,20 texTbox t1 height 22 width 100 value '' maxlength 5 on change BizFrissit()
@ 335,130 texTbox t2 height 22 width 100 value '' inputmask '9999-99-99' on change BizFrissit()
@ 335,240 texTbox t3 height 22 width 100 value '' maxlength 40 on change BizFrissit()
END WINDOW
Form_Main.t1.Setfocus; Form_Main.activate
RETURN(NIL)
*--------------------------------------------------------*
FUNCTION BizFrissit()
*--------------------------------------------------------*
IF !Empty (Form_Main.t1.Value)
MsgInfo( Form_Main.t1.Value )
ENDIF
IF !Empty (Form_Main.t2.Value)
MsgInfo( Form_Main.t2.Value )
ENDIF
If IsControlDefined("t3","Form_Main") .and. !Empty (Form_Main.t3.Value)
MsgInfo( Form_Main.t3.Value )
Endif
RETURN(NIL)