Ooops
October 25, 2021, 19:11:20

Author Topic: Bug in live edit?  (Read 618 times)

Offline twgonder

  • Jr. Member
  • **
  • Posts: 29
Bug in live edit?
« on: July 08, 2021, 13:11:44 »
I think I read in the documentation that F8 saves the program and runs it.
If I recall, the automatic save was taken out of the RUN several versions back.
In any case, a save shouldn't be required for a program to operate properly with F8

In the attached snip, the x variable was 5 then changed to 1 in line 147, and then F8 was pressed.
Line 150 should then print, but it doesn't.
To get the program to run properly, I have to SAVE it first if using F8
but just pressing <ctrl> + r seems to work properly.

As a matter of practice, I don't like saving a program until it has been tested to work okay.
« Last Edit: July 08, 2021, 13:14:52 by twgonder »

Offline bplus

  • Full Member
  • ***
  • Posts: 229
Re: Bug in live edit?
« Reply #1 on: July 09, 2021, 13:12:56 »
Quote
As a matter of practice, I don't like saving a program until it has been tested to work okay.

+1

As a matter of practice, I don't like being allowed to exit editor without offer to save code. It is so frustrating to loose so much work with one wrong click. Chris did fix something on exit and when I am not on automatic pilot work gets saved but I have some other habit and when working with sb that causes me loss after loss of work.
« Last Edit: July 09, 2021, 13:19:34 by bplus »

Offline twgonder

  • Jr. Member
  • **
  • Posts: 29
Re: Bug in live edit?
« Reply #2 on: July 10, 2021, 02:02:37 »
Quote
As a matter of practice, I don't like saving a program until it has been tested to work okay.

As a matter of practice, I don't like being allowed to exit editor without offer to save code. It is so frustrating to loose so much work with one wrong click. Chris did fix something on exit and when I am not on automatic pilot work gets saved but I have some other habit and when working with sb that causes me loss after loss of work.

A valid point. To my way of thinking, executing the code <ctrl> + r shouldn't save. But yes, you shouldn't be able to exit the
 editor if the code has been changed without a dialog box appearing. I think smallBASIC works that way now (it didn't in 12.14 if I recall correctly).

In this post, I'm concerned about F8 not executing the current code in the editor window.

Offline bplus

  • Full Member
  • ***
  • Posts: 229
Re: Bug in live edit?
« Reply #3 on: July 10, 2021, 03:25:33 »
Quote
In this post, I'm concerned about F8 not executing the current code in the editor window.

Oh sorry, I always use the right click popup menu for Run or Exit from editor to Files or Saves for that matter.

Offline Aurel

  • Sr. Member
  • ****
  • Posts: 353
Re: Bug in live edit?
« Reply #4 on: July 10, 2021, 19:29:57 »
Quote
It is so frustrating to loose so much work with one wrong click

Yes Mark it is ..
especialy if you have a large code ..
one of the reasons i prefer Scintilla which have built-in undo
also i never use keyboard for runing code
« Last Edit: July 10, 2021, 19:31:57 by Aurel »
(Y)

Offline chrisws

  • Full Member
  • ***
  • Posts: 117
    • SmallBASIC
Re: Bug in live edit?
« Reply #5 on: July 13, 2021, 09:21:55 »
The idea behind "Live edit" is:

1. Edit your program in your favourite programming editor
2. Press save
3. SmallBASIC notices the file has changed and runs it.

This way you can immediately see the effects of your changes.

To put SmallBASIC in this mode you first need to launch it with the -x flag


Offline twgonder

  • Jr. Member
  • **
  • Posts: 29
Re: Bug in live edit?
« Reply #6 on: July 14, 2021, 01:43:48 »
The idea behind "Live edit" is:

1. Edit your program in your favourite programming editor
2. Press save
3. SmallBASIC notices the file has changed and runs it.

This way you can immediately see the effects of your changes.

To put SmallBASIC in this mode you first need to launch it with the -x flag

Does this answer mean that I shouldn't use F8 in the smallBASIC editor? Does it mean that the current code in the smallBASIC editor isn't used and something else is?

Offline chrisws

  • Full Member
  • ***
  • Posts: 117
    • SmallBASIC
Re: Bug in live edit?
« Reply #7 on: July 14, 2021, 10:56:45 »
Does this answer mean that I shouldn't use F8 in the smallBASIC editor? Does it mean that the current code in the smallBASIC editor isn't used and something else is?

It's just a different work-flow to what you expected. When you press F8 a separate executable instance is launched using contents of the saved file.

Sounds like you expected a separate window to appear using the contents of the editor buffer (no necessarily saved) ?

This is how Control-R works. The live-edit thing was an experiment. I could change how it works if that's what ppl want.

Offline twgonder

  • Jr. Member
  • **
  • Posts: 29
Re: Bug in live edit?
« Reply #8 on: July 14, 2021, 19:15:17 »
It is kinda nice to view the output and be able to look at the source in the edit screen at the same time.
It's not a big deal to save first, it just had me baffled why what was showing in the edit screen wasn't what was running with F8.

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal