! Con utils

Post Reply
User avatar
Dutchman
Posts: 148
Joined: Tue Aug 06, 2019 4:47 pm
Location: Netherlands

! Con utils

Post by Dutchman » Fri Nov 22, 2019 12:05 pm

! Con utils
This library contains functions related to console output eg to facilitate debugging.
Error 4 and larger has been added to facilitate messages for the errors which might occur in the function "FIRgain" in library {/Extensions/Math/! DSP utils}

Code: Select all

' {/Extensions/Console/! Con utils}
[ Functions related to console output ]
'
'––––––––––––––––– Containers for Data –––––––––––––––––––––
'
[–––––––––––––––––––––––– Functions ––––––––––––––––––––––––
Error$(n)
returns string with error description for Error=n
–––
End of function descriptions –––––––––––]
'
[–––––––––––––––––––––– Implementation ––––––––––––––––––––––]
DEF Error$(n) ' by Ton Nillesen, November 2019
IF NOT Set THEN GOSUB Init
IF (n>Last) OR (n<0) THEN RETURN "Unknown error" ELSE RETURN A(n)
Init: ' local subroutine
DIM A()
'–––––– BestBasic
'Nrs 0 - 3
A+"no error"
A+"file/directory access error"
A+"amount of read/written data is not what was expected"
A+"text is not a number"
'–––––– Initiated by FIRgain, https://bestbasic.net/forum/viewtopic.php?
'Nrs 4 - last
A+"failing symmetry"
A+"parameter(s) not accepted"
A+"Size is not correct"
Last=(SIZEOF A)-1
RETURN ' from subroutine
END DEF ' Error$
# Error test.bb is a demo of the function Error$(n) which displays Error messages:
It is still a long way to go

Post Reply