1. regarde et apprend, watch and listen

I have comments below, but first...

function ltrim(sequence string)
    if string[1] =3D ' ' then string =3D string[2..length(string)]
        else return string
    end if
    ltrim(string)
end function

function rtrim(sequence string)
    if string[length(string)] =3D ' ' then
    string =3D string[1..length(string)-1]
        else return string
    end if
    ltrim(string)
end function

Euphoria is good.  Just ask, I was put in awe at first because I thought
Euphoria couldn't do something, but its always proven me wrong.  In QBasi=
c,
Q stands for Quirk.  QuirkBasic has many quirks.  I'm taking a high schoo=
l
class on it, so I should know.  Look at the for...next loops and variable=

initializations, to name a few.  I'm not saying Euphoria is perfect,
absolutely not.  But its better than QBasic.

--Alan
  =

new topic     » topic index » view message » categorize

2. Re: regarde et apprend, watch and listen

how come Euphoria programmer absolutely HATE basic??? basic lets you do
lots of things. Look:

object command
command=command_line()
command=command[3]

if nothing was typed at the command line, then you get an error message.
in quickbasic, command$ returns "". No errors at all. But Euphoria can
check multiple parameters, but quickbasic can't. so they both have their
share of quirks.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

3. Re: regarde et apprend, watch and listen

Hi,

-----Original Message-----
From: Matt Z Nunyabidness <matt1421 at JUNO.COM>
To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU>
Date: Saturday, September 19, 1998 12:52 PM
Subject: Re: regarde et apprend, watch and listen


>how come Euphoria programmer absolutely HATE basic??? basic lets you do
>lots of things. Look:


I don't hate Basic. I make a good living programming in it. I *hate* C.

Euporia has a great syntax and is very flexible. That's what I love about
it.

I would really like to see a better way to trap errors better than just
crashing. Of course some things should bomb out, but I like to be able to
trap for some things. (Mainly in Windows programming)

Strutures for Windows API programming would be great too.

