1. Need help debuggin

Good Morning Everyone,
    I am fairly new to programming in Euphoria, but for the most part it is 
very user friendly.  I have just started to program in windows instead of 
DOS because it appears to be much easier.  The only problem is that almost 
with every program I run I get the "Your program exceeds 300 statements in 
size and cannot provide run-time diagnostics."  I know that I can fix this 
by registering but I am only 14 and don't really have that kind of money at 
hand.  Plus I'm really, really cheap.
    Is there another way to check out my programs when their not working?  I 
know there is trace but it traces some program that I have never seen 
before.  Could someone either:
1) Tell what exactly trace does & how to use it
                 or
2) Let me know of a different way to debug my programs

-Dan

new topic     » topic index » view message » categorize

2. Re: Need help debuggin

> Good Morning Everyone,
>     I am fairly new to programming in Euphoria, but for the most part it is 
> very user friendly.  I have just started to program in windows instead of 
> DOS because it appears to be much easier.  The only problem is that almost 
> with every program I run I get the "Your program exceeds 300 statements in 
> size and cannot provide run-time diagnostics."  I know that I can fix this 
> by registering but I am only 14 and don't really have that kind of money at 
> hand.  Plus I'm really, really cheap.
>     Is there another way to check out my programs when their not working?  I 
> know there is trace but it traces some program that I have never seen 
> before.  Could someone either:
> 1) Tell what exactly trace does & how to use it
>                  or
> 2) Let me know of a different way to debug my programs
>
> -Dan

You could use an older version of Win32Lib that's been stamped, this
means it doesn't count towards the 300-line limit. I think the last
version to be stamped was David Cuny's last solo release, this is
quite out of date now but you can still get it from the archives at:

It is quite possible to debug a 300 plus line program without the full
version (although it's still very nice to have:) use the ? statement
or the puts procedure to output markers, for example:

puts(1,"Declaring variables...\n") --DEBUG
atom a,b,c
puts(1,"Assigning values...\n") --DEBUG
a=0
b=1
puts(1,"Divding b by a..\n") --DEBUG
c=b/a --This will cause an error
puts(1,"All done!") --DEBUG


When tracing you can skip a procedure by pressing the down arrow
rather than enter, this way you don't need to trace into bits of code
you didn't write. Also you can put the "with trace" after the "include
win32lib.ew", this will stop it traceing into win32lib code.

Good luck with it :)

Thomas Parslow (PatRat) ICQ #:26359483
Rat Software
http://www.rat-software.com/
Please leave quoted text in place when replying

new topic     » goto parent     » topic index » view message » categorize

3. Re: Need help debuggin

Hi,
can I suggest that you do the following ...

a) Delete all the "with trace" lines from win32lib.ew
b) Insert a "without trace" immediately before the "include win32lib.ew"
c) Insert a "with trace" immediately after the "include win32lib.ew"
d) Insert "trace(1)" in your program at the place(s) you want to start
tracing,
e) Insert "trace(0)" where you want to stop tracing.

When the debug window starts, use "q" to quit tracing until the next
"trace(1)" line is encountered, use the down-arrow key to execute the
current line, use "Q" to quit tracing altogether (but continue running the
program) and use "!" to abort the program.

Note you can also do conditionally tracing by executing trace(1) inside an
"if" phrase.

Example....

without trace
include win32lib.ew
with trace
 . .
procedure onKeyPress_Field1(integer keycode, integer shifts)
  integer x, y

  if keycode = VT_RETURN then
      trace(1)
  end if

end procedure

-------------
cheers
Derek Parnell
Melbourne, Australia
"To finish a job quickly, go slower."

----- Original Message -----
From: <euprogramin at hotmail.com>
To: "EUforum" <EUforum at topica.com>
Sent: Sunday, March 04, 2001 2:45 AM
Subject: Need help debuggin


> Good Morning Everyone,
>     I am fairly new to programming in Euphoria, but for the most part it
is
> very user friendly.  I have just started to program in windows instead of
> DOS because it appears to be much easier.  The only problem is that almost
> with every program I run I get the "Your program exceeds 300 statements in
> size and cannot provide run-time diagnostics."  I know that I can fix this
> by registering but I am only 14 and don't really have that kind of money
at
> hand.  Plus I'm really, really cheap.
>     Is there another way to check out my programs when their not working?
I
> know there is trace but it traces some program that I have never seen
> before.  Could someone either:
> 1) Tell what exactly trace does & how to use it
>                  or
> 2) Let me know of a different way to debug my programs
>
> -Dan
>
>

new topic     » goto parent     » topic index » view message » categorize

4. Re: Need help debuggin

> Good Morning Everyone,

Heya Dan!


>     I am fairly new to programming in Euphoria, but for the most part it is 
> very user friendly.  I have just started to program in windows instead of 
> DOS because it appears to be much easier.

IMHO, Dan, I can say it is easier, but the trace in a console is a 
pain in the butt to work with (updates very slowly) :)

I, myself, haven't started really doing any programs in Euphoria, 
aside my try to make a card database out of RDS' Guru, and some 
other failed project I can't remember, until about September, when 
automagically I finally understood the language. (Haven't mastered it 
yet, but it shouldn't be too long) Maybe it's because of that beautiful 
lady in my life? Sure :)

> The only problem is that almost 
> with every program I run I get the "Your program exceeds 300 statements in 
> size and cannot provide run-time diagnostics."  I know that I can fix this 
> by registering but I am only 14 and don't really have that kind of money at 
> hand.  Plus I'm really, really cheap.

Give it time, Dan, and you will. You'll have the money sometime :)

Trust me, I'm gonna be on my way to registering the interpreter and 
Eu2C sometime here :)

Altho Rob, if I do, and you release something suddenly on me, I'm 
gonna telepathically poke your brain for doing it to me, because I'd 
have to pay for the update so soon too :)

>     Is there another way to check out my programs when their not working?  I 
> know there is trace but it traces some program that I have never seen 
> before.  Could someone either:
> 1) Tell what exactly trace does & how to use it
>                  or
> 2) Let me know of a different way to debug my programs

I think what you're getting a trace into is Win32lib.ew, which, I'll add, 
does have its 'with trace' statements splattered inside the file. Take 
your favorite editor, and do a massive "find and replace", for "with 
trace", replace it with nothing.

And, to trace well, you have to understand the flow of your program. 
If you see it happening when something happens, like you press a 
button, and something weird that you didn't want happens, obviously 
it's happening right when that button is pressed, in a procedure you 
wrapped the "onClick" to. And then you fix it, abort the program, and 
rerun it! :)

Have fun programming in Windows, Dan! :)

--"LEVIATHAN"

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu