home *** CD-ROM | disk | FTP | other *** search
-
- tclear()
-
- $include ("windef.max")
-
- ; This program provides the framework for a simple
- ; Max command processor.
-
- ; The MaxEdit prompt function is used to set the prompt
- ; character to colon. Normally the editor returns all characters
- ; to the left of the cursor. The prompt feature is used to specify
- ; the last character in the prompt. The editor then returns only
- ; characters between the prompt character and the cursor.
-
- ; Try commands like "put(time())" to see how it works.
- ; Try prompt to change the default prompt.
-
- Function shell
- Begin
-
- set (prompt "Max")
- window (WPrompt ":")
-
- Loop
-
- ; Print a prompt and get a command.
-
- printx (prompt ": ")
- get (cmd)
-
- ; If command is the prompt command then let user change
- ; prompt, otherwise let Max evaluate it.
-
- If strind (cmd "prompt")
- Then
- put ("Enter new prompt")
- get (prompt)
- EndThen
- Else
- eval (cmd)
- EndElse
- EndIf
-
- EndLoop
-
- EndFunction