3

Anyone heard of 'something like' EDITLN or EDITLINE or LINEDIT statement in BASIC for editing lines of a program's own code while executing ?

I seem to remember a statement that was spelled 'something like' EDITLN or EDITLINE or LINEDIT, and wonder if maybe there was one -

  • In any version of BASIC
  • Used for editing lines of a program's own code while executing

Yes, this question would be a duplicate of Was self-modifying code possible using BASIC?, so I expect it should be immediately closed, and I will paste it into Was self-modifying code possible using BASIC? .

EDIT -
The edit command in GW-Basic is an answer. It seems I was probably remembering EDLIN in MS-DOS and couldn't remember what it was. I find it difficult to significantly distinguish this question from the original. I myself won't close this question, in case anyone else is hoping for more answers. The vote should decide it.

10
  • 1
    I'm voting to close this question as off-topic because as an ON PURPOSE duplicate it's at least a misunderstanding if not a misuse - you may rather delete it yourself ASAP
    – Raffzahn
    Aug 5, 2019 at 6:39
  • 3
    While this question is similar to the linked question, it is not a duplicate as self-modifying BASIC code didn't necessarily use EDITLN etc, it used the likes of POKE as described in answers there. I am inclined to leave this open and not edit the other question. The two questions could reference each other.
    – Chenmunka
    Aug 5, 2019 at 8:40
  • 1
    The closest I can find is the edit command in GW Basic: gwbasicprograms.blogspot.com/2012/01/gw-basic-commands.html Aug 5, 2019 at 10:46
  • From memory - I haven't been able to find it anywhere else - there was a third-party add-on ROM for the HP9845 that enabled a command that had commands enabling reading and writing lines of BASIC from within a program. [Something like Line$ = PREAD(150) and PWRITE(Line$)] I remember having such a ROM about 1980 but only regularly used some of its less radical features.
    – Chenmunka
    Aug 5, 2019 at 12:16
  • 3
    Possible duplicate of Was self-modifying code possible using BASIC?
    – Brian H
    Aug 5, 2019 at 16:33

2 Answers 2

3

Many versions of BASIC had an "edit" command to allow character-based interactive editing of an existing statement, but invoking it from within a running program would terminate execution.

If memory serves, on a typical implementation such as the TRS-80, the system would display the line number with the cursor immediately following. Pressing spacebar would copy one character from the original line and advance the "original line position" pointer. Backspace would remove a character and move the "original line position" pointer back one character. Using other keys would allow one to insert, delete, or replace text within the program line, and pushing enter would copy all remaining text from the original line and exit edit mode.

This facility was useful on systems like the TRS-80 which did not allow text to be read off the screen, but wasn't needed on the Commodore or Apple II, which did.

5
  • Did you notice the part of the question that specifies the command must be "[u]sed for editing lines of a program's own code while executing"? I think between that and the other comments in the question saying it is a duplicate make the intent clear.
    – cjs
    Aug 6, 2019 at 17:22
  • @CurtJ.Sampson: The title question is about whether anyone remembers an "edit" statement in BASIC. Further, it seemed likely to me that the person was correctly remembering the existence of a statement with that name, but misremembering the purpose.
    – supercat
    Aug 6, 2019 at 17:26
  • Sure, but given that question titles are supposed to be short, I personally would not ignore clarification in the body and answer a clearly different interpretation of the title question.
    – cjs
    Aug 6, 2019 at 17:30
  • @CurtJ.Sampson: Note the last clause of my first paragraph, which addresses the "self-modifying code" angle.
    – supercat
    Aug 6, 2019 at 17:34
  • Yes, I had noted that before making any of my comments, and took it into account.
    – cjs
    Aug 6, 2019 at 17:37
1

Nearest I can get is this:

I recall a BASIC command to receive an input and execute as an instruction while the program was running. It was in a microcomputer at school (the early 80s), can't remember the model.

The command was EVAL. So you get a string with a BASIC instruction and then EVAL will execute that string as a normal BASIC instruction, while the program was running. This command wasn't present in every BASIC.

https://en.wikipedia.org/wiki/Eval

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .