Should the 'Stop'/'Return' be outside the If/Then/End Statement?
» Forum
> Your Projects
Good point, I will change it to be a 'Return' instead of a 'Stop.' However the 'Return' should be inside the if/then/end because if should stop the program if xLIB/C3 is not installed.
I'm just worried about memory leaks and what not because I remember back from my BASIC days you'd slow your program down jumping out of a If/Then/End with a goto.
Is this not the same for Stop/Return? I started using a hierarchy of while loops much later on in my BASIC career...
Is this not the same for Stop/Return? I started using a hierarchy of while loops much later on in my BASIC career...
some18kanal0n3 wrote:
I'm just worried about memory leaks and what not because I remember back from my BASIC days you'd slow your program down jumping out of a If/Then/End with a goto.
Is this not the same for Stop/Return? I started using a hierarchy of while loops much later on in my BASIC career...
Is this not the same for Stop/Return? I started using a hierarchy of while loops much later on in my BASIC career...
Yeah, I think using Return inside a loop creates memory leaks, but I don't think it does it with Stop as Stop exits all launched programs.
Nope Return is fine as it closes all open loops and such.
"Always code as if the person who will maintain your code is a maniac serial killer that knows where you live" -Unknown
"If you've done something right no one will know that you've done anything at all" -Futurama
"Have a nice day, or not, the choice is yours." Tom Steiner
<Michael_V> or create a Borg collective and call it The 83+
<Michael_V> Lower your slide cases and prepare to be silent linked. Memory clears are futile.
TheStorm wrote:
Nope Return is fine as it closes all open loops and such.
Seconded. Return and Stop both flush the block stack.
As did I
And now that I look at my logic, I should have known 'Stop' clears the block stack (as Kerm put it) =/
And now that I look at my logic, I should have known 'Stop' clears the block stack (as Kerm put it) =/
some18kanal0n3 wrote:
As did I
And now that I look at my logic, I should have known 'Stop' clears the block stack (as Kerm put it) =/
Back down to the level it was at when the program entered, anyway, as the program might have been called from within a loop block in another program. And now that I look at my logic, I should have known 'Stop' clears the block stack (as Kerm put it) =/
KermMartian wrote:
some18kanal0n3 wrote:
As did I
And now that I look at my logic, I should have known 'Stop' clears the block stack (as Kerm put it) =/
Back down to the level it was at when the program entered, anyway, as the program might have been called from within a loop block in another program.And now that I look at my logic, I should have known 'Stop' clears the block stack (as Kerm put it) =/
magicdanw wrote:
KermMartian wrote:
some18kanal0n3 wrote:
As did I
And now that I look at my logic, I should have known 'Stop' clears the block stack (as Kerm put it) =/
Back down to the level it was at when the program entered, anyway, as the program might have been called from within a loop block in another program.And now that I look at my logic, I should have known 'Stop' clears the block stack (as Kerm put it) =/
or good if you know your prog is full on mem leaks you can always call this to fix them though not really.
"Always code as if the person who will maintain your code is a maniac serial killer that knows where you live" -Unknown
"If you've done something right no one will know that you've done anything at all" -Futurama
"Have a nice day, or not, the choice is yours." Tom Steiner
<Michael_V> or create a Borg collective and call it The 83+
<Michael_V> Lower your slide cases and prepare to be silent linked. Memory clears are futile.
- rthprog
- Expert (Posts: 726)
- 03 Dec 2008 07:37:17 am
- Last edited by rthprog on 03 Dec 2008 06:22:28 pm; edited 1 time in total
I quickly wrote up a skeleton implementation of a multiple-"window" IDE that allows users to view multiple programs at the same time, and switch between windows relatively easily....Its just a barebones IDE for me to tinker with. I understand that a lot of my code is redundant, useless, and straight-up ugly. I was wondering if anyone has any ideas/comments. I simply would like to know if anyone sees any potential in it.
The original intent was to allow users to code a program side-by-side with another program. For example, it would facilitate copying sections of code from another program, working on a large project, etc... However, multiple windows capable of more than just editing programs could become very useful; basically a mini-BASIC-shell. For example, your basic-PDA functionality could be implemented, as well as encourage me to write a background tasker (the only purpose of this I could think of would be to update a stupid toolbar clock...oh well)
So, just tell me what you think of it; How would you tweak the interface? What systemic changes need to be implemented? Do you see any potential “usefull-ness” in this? Should I even bother to continue working on this? =D
BTW I uploaded it to the cemetech archives as "tempide"
*EDIT*
please, download it now... =D
http://www.cemetech.net/programs/index.php?mode=file&path=/83plus/basic/programs/TEMPIDE.zip
Ooooh, how nice! You should make it do a diff of sorts so it can highlight the differences between two side-by-side programs.
That is really cool. How would the speed be, you think, working with this for long periods of time?
Definitely keep working on this, regardless.
Definitely keep working on this, regardless.
KermMartian wrote:
Ooooh, how nice! You should make it do a diff of sorts so it can highlight the differences between two side-by-side programs.
thanks; highlighting parts that are identical/different would be REALLY neat!
That just gave me an idea; what if there was an option to "clone" a program, and tinker with the clone? The "clonee" would scroll parallel to the clone window, and allow a user to make lots of changes without trashing the original code. Then, the "clone" code could be copied back to the orginal, and the temporary program storing the clone would be deleted. It would be a bit slow (when writing back), but such a tool could be very useful... *ponders*
A quick question; does anyone have an idea how to implement commenting? I just cant see a good place to store them... perhaps lines underneath the line to comment containing "if 0: Comment"?
jbr wrote:
That is really cool. How would the speed be, you think, working with this for long periods of time?
Definitely keep working on this, regardless.
Definitely keep working on this, regardless.
Thanks!
I could make it a LOT faster; the current version does a lot of redundant refreshing and has a lot of optimizing ahead of it.
oh, and you can download this super-alpha version here http://www.cemetech.net/programs/index.php?mode=file&path=/83plus/basic/programs/TEMPIDE.zip
rthprog wrote:
A quick question; does anyone have an idea how to implement commenting? I just cant see a good place to store them... perhaps lines underneath the line to comment containing "if 0: Comment"?
A line starting with a double quote (") can act as comment line in BASIC. The string will be stored in Ans, but it's a workable comment workaround
Nice work rthprog!
The " thing will not work in all situations however for example:
Code:
What I am implementing is While 0 and End around the line(s).
EDIT: Oh, and I have a couple of questions and comments about your split screen implementation:
How do you deal with lines that go over half way across the screen and therefore mess up the other side? I think that not enough code is being displayed, which is less a problem with your implementation than physical deficits of the screen. How do you deal with scrolling down? Do you just redraw the new lines and then place the cursor at the top?
The " thing will not work in all situations however for example:
Code:
:"Hello->Str1
:3+A->B
What I am implementing is While 0 and End around the line(s).
EDIT: Oh, and I have a couple of questions and comments about your split screen implementation:
How do you deal with lines that go over half way across the screen and therefore mess up the other side? I think that not enough code is being displayed, which is less a problem with your implementation than physical deficits of the screen. How do you deal with scrolling down? Do you just redraw the new lines and then place the cursor at the top?
Zaphod Beeblebrox wrote:
Nice work rthprog!
The " thing will not work in all situations however for example:
Code:
What I am implementing is While 0 and End around the line(s).
EDIT: Oh, and I have a couple of questions and comments about your split screen implementation:
How do you deal with lines that go over half way across the screen and therefore mess up the other side? I think that not enough code is being displayed, which is less a problem with your implementation than physical deficits of the screen. How do you deal with scrolling down? Do you just redraw the new lines and then place the cursor at the top?
The " thing will not work in all situations however for example:
Code:
:"Hello->Str1
:3+A->B
What I am implementing is While 0 and End around the line(s).
EDIT: Oh, and I have a couple of questions and comments about your split screen implementation:
How do you deal with lines that go over half way across the screen and therefore mess up the other side? I think that not enough code is being displayed, which is less a problem with your implementation than physical deficits of the screen. How do you deal with scrolling down? Do you just redraw the new lines and then place the cursor at the top?
it first takes a pic where the window is empty. Then, when it fills the window with lines, some going over, it clears the space to the right of the window. Then it recalls the pic stored before; tada! no lines go over =D
I use a cache; currently it is 8*16 (8 lines, 16 characters each.. I'll change that to 27 soon) Thus, I just scroll down one line, use Celtic to read the new line, and keep the cursor where it is. The cache is saved when you switch tabs; it is called upon whenever the window is refreshed.... when the window is resized, for example, to cut down refresh time.
*EDIT*
the advantage of "if 0: Comment" is that it would take less space because no ":end" is needed. The real problem is that when the program runs, it becomes ever so slightly slower =(
-
Silver Shadow
- Advanced Member (Posts: 298)
- 09 Dec 2008 07:26:05 am
- Last edited by Silver Shadow on 30 Jan 2009 07:57:53 am; edited 1 time in total
Yeah! 60% complete!!!!
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.
» Go to Registration page
» Go to Registration page
Page 8 of 9
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Advertisement