使用例

Visual LANSA

使用例


EVTROUTINE HANDLING(#PHBN_1.Click)

* basic

invoke #avFrameworkManager.avCheckConnection ReturnValue(#df_elretc)

if '#df_elretc *eq OK'

invoke #Com_Owner.uSelectData

endif

ENDROUTINE

 

EVTROUTINE HANDLING(#PHBN_2.Click)

* silent (Attempt one reconnect if unconnected, don't advise the user of anything - this program will advise)

invoke #avFrameworkManager.avCheckConnection AttemptReconnect(TRUE) IssueMessages(FALSE) ActionOnFail(ABORT) ReturnValue(#df_elretc)

if '#df_elretc *eq OK'

invoke #Com_Owner.uSelectData

else

USE BUILTIN(Message_box_show) WITH_ARGS(*Default *Default *Default *Default 'My own message advising that connection is disabled')

endif

ENDROUTINE

 

EVTROUTINE HANDLING(#PHBN_3.Click)

* detect without even one attempt to recover - ActionOnFail will be irrelevant

* this will only detect that the super server connection has been lost, even if the TCPIP link has subsequently been restored

* (to detect that you are able to connect requires an attempt to reconnect)

invoke #avFrameworkManager.avCheckConnection AttemptReconnect(FALSE) IssueMessages(TRUE) ActionOnFail(ABORT) ReturnValue(#df_elretc)

if '#df_elretc *eq OK'

invoke #Com_Owner.uSelectData

endif

ENDROUTINE

 

EVTROUTINE HANDLING(#PHBN_4.Click)

* attempt one reconnection, but if that fails, advise the user but do not retry

invoke #avFrameworkManager.avCheckConnection AttemptReconnect(TRUE) IssueMessages(TRUE) ActionOnFail(ABORT) ReturnValue(#df_elretc)

if '#df_elretc *eq OK'

invoke #Com_Owner.uSelectData

endif

ENDROUTINE