home *** CD-ROM | disk | FTP | other *** search
- TITLE('TOOLBOX')
- OMIT('╝')
- ╔════════════════════════════════════════════════════════════════════════════╗
- ║ Program - TOOLBOX ! ║
- ║ Author - Axel Fenger ! ║
- ╚════════════════════════════════════════════════════════════════════════════╝
- PROGRAM
-
- INCLUDE('KEYCODES.EQU')
- INCLUDE('CLARION.EQU')
- INCLUDE('ERRORS.EQU')
-
- MAP
- CheckOpen(*FILE)
- DiskError(<STRING>),BYTE
- ShowWarning
- MODULE('TOOLBO01')
- HauptMenu
- BearbeiteTxInhalt
- BuildKeys
- ZeigTxInhalt
- DruckTxInhalt
- RedirectReport
- ViewReport
- END
- INCLUDE('BROWSE.INC')
- END
-
- EJECT('File Layouts')
-
- GLO:MessageGroup GROUP
- GLO:Message1 STRING(45)
- GLO:Message2 STRING(45)
- GLO:Message3 STRING(45)
- .
- GLO:InsertMsg STRING('Datensatz wird angehangen {65511}')
- GLO:ChangeMsg STRING('Datensatz wird geändert {6}')
- GLO:DeleteMsg STRING('OK für Löschen wählen {8}')
- GLO:Filespec STRING(64)
-
- TxInhalt FILE,PRE(TxI),DRIVER('dBase3'),CREATE
- TxIndexKey KEY(+TxI:TxIndex),OPT,NOCASE
- NameKey KEY(+TxI:Name,+TxI:Vorname),DUP,NOCASE
- RECORD RECORD
- TxIndex STRING(14)
- Titel STRING(74)
- UTitel STRING(74)
- Rubrik STRING(30)
- Ausgabe STRING(10)
- Seite STRING(3)
- Name STRING(30)
- Vorname STRING(30)
- Sprache STRING(30)
- Thema STRING(30)
- Bemerkung STRING(74)
- . .
-
-
- AddRecord EQUATE(1) ! Add a new record
- ChangeRecord EQUATE(2) ! Change the current record
- DeleteRecord EQUATE(3) ! Delete the current record
-
-
- CODE
- LOADSYMBOLS !Display graphic mouse
- SETNOBLINK !Enable enhanced colors
- SETMOUSE(1,1) !Turn on mouse
- SETCOLOR(WhiteOnBlack) !Set white on black
- BLANK !Clear the screen
- SETCOLOR !Turn off override color
-
- HauptMenu !Call the first procedure
-
- RETURN !Return to DOS
-
- OMIT('╝')
- ╔════════════════════════════════════════════════════════════════════════════╗
- ║ Check ERROR() function after opening a file ║
- ╚════════════════════════════════════════════════════════════════════════════╝
- CheckOpen PROCEDURE(File)
-
- CODE
- OPEN(File,42h) !Attempt to open the file
- CASE ERRORCODE() ! and check for errors
- OF NoError !Return if no error
- OROF IsOpenErr ! or if already open.
- RETURN
- OF NoFileErr !If file was not found
- CREATE(File) !Create the file
- OPEN(File,42h) ! then open it
- IF ~ERRORCODE() THEN RETURN. ! And return if it opened
- OF InvalidFileErr !Invalid Record Declaration
- GLO:Message1 = 'Error accessing: '& NAME(File)
- GLO:Message2 = 'Code: ' & ERRORCODE() & ' ' & ERROR()
- GLO:Message3 = 'Press OK to return to DOS'
- ShowWarning
- HALT(InvalidFileErr)
- OF BadKeyErr !Key Files must be rebuilt
- GLO:Message1 = NAME(File) & ' Key file is invalid'
- GLO:Message3 = 'Press OK to rebuild keyfile'
- ShowWarning
- OPEN(File,12H) !Open for exclusive access
- BUILD(File) !Rebuild the key files
- IF ERRORCODE()
- GLO:Message1 = NAME(File) & ' The file cannot be repaired'
- GLO:Message2 = 'while other stations are using it'
- GLO:Message3 = 'Press OK to return to DOS'
- ShowWarning
- HALT(BadKeyErr)
- ELSE
- CLOSE(File) !Close
- OPEN(File,42h) ! then open it
- END
- END !End of Case Structure
- IF DiskError(NAME(File) & ' File could not be opened') THEN HALT(0). !Cannot resume
-
- OMIT('╝')
- ╔════════════════════════════════════════════════════════════════════════════╗
- ║ Check ERROR() function after a disk access ║
- ╚════════════════════════════════════════════════════════════════════════════╝
- DiskError FUNCTION(Cause)
- StopMsg:: STRING(180)
-
- CODE
- IF ~ERRORCODE() THEN RETURN(0). !Return with no error
- IF ~OMITTED(1) !If a cause was given
- StopMsg:: = 'Cause: ' & Cause & LF:CR ! Display it
- END !End IF
- IF ERRORFILE() !If error involves a file
- StopMsg:: = CLIP(StopMsg::) & 'File : ' | ! display the file
- & ERRORFILE() & LF:CR
- END !End IF
- StopMsg:: = CLIP(StopMsg::) & 'Error: ' | !Display the error code
- & ERRORCODE() & ' - ' | ! and the error message
- & ERROR() & LF:CR
-
- STOP(StopMsg::) !Stop with message
- RETURN(1) !Return with error
-
- OMIT('╝')
- ╔════════════════════════════════════════════════════════════════════════════╗
- ║ Display a warning message using 3 Global message variables. ║
- ╚════════════════════════════════════════════════════════════════════════════╝
- ShowWarning PROCEDURE
-
- SaveStyle STRING(256)
-
- Screen SCREEN(9,53),PRE(SCR),CENTER,SHADOW,CUA,COLOR(112)
- ROW(1,1) STRING('█▀{51}█'),COLOR(116)
- ROW(9,1) STRING('█▄{51}█'),COLOR(116)
- REPEAT(7)
- ROW(2,1) STRING('█'),COLOR(116)
- ROW(2,53) STRING('█'),COLOR(116)
- .
- ROW(3,5) ENTRY(@S45),USE(GLO:Message1),INS,SKIP,COLOR(112,112,112)
- ROW(4,5) ENTRY(@S45),USE(GLO:Message2),INS,SKIP,COLOR(112,112,112)
- ROW(5,5) ENTRY(@s45),USE(GLO:Message3),INS,SKIP,COLOR(112,112,112)
- ROW(7,24) BUTTON(' &Ok |'),SHADOW,USE(?Ok),COLOR(23,71,24,31,79)
- .
-
- CODE
- SaveStyle = STYLES() !Save current style
- GETSTYLES('') !Turn off Styles
- GLO:Message1 = CENTER(GLO:Message1,SIZE(GLO:Message1))
- GLO:Message2 = CENTER(GLO:Message2,SIZE(GLO:Message2))
- GLO:Message3 = CENTER(GLO:Message3,SIZE(GLO:Message3))
- OPEN(Screen)
- DISPLAY
- ACCEPT !Enable keyboard and mouse
- CLEAR(GLO:MessageGroup) !Blank out message fields
- SETSTYLES(SaveStyle) !Restore user styles
- RETURN
-
-