home *** CD-ROM | disk | FTP | other *** search
- ;
- ; MSMESG.ASM
- ; MS 4.0
- ; Copyright (c) 1985, 87 by Borland International, Inc.
- ;
- ; Message area and access routine
- ;
-
- DATA SEGMENT BYTE PUBLIC
-
- DATA ENDS
-
- CODE SEGMENT BYTE PUBLIC
-
- ASSUME CS:CODE,DS:DATA
-
- PUBLIC EdMessagePtr
-
- ;CS-relative data:
- ;Be sure to terminate list with a pair of 0 bytes
-
- Messages LABEL BYTE
- ;first two bytes are message number
- ;next byte is string length
- db 2, 0, 15, ' File not found'
- db 3, 0, 15, ' Path not found'
- db 5, 0, 19, ' File access denied'
- db 21, 0, 26, ' Typeahead buffer overflow'
- db 22, 0, 22, ' Window size too small'
- db 25, 0, 34, ' Word too long for current margins'
- db 26, 0, 20, ' No block is defined'
- db 28, 0, 22, ' Invalid marker number'
- db 29, 0, 24, ' Marker has not been set'
- db 30, 0, 17, ' Marker not found'
- db 31, 0, 9, ' No files'
- db 32, 0, 12, ' Press <Esc>'
- db 33, 0, 12, ' to continue'
- db 34, 0, 26, ' Cannot read from a device'
- db 35, 0, 20, ' Insufficient memory'
- db 36, 0, 16, ' Invalid integer'
- db 37, 0, 16, ' Command aborted'
- db 38, 0, 10, ' Not found'
- db 39, 0, 28, ' Main program file not found'
- db 40, 0, 25, ' Pagination not activated'
- db 41, 0, 14, ' Line too long'
- db 42, 0, 39, ' Cannot play back macro while recording'
- db 45, 0, 27, ' Problem closing print file'
- db 46, 0, 34, ' Problem closing print output file'
- db 47, 0, 31, ' Valid page numbers are 1..4095'
- db 48, 0, 35, ' Temporary margin not available now'
- db 49, 0, 44, ' Default extension may not contain wildcards'
- db 50, 0, 23, ' Not a valid macro file'
- db 51, 0, 25, ' Error reading help index'
- db 52, 0, 33, ' No help available for this topic'
- db 53, 0, 24, ' Error reading help text'
- db 54, 0, 33, ' Help section exceeds buffer size'
- db 55, 0, 39, ' Select lower level menu to access help'
- db 56, 0, 31, ' You only have one window open!'
- db 57, 0, 34, ' Turbo Lightning must be installed'
- db 58, 0, 40, ' Set path to AUXI.DIC in Lightning Setup'
- db 59, 0, 31, ' Cursor must be in marked block'
- db 60, 0, 28, ' Word wrap must be activated'
- db 61, 0, 36, ' Not a valid printer definition file'
- db 62, 0, 50, ' Open Window command must have keystrokes assigned'
- db 63, 0, 46, ' Temporary margin must be left of right margin'
- db 64, 0, 27, ' Help file MS.HLP not found'
- db 65, 0, 39, ' Save modified document before printing'
- db 66, 0, 36, ' Start page is larger than stop page'
- db 67, 0, 21, ' Print file not found'
- db 68, 0, 26, ' Output file not specified'
- db 71, 0, 44, ' Enhanced graphics adapter must be installed'
- db 72, 0, 36, ' Integer outside of acceptable range'
- db 73, 0, 41, ' Cannot apply macro within Find-and-Macro'
- db 74, 0, 26, ' Unable to reload AUXI.DIC'
- db 100, 0, 16, ' Disk read error'
- db 101, 0, 17, ' Disk write error'
- db 104, 0, 27, ' Unable to create .BAK file'
- db 106, 0, 52, ' Root menu must be specified first in menu data file'
- db 107, 0, 46, ' Too many submenus specified in menu data file'
- db 108, 0, 40, ' Error in level number in menu data file'
- db 111, 0, 21, ' Turn on font display'
- db 120, 0, 30, ' Window is too small to divide'
- db 122, 0, 23, ' Invalid directory path'
- db 124, 0, 21, ' Unable to invoke DOS'
- db 125, 0, 31, ' Insufficient contiguous memory'
- db 126, 0, 32, ' Insufficient stack buffer space'
- db 127, 0, 33, ' Cannot create another window now'
- db 128, 0, 38, ' DOS critical error - Device not ready'
- db 153, 0, 23, ' Unexpected end of file'
- db 240, 0, 26, ' Disk write error occurred'
- db 241, 0, 38, ' File creation error or directory full'
- db 246, 0, 25, ' Done with spelling check'
- db 247, 0, 22, ' MicroStar Help System'
- db 248, 0, 15, ' Initialization'
- db 249, 0, 6, ' Reset'
- db 250, 0, 5, ' Page'
- db 251, 0, 5, ' Byte'
- db 252, 0, 5, ' Line'
- db 253, 0, 5, ' Word'
- db 254, 0, 6, ' Words'
- db 255, 0, 47, ' Updating file statistics, press a key to abort'
- db 0, 1, 41, ' Enter empty string to use current column'
- db 1, 1, 41, ' Select from menu, <Esc> to quit checking'
- db 2, 1, 29, ' Initializing for spell check'
- db 3, 1, 11, ' Lower case'
- db 4, 1, 25, ' First letter capitalized'
- db 5, 1, 11, ' Upper case'
- db 6, 1, 17, ' Exactly as shown'
- db 7, 1, 12, ' for more'
- db 8, 1, 10, ' Skip once'
- db 9, 1, 25, ' Ignore for this document'
- db 10, 1, 28, ' List Lightning sound-alikes'
- db 11, 1, 19, ' Edit from keyboard'
- db 12, 1, 14, ' Mark with "~"'
- db 13, 1, 18, ' Add to dictionary'
- db 14, 1, 28, ' Batch mark rest of document'
- db 15, 1, 47, ' Select from menu, <Esc> to exit without adding'
- db 16, 1, 21, ' Edit word as desired'
- db 17, 1, 60, ' Keypad to edit, <Enter> to accept, <Esc> to leave unchanged'
- db 18, 1, 27, ' Marking unrecognized words'
- db 19, 1, 27, ' Stop spelling check? (Y/N)'
- db 20, 1, 18, ' Add to dictionary'
- db 21, 1, 20, ' Word not recognized'
- db 22, 1, 18, ' Checking spelling'
- db 23, 1, 13, ' Alternatives'
- db 24, 1, 29, ' No likely alternatives found'
- db 25, 1, 25, ' Scanning for soundalikes'
- db 26, 1, 16, ' Help and status'
- db 27, 1, 16, ' Cursor movement'
- db 28, 1, 15, ' Quick movement'
- db 29, 1, 18, ' Insert and delete'
- db 30, 1, 19, ' Search and replace'
- db 31, 1, 6, ' Files'
- db 32, 1, 8, ' Windows'
- db 33, 1, 7, ' Blocks'
- db 34, 1, 14, ' Text commands'
- db 35, 1, 5, ' Tabs'
- db 36, 1, 10, ' Utilities'
- db 37, 1, 21, ' Settings and toggles'
- db 38, 1, 15, ' Spell checking'
- db 39, 1, 7, ' Macros'
- db 40, 1, 9, ' Printing'
- db 41, 1, 14, ' Function keys'
- db 42, 1, 33, ' Press <Esc> to leave help system'
- db 43, 1, 21, ' <PgDn> for next page'
- db 44, 1, 22, ' <PgUp> for prior page'
- db 45, 1, 9, ' New File'
- db 46, 1, 63, ' Use keypad to edit, wildcards for directory, <Enter> to accept'
- db 47, 1, 15, ' Directory mask'
- db 48, 1, 53, ' Use to browse, <Enter> to select, <Esc> to ignore'
- db 49, 1, 24, ' Press <Esc> to continue'
- db 50, 1, 23, ' not saved. Save? (Y/N)'
- db 51, 1, 30, ' Enter Macro File name to load'
- db 52, 1, 31, ' Enter Macro File name to store'
- db 53, 1, 13, ' File exists!'
- db 54, 1, 21, ' Filename to Write to'
- db 55, 1, 20, ' Go to Column number'
- db 56, 1, 18, ' Go to Line number'
- db 57, 1, 8, ' Windows'
- db 58, 1, 32, ' Insert Macro (Number of Times<='
- db 59, 1, 22, ' Choose macro to apply'
- db 60, 1, 22, ' Choose macro to store'
- db 61, 1, 22, ' New Drive or Pathname'
- db 62, 1, 16, ' Options (UBGWL)'
- db 63, 1, 22, ' Overwrite file? (Y/N)'
- db 64, 1, 17, ' Pathname of file'
- db 65, 1, 10, ' Read file'
- db 66, 1, 10, ' Save file'
- db 67, 1, 11, ' Search for'
- db 68, 1, 14, ' Help Sections'
- db 69, 1, 8, ' Reading'
- db 70, 1, 10, ' Searching'
- db 71, 1, 8, ' Working'
- db 72, 1, 15, ' RAM bytes free'
- db 73, 1, 11, ' (Y/N/A/Q):'
- db 74, 1, 13, ' Apply Macro?'
- db 75, 1, 30, ' Approximate memory available:'
- db 77, 1, 32, ' DOS command (<Enter> for shell)'
- db 78, 1, 24, ' Printer Definition File'
- db 79, 1, 19, ' Current Directory:'
- db 80, 1, 16, ' Disk bytes free'
- db 81, 1, 17, ' Options (UBGWLN)'
- db 82, 1, 13, ' Replace with'
- db 83, 1, 9, ' Replace?'
- db 84, 1, 13, ' Right Margin'
- db 85, 1, 36, ' Type EXIT to return to MicroStar...'
- db 86, 1, 29, ' -- Press any key to continue'
- db 87, 1, 18, ' MicroStar Version'
- db 88, 1, 12, ' Left Margin'
- db 89, 1, 49, ' Insert paper, press <Enter> to continue printing'
- db 90, 1, 14, ' File to print'
- db 91, 1, 13, ' MicroStar...'
- db 96, 1, 13, ' DOS Version:'
- db 98, 1, 6, ' Bytes'
- db 99, 1, 43, ' Use to resize window, <Enter> to accept'
- db 100, 1, 17, ' Default Tab Size'
- db 101, 1, 18, ' Go to Page Number'
- db 102, 1, 11, ' Top Margin'
- db 103, 1, 14, ' Bottom Margin'
- db 104, 1, 12, ' Page Length'
- db 105, 1, 11, ' Undo limit'
- db 106, 1, 7, ' Colors'
- db 107, 1, 25, ' Error reading print file'
- db 108, 1, 21, ' Printer out of paper'
- db 109, 1, 17, ' Printer off line'
- db 110, 1, 23, ' Printer not responding'
- db 111, 1, 32, ' Error writing print output file'
- db 112, 1, 31, ' Printer command stack overflow'
- db 113, 1, 22, ' Unknown printer error'
- db 114, 1, 35, ' - <Esc> to abort, <Enter> to retry'
- db 115, 1, 7, ' Append'
- db 116, 1, 10, ' Overwrite'
- db 117, 1, 16, ' Printer Strings'
- db 118, 1, 8, ' Choices'
- db 119, 1, 52, ' to select item, <Enter> to change, <Esc> to quit'
- db 120, 1, 56, ' to select color, <Enter> to change, <Esc> to ignore'
- db 121, 1, 22, ' 3 Character Extension'
- db 122, 1, 12, ' Print Setup'
- db 123, 1, 10, ' Available'
- db 124, 1, 12, ' Not Visible'
- db 125, 1, 8, ' Markers'
- db 126, 1, 8, ' Not Set'
- db 127, 1, 7, ' Macros'
- db 128, 1, 8, ' No Name'
- db 129, 1, 11, ' Macro Name'
- db 130, 1, 22, ' File Name to Write to'
- db 131, 1, 62, ' to select, <Ins> to add, <Del> to delete, <Enter> to accept'
- db 132, 1, 22, ' Abort printing? (Y/N)'
- db 133, 1, 20, ' Press <Esc> to exit'
- db 134, 1, 7, ' Device'
- db 135, 1, 18, ' Print Output File'
- db 136, 1, 11, ' First Page'
- db 137, 1, 10, ' Last Page'
- db 138, 1, 10, ' for menus'
- db 141, 1, 6, ' Pages'
- db 142, 1, 9, ' Modified'
- db 143, 1, 13, ' Not Modified'
- db 144, 1, 6, ' Lines'
- db 145, 1, 19, ' Stored defaults in'
- db 146, 1, 14, ' Current File:'
- db 148, 1, 21, ' Choose macro to edit'
- db 149, 1, 61, ' <ScrollLock> for literal, <CtrlBkSp> clears, <Enter> accepts'
- db 150, 1, 12, ' Normal Text'
- db 151, 1, 13, ' Marked Block'
- db 152, 1, 14, ' Window Status'
- db 153, 1, 12, ' Prompt Line'
- db 154, 1, 13, ' Block Cursor'
- db 155, 1, 10, ' Menu Text'
- db 156, 1, 11, ' Menu Frame'
- db 157, 1, 12, ' Menu Select'
- db 158, 1, 12, ' Menu Hilite'
- db 159, 1, 10, ' Bold text'
- db 160, 1, 13, ' Doublestrike'
- db 161, 1, 11, ' Underscore'
- db 162, 1, 12, ' Superscript'
- db 163, 1, 10, ' Subscript'
- db 164, 1, 11, ' Compressed'
- db 165, 1, 7, ' Italic'
- db 166, 1, 13, ' Snow Control'
- db 167, 1, 13, ' Block Cursor'
- db 168, 1, 13, ' 43 Line Mode'
- db 169, 1, 6, ' Fonts'
- db 170, 1, 14, 'Print file now'
- db 172, 1, 12, 'Name of file'
- db 173, 1, 15, 'Auto formatting'
- db 174, 1, 10, 'First page'
- db 175, 1, 9, 'Last page'
- db 177, 1, 13, 'Which printer'
- db 178, 1, 6, 'Device'
- db 179, 1, 17, 'Manual paper feed'
- db 180, 1, 13, 'Use formfeeds'
- db 181, 1, 18, 'Edit printer codes'
- db 182, 1, 18, 'Save printer setup'
- db 0, 0 ;Terminate with pair of zeros
-
- ;****************************************************** EdMessagePtr
-
- ; function EdMessagePtr(msgno:word) : Pointer; external;
-
- ; {-Return a pointer to the message string, nil if not available}
-
- MsgNo EQU WORD PTR [BP+4]
-
- EdMessagePtr PROC NEAR
-
- PUSH BP ;Save BP
- MOV BP,SP ;Set up stack frame
- PUSH DS ;Save DS
-
- MOV BX,MsgNo ;Get message number to seek
-
- MOV AX,CS
- MOV DS,AX ;Put CS into DS
- ASSUME DS:CODE
- LEA SI,Messages ;Now DS:SI points to Messages
- CLD ;Forward direction
-
- EMPNext:
- LODSW ;Next message number into AX
- OR AX,AX ;Last message?
- JZ EMPNotFound
- CMP AX,BX ;The message we seek?
- JZ EMPFound
- LODSB ;Get length byte of string
- XOR AH,AH ;Clear upper byte
- ADD SI,AX ;Skip over string
- JMP Short EMPNext ;Try again
-
- EMPNotFound:
- XOR DX,DX ;Clear pointer if Message not found
- ;AX is already zero is we get here
- JMP Short EMPDone
-
- EMPFound:
- ;Return pointer in DX:AX
- MOV DX,CS ;Pointer Segment is current CS
- MOV AX,SI ;SI points to length byte of string
-
- EMPDone:
- POP DS ;Restore DS
- ASSUME DS:DATA
- MOV SP,BP ;Restore SP
- POP BP ;Restore BP
- RET 2 ;Remove parameter from stack
-
- EdMessagePtr ENDP
-
- CODE ENDS
-
- END