Re: Coming From QBasic
- Posted by don cole <doncole at pacbell.net> Jan 16, 2006
- 530 views
Lynn Kilroy wrote: > > Does the Global function thingy have to be included in the main body of the= > Not necessarly but it has to be declared before it is called. > code, even if the function is in an included file? And how about the > subroutines? How do I call them? > > Love & Friendship & Blessed Be! > Lynn Erika Kilroy Don Cole A Bug is an un-documented feature. A Feature is a documented Bug. > > > >From: "D. Newhall" <guest at RapidEuphoria.com> > >Reply-To: EUforum at topica.com > >To: EUforum at topica.com > >Subject: Re: Coming From QBasic > >Date: Sat, 14 Jan 2006 14:34:21 -0800 > > > > > >posted by: D. Newhall <derek_newhall at yahoo.com> > > > >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 cal= > l > > > is purdy simple: > >(snip) > > > >To move stuff between includes you need to declare it as global like so: > > > >global integer index > > > >global function do_stuff() > > ... > >end function > > > >it also has to be declared as such before you use it no matter which file= > > >it is in. > > > >However, there is no call-by-reference in Euphoria so certain things like= > > >the inkey example will not work (I think my QB is rusty). Stuff like "Inpu= > t > >ans$" would be used in Euphoria as "ans = input()". > > > >There's also a QBasic to Euphoria translator in the Archive. > >=20=20 > ><a > >href="http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=o=">http://www.rapideuphoria.com/cgi-bin/asearch.exu?dos=on&win=on&lnx=o=</a> > n&gen=on&keywords=qbasic > > > > > > > Speaking of Screen Modes, one of my programs uses a Screen Mode about > > > which I can find no information in Euphoria Documentation available to > > > me. I use the QBASIC command > >(snip) > > > >Check the documnetation on graphics ans sound and the graphics.e include= > > >file. I think the routines you want are graphics_mode() and/or > >video_config(). > > > > > 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 hav= > e > > > 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 bugger= > y > > > errors. > > > >Euphoria is certainly a good replacement (I use in place of all the stuff = > I > >used QBasic for both professionally and privately). However, certain thing= > s > >aren't as easy but in the long run are more powerful and flexible (I > >think). Also, Euphoria is constantly improved and MUCH faster than QBasic= > > >(the Euphoria interpreter beats some compiled QBasic programs). > > > > > > > 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 m= > y > > > QBasic Programs in such a format that people don't have to download a Q= > B > > > 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 m= > y > > > source code {which I make available under GPL, but still, the compiled > > > version preserves my status as original author on the original code}. > > > >There is a free version of the C translator that has a notice saying it's= > > >unregistered that you could use. Also, there are free Windows C compilers.= > > >Open Watcom (<a > >href="http://www.openwatcom.org">http://www.openwatcom.org</a>) is one which I > >highly recommend. > > > > > >The Euphoria Standard Library project : > > <a href="http://esl.sourceforge.net/">http://esl.sourceforge.net/</a> > >The Euphoria Standard Library mailing list : > > <a > > href="https://lists.sourceforge.net/lists/listinfo/esl-discussion">https://lists.sourceforge.net/lists/listinfo/esl-discussion</a> > > > > <snip>