General Help regarding HMG, Compilation, Linking, Samples
Moderator: Rathinagiri
-
AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Post
by AUGE_OHR »
hi,
i have some FiveWin CODE which use TRY / CATCH / END
how can i use #xTranslate for HMG Syntax
Code: Select all
TRY
soCn:Open()
CATCH
MsgAlert( "CAN NOT REOPEN" + CRLF + soCn:ConnectionString )
END
i do NOT want to "re-write" hole CODE. i want to #xTranslate
Code: Select all
#xTranslate TRY => BEGIN SEQENCE WITH ERRORBLOCK( { | oError | DefError( oError ) } )
#xTranslate CATCH => RECOVER oError
how get it work ...
have fun
Jimmy
-
edk
- Posts: 999
- Joined: Thu Oct 16, 2014 11:35 am
- Location: Poland
Post
by edk »
Maybe like that
Code: Select all
#xcommand TRY => BEGIN SEQUENCE WITH { |oErr| Break( oErr ) }
#xcommand CATCH [<!oErr!>] => RECOVER [USING <oErr>] <-oErr->
-
gfilatov
- Posts: 1090
- Joined: Fri Aug 01, 2008 5:42 am
- Location: Ukraine
-
Contact:
Post
by gfilatov »
AUGE_OHR wrote: ↑Sat Jun 10, 2023 3:25 am
hi,
i have some FiveWin CODE which use TRY / CATCH / END
how can i use #xTranslate for HMG Syntax
Code: Select all
TRY
soCn:Open()
CATCH
MsgAlert( "CAN NOT REOPEN" + CRLF + soCn:ConnectionString )
END
i do NOT want to "re-write" hole CODE. i want to #xTranslate
Code: Select all
#xTranslate TRY => BEGIN SEQENCE WITH ERRORBLOCK( { | oError | DefError( oError ) } )
#xTranslate CATCH => RECOVER oError
how get it work ...
Hi Jimmy,
Just add the following string on top of your source:
The above statement will introduce the following translate directives:
Code: Select all
#xcommand TRY => BEGIN SEQUENCE WITH __BreakBlock()
#xcommand CATCH [<!oErr!>] => RECOVER [USING <oErr>] <-oErr->
#xcommand FINALLY => ALWAYS
Keep it simple

Kind Regards,
Grigory Filatov
"Everything should be made as simple as possible, but no simpler." Albert Einstein
-
mol
- Posts: 3774
- Joined: Thu Sep 11, 2008 5:31 am
- Location: Myszków, Poland
-
Contact:
Post
by mol »
How does ALWAYS work? I didn't know that statement
-
AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Post
by AUGE_OHR »
hi,
thx for all Answer
have fun
Jimmy