home *** CD-ROM | disk | FTP | other *** search
- ***
- * DEMO.PRG, by Steve Badaracco (public domain)
- * To demonstrate the MSG() function
- * For Clipper Summer '87
- * 10/24/88
- ***
-
- ? '1 : '+ msg() && attempt to close the message file (not opened)
-
- ? '2 : '+ msg(43,.f.) && valid show of message 43
-
- ? '3a: '+ msg(.t.,.f.) && invalid first parameter
- ? '3b: '+ msg(.t.) && same error, use MISC_ERROR
-
- ? '4a: '+ msg() && must close file before using another MSG file
- sysn = 'NONEXIST' && will attempt to use a new (non-existent) MSG file
- ? '4b: ' + msg(40,.f.) && file not found
- ? '4c: ' + msg(40,.t.) && same error, use MISC_ERROR
- ? '5 : ' + msg() && close the NONEXIST file, which was never opened
-
- sysn = .f. && won't use SYSN anymore, will use SYSTEM.MSG
-
- ? '6a: '+ msg(42,.f.) && 42 is a bad record in SYSTEM.MSG: unbalanced quotes
- ? '6b: '+ msg(42) && same error, use MISC_ERROR
-
- ? '7a: '+ msg(44,.f.) && no record 44 in SYSTEM.MSG
- ? '7b: '+ msg(44) && same error, use MISC_ERROR
- ?
-
- msg() && now close the file (always do this)
- quit && and quit
- * EOP: DEMO.PRG
-
-
- ***
- * Nantucket's MISC_ERROR(), modified to return the error string and not quit
- * Note: DO NOT use this function in a real program, since it will
- * short-circuit the true misc_error() function and cause
- * unpredictable damage!
- ***
-
- FUNCTION misc_error
- PARAMETERS name, line, info, model
- return "Proc " + M->name + " line " + LTRIM(STR(M->line)) + ", " + M->info
- *