Dear Friends,
I need help on the error trapping,
the code,
TIA
best rgds,
Chang
Trap error with Begin Sequence
Moderator: Rathinagiri
Trap error with Begin Sequence
Just Hmg It !
Re: Trap error with Begin Sequence
Chang
Missing BREAK in SEQUENCE. Try this:
Missing BREAK in SEQUENCE. Try this:
Code: Select all
FUNCTION Main_List_1_OnChange()
LOCAL bErrHandler
LOCAL uResult
LOCAL cEditValue
LOCAL nValue := GetProperty( "Main", "List_1", "Value")
LOCAL cDisplayItem := ALLTRIM( GetProperty( "Main", "List_1", "Item", nValue))
// cDisplayItem := "getStartupFolder()"
LOCAL cCode := "{|x| " + cDisplayItem + "}"
bErrHandler := ErrorBlock({|| Break(NIL)})
BEGIN SEQUENCE
bCode := &cCode
uResult := EVAL( bCode)
RECOVER
msgDebug( "undefined function :", cCode)
END
ErrorBlock(bErrHandler)
IF VALTYPE( uResult) == 'C'
cEditValue := uResult + HB_EOL() + GetProperty( "Main", "Edit_1", "Value")
SetProperty( "Main", "Edit_1", "Value", cEditValue)
msgDebug( cDisplayItem, uResult)
ELSE
msgDebug( uResult)
ENDIF
RETURN NIL
Re: Trap error with Begin Sequence
Thank you KDJ...
It works
Next question :
Why is hb_dskspacd() not recognise as a build in function while hb_eol() works ?
Best rgds
chang
It works
Next question :
Why is hb_dskspacd() not recognise as a build in function while hb_eol() works ?
Best rgds
chang
Just Hmg It !
Re: Trap error with Begin Sequence
Because HB_EOL() function is used in HMG code and HB_DiskSpace() function is nowhere used.
You need use REQUEST statement for this function, eg:
Code: Select all
#include <hmg.ch>
#define ZFMAIN Main
#define ZMFILE "&File"
#define ZMFILE01 "&Open"
#define ZSTTBAR01 "hfManager"
REQUEST HB_DiskSpace
REQUEST HB_BuildDate
FUNCTION Main()
...
Re: Trap error with Begin Sequence
Thanks Sir,
in my case, should I REQUEST all available functions at the beginning of the program ?
or can I do the REQUEST at runtime ( when the function name is clicked/List onChange) ?
TIA
best rgds
Chang
in my case, should I REQUEST all available functions at the beginning of the program ?
or can I do the REQUEST at runtime ( when the function name is clicked/List onChange) ?
TIA
best rgds
Chang
Just Hmg It !
Re: Trap error with Begin Sequence
Yes, all that will be called by the macro and are not explicitly used in the program code.
No. REQUEST is an instruction for the linker.
Read here: http://www.itlnet.net/programming/progr ... 0da82.html