Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
List of all QB64pe error messages
#1
I've created a module that contains all error numbers and the text of the error. It is intended to be placed in the top of the main program, so the info is available for any part of the program. It has been written to work even in OPTION _EXPLICIT programs.


Attached Files
.bi   ERRORS.BI (Size: 8.63 KB / Downloads: 42)
While 1
   Fix Bugs
   report all bugs fixed
   receive bug report
end while
Reply
#2
(03-25-2024, 06:49 PM)TDarcos Wrote: I've created a module that contains all error numbers and the text of the error. It is intended to be placed in the top of the main program, so the info is available for any part of the program. It has been written to work even in OPTION _EXPLICIT programs.

This is super helpful. Thanks! However, you do not need ERR_TEXT$. You can just call _ERRORMESSAGE$ using the error code constant.
Reply
#3
Thanks, that's EXTREMELY helpful... FOR STEVE! Me, I'll never use it. Big Grin 

Pette
Reply
#4
This program displays all Windows error messages:

Code: (Select All)
Rem search for error messages in windows
Declare Dynamic Library "kernel32"
  Function FormatMessageA& (ByVal f As Long, f$, Byval e As Long, Byval d As Long, g$, Byval s As Long, h$)
  Function GetLastError& ()
End Declare

' count error messages
Dim m As String * 260
For x& = 1 To 15299
  y& = FormatMessageA&(&H1200, "", x&, 0, m$, 260, "")
  If y& Then
      c = c + 1
      x$ = "Error 0x" + Hex$(x&) + " (" + LTrim$(Str$(x&)) + ")"
      y$ = Left$(m$, y& - 2)
      length = length + Len(x$) \ 80 + Len(y$) \ 80 + 2
      If length >= 22 Then
        length = 0
        If p = 0 Then
            Color 15
            Print "-more(y/n/c)-";
            Do
              _Limit 50
              z$ = LCase$(InKey$)
              If z$ = "c" Then p = -1: Print: Exit Do
              If z$ = "y" Then Print: Exit Do
              If z$ = "n" Then Print: Exit For
            Loop
        End If
      End If
      Color 14
      Print x$
      Print y$
  End If
Next
Color 14
Print "There were"; c; "messages found."
Color 7
End


Attached Files
.bas   errmsg9.bas (Size: 1.06 KB / Downloads: 15)
Reply
#5
Reminds me of a little library I wrote years ago that did all this.
More verbose message boxes (alephc.xyz)
Tread on those who tread on you

Reply
#6
Of course you could do this:

Code: (Select All)
For x% = 1 To 1024
  e$ = _ErrorMessage$(x%)
  e$ = RTrim$(e$)
  If LCase$(e$) = "unprintable error" Then
      ' nul
  Else
      Print x%; e$
  End If
Next
End
Reply




Users browsing this thread: 1 Guest(s)