Problem with on change

Moderator: Rathinagiri

Post Reply
User avatar
miszler.zoltan
Posts: 22
Joined: Sun May 26, 2013 12:37 pm
Location: Hungary
Contact:

Problem with on change

Post 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)
User avatar
dragancesu
Posts: 926
Joined: Mon Jun 24, 2013 11:53 am
DBs Used: DBF, MySQL, Oracle
Location: Subotica, Serbia

Re: Problem with on change

Post by dragancesu »

Try

...numeric inputmask...
User avatar
gfilatov
Posts: 1087
Joined: Fri Aug 01, 2008 5:42 am
Location: Ukraine
Contact:

Re: Problem with on change

Post 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 :idea:
Kind Regards,
Grigory Filatov

"Everything should be made as simple as possible, but no simpler." Albert Einstein
User avatar
miszler.zoltan
Posts: 22
Joined: Sun May 26, 2013 12:37 pm
Location: Hungary
Contact:

Re: Problem with on change

Post 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
mlnr
Posts: 126
Joined: Fri Aug 28, 2015 1:52 pm
DBs Used: DBF

Re: Problem with on change

Post 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.
Best regards,
Gabor
mlnr
Posts: 126
Joined: Fri Aug 28, 2015 1:52 pm
DBs Used: DBF

Re: Problem with on change

Post 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 :?
Best regards,
Gabor
mlnr
Posts: 126
Joined: Fri Aug 28, 2015 1:52 pm
DBs Used: DBF

Re: Problem with on change

Post 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)
Best regards,
Gabor
Post Reply