Dec 092017
A nifty little Basic line editor which returns exit-codes. Can be modified for use on full-screen inputs. Source code only. | |||
---|---|---|---|
File Name | File Size | Zip Size | Zip Type |
EDT.DOC | 1543 | 756 | deflated |
EDT.SUB | 1741 | 491 | deflated |
TPCREAD.ME | 199 | 165 | deflated |
Download File EDT.ZIP Here
Contents of the EDT.DOC file
DOC file for EDT.SUB
EDT is a line-editing subroutine designed for simple inputs. An exit-
code is returned indicating which key press caused termination.
You must send the string to be edited, the colors, and the starting row
and column position. If you wish to provide a blank string to edit, you
must send a string of spaces.
Any keys may be added to the CASE listing, but I've included the ones I
frequently use.
The program loops until one of the keys causing an exit is pressed. A
number is attached to e% indicating which key was used. The up and down
arrow checking can be used in a full-screen input situation to advance to
the next or previous item. With some simple modifications, this little
SUB could be modified for most any needs.
Here are a few examples:
To edit a blank item of 51 spaces, Cyan on blue, at location 10, 10:
Edt (SPACE$(51), e%, 11, 1, 10, 10)
To edit a known item (Name$), Yellow on red, at location 5, 9:
Edt (Name$, e%, 14, 4, 5, 9)
After calling the subroutine, you can then base the code that follows on
the value of e%. For example:
SELECT CASE e%
CASE 1 'Enter Key
...
CASE 2 'Up Arrow
...
CASE 3 'Down Arrow
...
CASE 4 'F7 or ESC key
...
CASE 5 'F5 key
...
END SELECT
Good luck!
Produced by:
EDT is a line-editing subroutine designed for simple inputs. An exit-
code is returned indicating which key press caused termination.
You must send the string to be edited, the colors, and the starting row
and column position. If you wish to provide a blank string to edit, you
must send a string of spaces.
Any keys may be added to the CASE listing, but I've included the ones I
frequently use.
The program loops until one of the keys causing an exit is pressed. A
number is attached to e% indicating which key was used. The up and down
arrow checking can be used in a full-screen input situation to advance to
the next or previous item. With some simple modifications, this little
SUB could be modified for most any needs.
Here are a few examples:
To edit a blank item of 51 spaces, Cyan on blue, at location 10, 10:
Edt (SPACE$(51), e%, 11, 1, 10, 10)
To edit a known item (Name$), Yellow on red, at location 5, 9:
Edt (Name$, e%, 14, 4, 5, 9)
After calling the subroutine, you can then base the code that follows on
the value of e%. For example:
SELECT CASE e%
CASE 1 'Enter Key
...
CASE 2 'Up Arrow
...
CASE 3 'Down Arrow
...
CASE 4 'F7 or ESC key
...
CASE 5 'F5 key
...
END SELECT
Good luck!
Produced by:
December 9, 2017
Add comments