(Probably get lots of flames, but it's just IMHO)

Regards,
Greg Harris
HHS

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

4. Re: regarde et apprend, watch and listen

>how come Euphoria programmer absolutely HATE basic??? basic lets you do
>lots of things. Look:

Why do we hate basic ?
The best reason is it eats out of your brain, and makes you think weird dumb
silly things..
Just consider the problems you've been having with Euphoria.. you were
trying to solve things the basic-way.. while in euphoria you have a few
small powerfull tools, which you can use to make your own solution to
problems, instead of using a specific function or routine.. (something you
were automatically looking for.. as an example of how basic corrupts a
mind).. no offense, we've all been there.. but try not to think in Basic..
or compare euphoria to basic..

Its not just euphorians, c programmers also, or to put it differently: any
professional programmer, and about half (upper half) of the hobbiests..
Meet the world.. any hobbist spending more than half an hour a day to
programming either hates basic or has no other programming language
available for his use.

(the above statements exclude visual basic, which due to its nice GUI-design
interface, still beats Euphoria win32.. face it.. basic sux, but Eu-win32
doesnt even exist for real)

And now this:

>object command
>command=command_line()
>command=command[3]
>
>if nothing was typed at the command line, then you get an error message.
>in quickbasic, command$ returns "". No errors at all. But Euphoria can
>check multiple parameters, but quickbasic can't. so they both have their
>share of quirks.


You totally missed the point. This is one of the example, why Euphoria rules
over Basic:
Basic lets all the argument parsing up to you.

If you would do: mid$ (command$ (), 1, len(command$)) it will also crash
basic.
You comparing to completely different things.

Try making a safe example program of echo the number of arguments passes:
example: myprog bla bla
Prints "2"

Try making this in basic, and euphoria, and both need to work 100% safe..
Compare the code for each.. I rest my case..


Plus, btw..  your program above asumes some1 at least gave three arguments..
thats why things went wrong.. compare it to this basic statement:

print mid$ ( command$ , 1, 12)

It assumes a minimum of 12 character long command$.. and will crash as
well..
In other words.. what is your point ?

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

5. Re: regarde et apprend, watch and listen

besides, my goal is to be multilingual, even though i may forget BASIC.
Shameful, I get so good at it, then Euphoria sidetracks me and i forget
the language i love.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

6. Re: regarde et apprend, watch and listen

i want to see an example of save_text_image to save a snapshot of the
screen, save the resulting sequence into a file, and use another program
to bring it back. I tried that, but in the process of displaying it with
display_text_image, Euphoria says something about not defining the length
of an atom. I think it reads: "Length of atom not defined".

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

7. Re: regarde et apprend, watch and listen

the first two arguments are always filled with SOMETHING. when a program
is not bound, command() passes:
{"ex",
 "myprog.ex",
 "blah",
 "blah",
 "blah"}

When you bind it, it reads:
{"myprog", --replaces ex.exe
 "myprog",
 "blah",
 "blah",
 "blah"}

Suppose this is what command() looks like:

{"ex", "myprog.ex"}
And you try to read from the third argument where the stuff you supply on
the command line starts, but nothing is there. You get an error from
Euphoria. Btw, i'm a former BASIC programmer that's fed up with the way
Euphoria sometimes just won't do what i tell it to.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

8. Re: regarde et apprend, watch and listen

>>>>>
{"ex", "myprog.ex"}
And you try to read from the third argument where the stuff you supply on=

the command line starts, but nothing is there. You get an error from
Euphoria. =

<<<<<

Well, its not there.  Do you want a programming language to just make up
stuff?  That's what Basic does with initialization.  And by the way, do y=
ou
know how Basic handles the counter in a for loop?  How about that for a
quirk!

--Alan
 =

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

9. Re: regarde et apprend, watch and listen

>>>>>
besides, my goal is to be multilingual, even though i may forget BASIC.
Shameful, I get so good at it, then Euphoria sidetracks me and i forget
the language i love.
<<<<<

Being multi-linqual is good.  That's my goal as well.  But let me ask you=
=2E =

Do you really want to remember all those reserved strings, like inkey$, f=
or
the rest of your life?  I encourage you to use the best programming
language for the task.  Sometimes it'll be Basic, sometimes it'll be
Euphoria.

My problem with Basic is that it has too many functions, statements,
keywords.  Do you know how many of those I know how to use?  less than 10=
%,
I'd bet.  But I have the capacity to use the language definition of
Euphoria, because I know it all.  Now, what about the 133 library routine=
s?

command_line()
clear_screen()
time()
tick_rate()
sound()
set_rand()
rand()
sin()
cos()
tan()
puts()
print()
?
close()
where()
seek()
trace()

Well, that's more than 10% of the nitty-gritty routines already.  Some
things, though are difficult to do in Euphoria.

QBASIC

sound 5000, 18.2
sleep 1
sound 5000, 18.2

In Euphoria, I have to hop, skip, and jump to do that.  So I say again, u=
se
the best language for the situation.

--Alan
 =

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

10. Re: regarde et apprend, watch and listen

------=_NextPart_000_0052_01BDE43D.E9B47E20
        charset="iso-8859-1"



>i want to see an example of save_text_image to save a snapshot of the
>screen, save the resulting sequence into a file, and use another program
>to bring it back. I tried that, but in the process of displaying it with
>display_text_image, Euphoria says something about not defining the length
>of an atom. I think it reads: "Length of atom not defined".


Two, very clean, easy to understand, programs are attached.
One saves the image, the other loads it back up and shows it.

If the filename is not given as an argument, it is prompted for.
We'll be using Jiri's trim function (mine only handles spaces) to clean up
the filename.

We'll be using standard I/O to save and store whole euphoria objects.
The program looks big, but thats just because this is the cleanest best,
approuch.
It could have been done in 5 lines, I guess.

Anyways, I hope these will help you..

Ralf Nieuwenhuijsen


------=_NextPart_000_0052_01BDE43D.E9B47E20
        name="txtshow.ex"

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

11. Re: regarde et apprend, watch and listen

thx a bazillion!

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

12. Re: regarde et apprend, watch and listen

in Euphoria you have to have a sound statement in a for loop, other wise
the sound you're making will never end.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

13. Re: regarde et apprend, watch and listen

there's nothing wrong with the way BASIC handles a FOR loop. As a matter
of fact, I was never able to get the by thing to work in a for look in
Euphoria.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

14. Re: regarde et apprend, watch and listen

Just one thing. I needed a program that reads a sequence made by
save_text_image from a file, and then uses display_text_image to use it.
BTW, i accidentally deleted your message, can you resend it? I'm clumsy
after 11 pm.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

15. Re: regarde et apprend, watch and listen

Alan Tu wrote:
> QBASIC
> sound 5000, 18.2
> sleep 1
> sound 5000, 18.2
> In Euphoria, I have to hop, skip, and jump to do that.

procedure sleep(atom seconds)
atom stop
   stop = time() + seconds
   while time() < stop do --SomeSnoring(TakeANap & GoNiteyNite)
   end while
end procedure

procedure beep(atom freq, atom duration)
   sound(freq)
   sleep(duration/18.2)
   sound(0)
end procedure

beep(5000,18.2)
sleep(1)
beep(5000,18.2)

now you don't have to hop, skip or jump.  you have QBasic commands now,
with a very minor difference of "beep" versus "sound".

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

16. Re: regarde et apprend, watch and listen

>there's nothing wrong with the way BASIC handles a FOR loop.

BASIC:

for i =3D 1 to 5
    print i
next i
print i

I can tell you that I believed the last statement would print 5.  First, =
i
should be local to the loop, as Euphoria does.  But the last statement
prints 6!

--Alan
 =

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

17. Re: regarde et apprend, watch and listen

Hi, Hawke!

>procedure sleep(atom seconds)

I know how to do it, with all due respect.  Now which is shorter and
"easier".  Like I said, its a skip and a hop.

--Alan
 =

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

18. Re: regarde et apprend, watch and listen

Matt Z Nunyabidness wrote:
>As a matter of fact, I was never able to get the by
>thing to work in a for look in Euphoria.

tis not so hard...

for number = 0 to 50 by 5 do
   printf(1,"%d ",number)
end for

-----output
0 5 10 15 20 25 30 35 40 45 50

simple, no?

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

19. Re: regarde et apprend, watch and listen

i meant a loop that counts down, like in BASIC.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

20. Re: regarde et apprend, watch and listen

Matt, Matt, and Matt

This works.  I know because I just finished a program on it.  It counts
down from 5 to 1, then stops for 60 seconds.  ie.

snippet from pulse.ex
for i =3D 5 to 1 by -1 do
    machine_proc(1,7500)
    t =3D time() + 0.1
    while time() < t do
    end while
    machine_proc(1,0)
    t =3D time() + 0.9
    while time() < t do
    end while
end for

Don't worry about whats in the for.   Its unconventional for Euphoria, bu=
t
I used it to avoid includes for speed.  Its not what one should write in
normal cases.

--Alan
 =

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

21. Re: regarde et apprend, watch and listen

for x = 100 to 10 by -10 do
printf(1,"%d ",x)
end for

prints: 100 90 80 70 60 50 40 30 20 10

Gosh, how complicated!

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

22. Re: regarde et apprend, watch and listen

------=_NextPart_000_0041_01BDE4DA.B63D0E20
        charset="iso-8859-1"



>Just one thing. I needed a program that reads a sequence made by
>save_text_image from a file, and then uses display_text_image to use it.
>BTW, i accidentally deleted your message, can you resend it? I'm clumsy
>after 11 pm.

Voila txtstore.ex and txtshow.ex again.
Have a look at source code instead of just use it, it contains many trivial
euphoria trickies.

Ralf

------=_NextPart_000_0041_01BDE4DA.B63D0E20
        name="txtstore.ex"

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

23. Re: regarde et apprend, watch and listen

i already made a program called camera. but thanx for txtshow.ex.

_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

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

Search



Quick Links

User menu

Not signed in.

Misc Menu