The function ShowError is a copy of part of WinErr for PB CC.
I found by experiment that the On Error works TOO well - intermittently
gives "Error 0 = The operation completed succesfully".
Using "If ErrApi then BtmLneErr" does not do this.
But neither method replaces or precedes the Window messages about
"... illegal operation and will be shut down" which is precisely the
object of the excercise.
'_______________________________________________________________________
'_______________________________________________________________________
------------------
I found by experiment that the On Error works TOO well - intermittently
gives "Error 0 = The operation completed succesfully".
Using "If ErrApi then BtmLneErr" does not do this.
But neither method replaces or precedes the Window messages about
"... illegal operation and will be shut down" which is precisely the
object of the excercise.
'_______________________________________________________________________
Code:
Function ShowError (ByVal x&) As String If ErrApi Then ShwErrErr FormatMessage %FORMAT_MESSAGE_FROM_SYSTEM, ByVal %NULL, x&, %NULL, errbfr, SizeOf(errbfr), ByVal %NULL If Len(errbfr) Then Function = "Error " & Format$(x&) & " = " & errbfr Else Function = "Unknown error code: " & Format$(x&) End If Exit Function ShwErrErr: MsgBox(showError(ErrApi)+" in WPtester, ShowError") End Function '(ShowError) '_______________________________________________________________________ Function BottomLine (ByVal cL&) As Long If ErrApi Then BtmLneErr ' On Error Goto BtmLneErr While cL&<dtlCnt& And Val(Left$(IstLst$(cL&+1),4))=Val(Left$(IstLst$(cL&),4)) Incr cL& Wend 'Establish the LAST line (on screen) of the Function=cL& 'order item per cL& (see sub SetFirstLastList Exit Function 'above) BtmLneErr: MsgBox(showError(ErrApi)+" in WPtester, BottomLine") End Function '(BottomLine)
------------------
Comment