QB64 Phoenix Edition
List of all QB64pe error messages - Printable Version

+- QB64 Phoenix Edition (https://qb64phoenix.com/forum)
+-- Forum: QB64 Rising (https://qb64phoenix.com/forum/forumdisplay.php?fid=1)
+--- Forum: Code and Stuff (https://qb64phoenix.com/forum/forumdisplay.php?fid=3)
+---- Forum: Utilities (https://qb64phoenix.com/forum/forumdisplay.php?fid=8)
+---- Thread: List of all QB64pe error messages (/showthread.php?tid=2540)



List of all QB64pe error messages - TDarcos - 03-25-2024

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.


RE: List of all QB64pe error messages - a740g - 03-25-2024

(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.


RE: List of all QB64pe error messages - Pete - 03-26-2024

Thanks, that's EXTREMELY helpful... FOR STEVE! Me, I'll never use it. Big Grin 

Pette


RE: List of all QB64pe error messages - eoredson - 03-27-2024

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



RE: List of all QB64pe error messages - SpriggsySpriggs - 03-27-2024

Reminds me of a little library I wrote years ago that did all this.
More verbose message boxes (alephc.xyz)


RE: List of all QB64pe error messages - eoredson - 03-28-2024

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