Re: Coming From QBasic

new topic     » goto parent     » topic index » view thread      » older message » newer message

Lynn Kilroy wrote:
> 
> My biggest curiousity is how do I get it to use subs in Included files?  
> I type the include file line.  It accepts that fine.  Then I try to get 
> it to do the screen mode thing, and that it doesn't seem to do so well.  
> Also, if it's a one-line sub, perhaps I can just plug the line in to my 
> code without the rest of the sub?  One line subs only make sense to me 
> if they are a sub that's called often and by many different routines, 
> and I want it to look purdy instead of using the languages default 
> command synstax.  An example from QBasic is my Inkey routine.  It's call 
> is purdy simple:
> 
> > Inkey a
> 
> -where a is the name of a string variable.
> 
> I use Inkey as a subroutine because I think a = INKEY$ is purdy ugly, so 
> I stuck the command in a subroutine so in my program, I need only a = 
> INKEY$ once.  The rest of the time, it's Inkey a.
> 
> This demonstrates some of my confusion, actually, and from whence it 
> stemms.  Euphoria was defined as an easy language to use.  Defined as 
> even easier to use than QBasic, it seemed to imply.  I figured then it 
> should be pretty easy to begin playing with it.  But there seems to be a 
> few things it's conspicuously missing.
> 
> In the instance above, a subroutine is defined by a DECLARE SUB 
> statement, with variables to pass to it defined after.
> 
> > DECLARE SUB Inkey (a AS STRING)
> 
> The sub is delineated by SUB ... END SUB.
> 
> > SUB Inkey (a AS STRING)
> >
> >  a = INKEY$
> >
> > END SUB
> 
> The subroutine name then becomes a KEYWORD.
> 
> > DIM a AS STRING
> >
> > WHILE a <> CHR$(27)
> >
> >  Inkey a
> >
> > WEND
> 
> This is pretty simple.  Now how do I do this in Euphoria?

This is very simple. But I really think you need to look at the Euphoria
Reference Manual. It is included with your Euphoria download as well as being
available on the RDS website at http://www.rapideuphoria.com/refman.htm
and this file will answer most of your questions here, including the ones
referring how to use graphics.

Also look for A Beginner's Guide to Euphoria
http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=on&gen=on&keywords=abgte
its kind of old (and I haven't looked at it in awhile) but I think that its
pretty good.

<snip graphics questions -- see reference manual>

> Basically, what I'm looking for is something with the flexibility and 
> ease of use of QBasic but for more modern programming environments.  
> Euphoria looks like it might be able to fill the bill, but first, I have 
> to understand the very basic differences between it and QB.  I don't 
> mean the technical stuff like variable groups and nests and stuff {all 
> that's kind of neat, though, and part of my attraction to the language}, 
> but the basic syntax and use of the language, and perhaps help in 
> handling graphics with the simplicity of QB, but without all the buggery 
> errors.
> 
> Another thing ...  I have a QB Compiler.  From what I saw in the 
> documentations, there is no Euphoria Compiler.  This is something of a 
> drawback to me.  I can purchase a Euphoria binder program, I can even 
> purchase a Euphoria to C translater.  But no Euphoria direct to 
> Executable Compiler.  I imagine this is not a problem with Linux, but 
> with Windows, it becomes a problem that is really quite large.  From 
> what I can see, there are no free c compilers for Windows.  This means 
> that no matter the cost of the binder and translator, the overall cost 
> of Euphoria for the programmer is still prohibitively expensive.  Sure, 
> QB is old, and yes, it's very limited.  But at least I can distribute my 
> QBasic Programs in such a format that people don't have to download a QB 
> interpreter to use them, or, worse, purchase a $500.00 program in order 
> to compile it and use it.  Nor do I have to risk the uncredited theft my 
> source code {which I make available under GPL, but still, the compiled 
> version preserves my status as original author on the original code}.
> 
> Love & Friendship & Blessed Be!
> Lynn Erika Kilroy
> 
> 

The Euphoria to C translator comes with Euphoria. And yes, there are free C
compilers for DOS/Windows. See http://www.rapideuphoria.com/e2c.htm for more
info.

But even if you don't bind or translate your programs, you can still distribute
the interpreter with your program. It's not that big, about 244 KB for the DOS
interpreter. Plus your include files. Shouldn't be a problem for smaller
projects.

Hope that helps.


--
"Actually, I'm sitting on my butt staring at a computer screen."
                                                  - Tom Tomorrow

j.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu