Re: PureBasic 6.00 Beta 2 released !
Posted: Sat Jan 22, 2022 12:54 am
http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
;
; ------------------------------------------------------------
;
; PureBasic - OnError example file
;
; (c) Fantaisie Software
;
; ------------------------------------------------------------
;
Procedure ErrorHandler()
ErrorMessage$ = "A program error was detected:" + Chr(13)
ErrorMessage$ + Chr(13)
ErrorMessage$ + "Error Message: " + ErrorMessage() + Chr(13)
ErrorMessage$ + "Error Code: " + Str(ErrorCode()) + Chr(13)
ErrorMessage$ + "Code Address: " + Str(ErrorAddress()) + Chr(13)
If ErrorCode() = #PB_OnError_InvalidMemory
ErrorMessage$ + "Target Address: " + Str(ErrorTargetAddress()) + Chr(13)
EndIf
If ErrorLine() = -1
ErrorMessage$ + "Sourcecode line: Enable OnError lines support to get code line information." + Chr(13)
Else
ErrorMessage$ + "Sourcecode line: " + Str(ErrorLine()) + Chr(13)
ErrorMessage$ + "Sourcecode file: " + ErrorFile() + Chr(13)
EndIf
ErrorMessage$ + Chr(13)
ErrorMessage$ + "Register content:" + Chr(13)
CompilerSelect #PB_Compiler_Processor
CompilerCase #PB_Processor_x86
ErrorMessage$ + "EAX = " + Str(ErrorRegister(#PB_OnError_EAX)) + Chr(13)
ErrorMessage$ + "EBX = " + Str(ErrorRegister(#PB_OnError_EBX)) + Chr(13)
ErrorMessage$ + "ECX = " + Str(ErrorRegister(#PB_OnError_ECX)) + Chr(13)
ErrorMessage$ + "EDX = " + Str(ErrorRegister(#PB_OnError_EDX)) + Chr(13)
ErrorMessage$ + "EBP = " + Str(ErrorRegister(#PB_OnError_EBP)) + Chr(13)
ErrorMessage$ + "ESI = " + Str(ErrorRegister(#PB_OnError_ESI)) + Chr(13)
ErrorMessage$ + "EDI = " + Str(ErrorRegister(#PB_OnError_EDI)) + Chr(13)
ErrorMessage$ + "ESP = " + Str(ErrorRegister(#PB_OnError_ESP)) + Chr(13)
CompilerCase #PB_Processor_x64
ErrorMessage$ + "RAX = " + Str(ErrorRegister(#PB_OnError_RAX)) + Chr(13)
ErrorMessage$ + "RBX = " + Str(ErrorRegister(#PB_OnError_RBX)) + Chr(13)
ErrorMessage$ + "RCX = " + Str(ErrorRegister(#PB_OnError_RCX)) + Chr(13)
ErrorMessage$ + "RDX = " + Str(ErrorRegister(#PB_OnError_RDX)) + Chr(13)
ErrorMessage$ + "RBP = " + Str(ErrorRegister(#PB_OnError_RBP)) + Chr(13)
ErrorMessage$ + "RSI = " + Str(ErrorRegister(#PB_OnError_RSI)) + Chr(13)
ErrorMessage$ + "RDI = " + Str(ErrorRegister(#PB_OnError_RDI)) + Chr(13)
ErrorMessage$ + "RSP = " + Str(ErrorRegister(#PB_OnError_RSP)) + Chr(13)
ErrorMessage$ + "Display of registers R8-R15 skipped." + Chr(13)
CompilerEndSelect
MessageRequester("OnError example", ErrorMessage$)
End
EndProcedure
; Setup the error handler.
;
OnErrorCall(@ErrorHandler())
MessageRequester("OnError example", "Executing some code with errors. The debugger should be turned off.")
; Write to protected memory
;
PokeS(123, "The quick brown fox jumped over the lazy dog.")
; Division by zero
;
a = 0
a = 1 / a
; Generate an error manually
;
RaiseError(#PB_OnError_IllegalInstruction)
; This should not be displayed
;
MessageRequester("OnError example", "Execution finished normally.")
End
Code: Select all
- Changed the name of the /EXE commandline flag to /OUTPUT be more coherent (still work for backcompatibilty but not documented anymore)
- Changed the short version of /CONSTANT from '-o' to '-co' as '-o' is now used for /OUTPUT
- OSVersion(): added support for Windows 11
- Added #PB_Compiler_Optimizer which is set to #True if the optimizer is enabled
- Dropped x86 version of PureBasic for OS X as it's no more supported since OS X Catalina (Minimum supported OS X is now 10.10 - released in 2014).
IDE:
- New contextual constant display for AutoComplete (Fr34k - https://github.com/fantaisie-software/purebasic/pull/183)
- 3 new triggers for custom tools: "OpenFile - Non-PB binary file", "OpenFile - Non-PB text file", "OpenFile - with specific extension" (HeX0R101 - https://github.com/fantaisie-software/purebasic/pull/195)
- New 'Replace' shortcut (CTRL+H) which opens the find dialgo with replace enable (ChrisRfr - https://github.com/fantaisie-software/purebasic/pull/184)
- Bug fixes, thanks to all other contributors !
Here here!!!netmaestro wrote: Thu Jan 27, 2022 8:14 pm Thanks team! Comprehensive and solid, as always. PureBasic is the best investment I ever made, nothing comes even close.
Thanks, now the IDE is startingFred wrote: Thu Jan 27, 2022 5:15 pmCode: Select all
IDE: - 3 new triggers for custom tools: "OpenFile - Non-PB binary file", "OpenFile - Non-PB text file", "OpenFile - with specific extension" (HeX0R101 - https://github.com/fantaisie-software/purebasic/pull/195) - Bug fixes, thanks to all other contributors !
.STARGÅTE wrote: Thu Jan 27, 2022 11:17 pmThanks, now the IDE is staringFred wrote: Thu Jan 27, 2022 5:15 pmCode: Select all
IDE: - 3 new triggers for custom tools: "OpenFile - Non-PB binary file", "OpenFile - Non-PB text file", "OpenFile - with specific extension" (HeX0R101 - https://github.com/fantaisie-software/purebasic/pull/195) - Bug fixes, thanks to all other contributors !
![]()
It's an excellent product, for sure! I've loved seeing it grow over the years. I remember comparing it and another Basic many years ago, and I decided on PureBasic because I thought the developer looked like he knew what he was doing. I was right!netmaestro wrote: Thu Jan 27, 2022 8:14 pmThanks team! Comprehensive and solid, as always. PureBasic is the best investment I ever made, nothing comes even close.
100%. Same for me.netmaestro wrote: Thu Jan 27, 2022 8:14 pm Thanks team! Comprehensive and solid, as always. PureBasic is the best investment I ever made, nothing comes even close.