Author Topic: TRON/TROFF  (Read 3355 times)

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 5112
  • QB Forever
TRON/TROFF
« on: December 04, 2009, 02:25:43 am »
No work has been done on this command yet.
Something old... Something new... Something borrowed... Something blue...

qbguy

  • Sr. Member
  • ****
  • Posts: 258
Re: TRON/TROFF
« Reply #1 on: January 01, 2010, 10:35:27 pm »
How would this work in a compiler anyway -- logging each line executed to a file?

stylin

  • Guest
Re: TRON/TROFF
« Reply #2 on: January 02, 2010, 12:59:11 am »
I can't test at the moment, but if I remember correctly compiled programs only output the line number as it executed to standard output or standard error, and that was only if you compiled with debugging information, otherwise the statements did nothing.

Aramis

  • Newbie
  • *
  • Posts: 29
Re: TRON/TROFF
« Reply #3 on: September 13, 2011, 05:59:36 pm »
In QB4.5

TRON causes the interpreted mode run (F5) to alternate between the run window and the code window.

TRON
DIM a(20)
FOR aa = 1 to 20
    a(aa) = aa
    print "-";
next aa

flickers back and forth between the code window and output window, highlighting the current line, with final output of:
Code: [Select]
--------------------
In the exe generated, it just goes straight to output. (QB4.5 test done in DosBox... on a mac)

Cyperium

  • Hero Member
  • *****
  • Posts: 3560
  • Knowledge is good, but understanding is better
    • Cyperium
Re: TRON/TROFF
« Reply #4 on: September 14, 2011, 02:51:51 pm »
So it just go straight to output in compiled programs? Then I guess Galleon wants to expand on it somehow, otherwise it's already implemented and the TRON/TROFF statements should only be ignored.

Aramis

  • Newbie
  • *
  • Posts: 29
Re: TRON/TROFF
« Reply #5 on: September 14, 2011, 05:42:09 pm »
So it just go straight to output in compiled programs? Then I guess Galleon wants to expand on it somehow, otherwise it's already implemented and the TRON/TROFF statements should only be ignored.

Yep.

Tho each command line between TRON and TROFF should flag for GDB as a report point.

LoopyCoder

  • Newbie
  • *
  • Posts: 4
  • Who doesn't love chicks with guns.
Re: TRON/TROFF
« Reply #6 on: March 22, 2012, 07:39:20 am »
Hi,

I'm new to the forum, and want to say I love QB64 so far.  The best thing about QB64 to me is that it's compiled instead of interpreted, but there's times I sure miss TRON/TROFF.  That said, I know the complications involved developing a TRON/TROFF function for a compiled language.   I've got a pretty good sized project in development, and wanted to ask is there any plans to develop a TRON/TROFF type command/interpreter interface in the future?  Regardless, thanks for the good work and keep it up.

Loopy

Pete

  • Hero Member
  • *****
  • Posts: 6626
  • Cuz I sez so varmint!
Re: TRON/TROFF
« Reply #7 on: March 22, 2012, 08:20:16 am »
Any usable debugging would tale  making an interpreter, which is every bit (excuse the pun) as difficult to do as making the compiler itself. If QB64 were to be used in schools, such a project would be invaluable. A couple of coders, by the way, have tried to produce an interpreter for QB64, made good progress, but ran out of time to complete anything that would work with some tuning. Even if Galleon decided to tackle it, it would slow down advancements in both the IDE and the compiler, and probably take two or more years of development time.

A gimmick trace on program could be built easily enough. you just make a program that reads your existing program from a file, and in between every line adds: DO: xkey$ = LOOP UNTIL xkey$ <> "": IF xkey$ = CHR$(27) THEN END. Of course this could be added as a sub and called in between each line, too.

You could further add PCOPY and switch to a different screen and back, to show the line number being executed. Using LINE INPUT would allow you to step through the original code as the exe file ran it. and waited for each line to be executed with that inkey$ sub or statement.

An alternative is to use the QB64 error line statement, see the wiki, and when you get an error, it will return the line number it occurred at.

Of course, you can always guess, by putting an end somewhere, to see if the buggy code makes it that far. I call that one TRIALON TRIALOFF.

Welcome to the forum,

Pete

 
It's only rocket science; it's not Linux!

Clippy

  • Hero Member
  • *****
  • Posts: 17480
  • I LOVE π = 4 * ATN(1)    Use the QB64 WIKI >>>
    • Pete's Qbasic Site
Re: TRON/TROFF
« Reply #8 on: March 22, 2012, 09:14:54 am »
Or use a _CONSOLE.
QB64 WIKI: Main Page
Download Q-Basics Code Demo: Q-Basics.zip
Download QB64 BAT, IconAdder and VBS shortcuts: QB64BAT.zip
Download QB64 DLL files in a ZIP: Program64.zip

LoopyCoder

  • Newbie
  • *
  • Posts: 4
  • Who doesn't love chicks with guns.
Re: TRON/TROFF
« Reply #9 on: March 22, 2012, 10:49:11 am »
Thanks for the ideas, Pete.  I've been using a simple scrolling line array to the screen to put the subroutine calls into so I can at least see the nesting involved where it's giving me errors.  Putting the program in a file and executing it isn't very practical, as it has a lot of external file calls... .ogg's and .png's and stuff, but I get the idea. 

And Clippy, thanks for the _CONSOLE suggestion.  I'll use that.  I knew the simulated interpreter would be a huge undertaking.  Sounds like it's not something that's high on the priority list right now, and that's cool.  I just wanted an idea.

Super nice work so far, folks.  And the wiki rocks.

Loopy

Galleon

  • Administrator
  • Hero Member
  • *****
  • Posts: 5112
  • QB Forever
Re: TRON/TROFF
« Reply #10 on: March 22, 2012, 12:21:35 pm »
Welcome,

At some stage I intend to allow debug information to flow between the QB64 IDE and the program it is running. When debugging, a slightly different (ie larger) executable would be created, and this would also allow for controlling the execution of a program.
Something old... Something new... Something borrowed... Something blue...

LoopyCoder

  • Newbie
  • *
  • Posts: 4
  • Who doesn't love chicks with guns.
Re: TRON/TROFF
« Reply #11 on: March 22, 2012, 01:18:17 pm »
Right on, Galleon.  Thanks for the input.  Good luck! 

OlDosLover

  • Moderator
  • Hero Member
  • *****
  • Posts: 5273
  • OlDosLover
Re: TRON/TROFF
« Reply #12 on: March 23, 2012, 06:39:35 am »
Hi all,
    Welcome to the forum LoopyCoder.
OlDosLover.

LoopyCoder

  • Newbie
  • *
  • Posts: 4
  • Who doesn't love chicks with guns.
Re: TRON/TROFF
« Reply #13 on: March 23, 2012, 09:28:48 am »
Hi OlDosLover,

I been reading your guys posts for awhile now.  I've learned a lot from these forums.  You guys have done some great work.

Loopy