Hi All,
(newbie in scripting) I am trying to trap an error where if the parameter is not available/configured, skip the code.
i tried "On Error" before and after the line but still getting "err number of -1577058273" no such parameter in module. I also tried "[NOT_CONFIGURED_OK]".
here's my code:
Dim AlarmStatus As String
On Error GoTo ErrHandlerAlarmStatus = frsreadvalue("DVSYS.@MOD@/HI_HI_ALARM.F_ENAB")
On Error GoTo ErrHandlerIf AlarmStatus = True Then Dim AlarmPath As String AlarmPath = frsreadvalue("DVSYS.@MOD@/DESC.A_MODULETAG")
frsRunTask "AlarmHelp", AlarmPath + "/HI_HI_ALARM"
End If
Exit Sub ErrHandler: MsgBox "No Alarm configured hence no Alarm Help available" End If
Try the below changes in Red to trap the existence of the alarm.
Dim AlarmStatus As StringDim lError As Long
On Error GoTo ErrHandlerAlarmStatus = frsreadvalue("DVSYS.@MOD@/HI_HI_ALARM.F_ENAB", lError, , False)
If lError = 0 Then If AlarmStatus = True Then
Dim AlarmPath As String AlarmPath = frsreadvalue("DVSYS.@MOD@/DESC.A_MODULETAG")
frsRunTask "AlarmHelp", AlarmPath + "/HI_HI_ALARM" End IfElse MsgBox "No Alarm configured hence no Alarm Help available"End If
Exit Sub
ErrHandler: frsHandleError
In reply to Matt Stoner:
In reply to GeloCortez:
Best Regards,
Rachelle McWright: Business Development Manager, Dynamic Simulation: U.S. Gulf Coast
In reply to Rachelle McWright:
In reply to MILONGO Rodolph:
In reply to Amod Gokhale: