Re: Coming From QBasic
- Posted by "Lynn Kilroy" <leks_transportation at hotmail.com> Jan 17, 2006
- 532 views
The Inkey routine was an example of a subroutine I use a lot. It's pretty= basic, so it was a suitable example. And I never use GOTO, GOSUB, nor RETURN. I use DECLARE SUB, SUB ... END SUB. It looks exactly like your= Procedure thingy, except it uses the word SUB. I can't remember what that= other language called them. But it's all the same. The problem I've been running in to is rather simple. I say 'Include Graphics.E' It says 'Okay.' I say 'Graphics_Mode(260)' It says something= about Graphics_Mode {a subroutine graphics.e} is not defined or something t= o that affect. The include statement as first. Include always comes first.= =20=20 Oddly, I don't like it in QB, because I tend to like dabbling with my subroutines. {Blushes} There also seems to be these kinds of little quirks= that I run in to, too. {Blushes more} Love & Friendship & Blessed Be! Lynn Erika Kilroy >From: don cole <guest at RapidEuphoria.com> >Reply-To: EUforum at topica.com >To: EUforum at topica.com >Subject: Re: Coming From QBasic >Date: Mon, 16 Jan 2006 10:03:05 -0800 > > >posted by: don cole <doncole at pacbell.net> > >Lynn Kilroy wrote: > > > > Would it be possible to rename these functions? I assume they're >function,= > > > > Yes as long as they haven't been declared in the standard Euphoria >functions. > Don't worry if they have you will get a namesake error. > > >Hello Lynn, > >As Chris says the closest thing to subrounts in Euphoria >are functions and procedures. > >Actually procedure is the same as subroute. > >And function is the same as procedure except that it returns something. >Forget about goto. > >}}} <eucode> >procedure print_my_name() >puts(1,"Lynn") >end procedure > >function get_name_length(sequence name) > retiurn length(name) >end function > >----program >integer a >print_my_name() >printf(1,"my name is %d letters long",get_name_length("Lynn")) > ></eucode> {{{ > >You may notice that Euphoria comes with many standard include files such a= s >get.e. >You may write your own function and procedure and put them in your own >include >file. > >--file myget.e > You could put the above function and procedure in that file, > And put file in with the standard includes. > From then on to use them in your program just put at the begining of you= r >program. >include myget.e > >I hope this is helpful. >I know I switch to Euphoria from Liberty Basic so long ago I forgot what >Inkey$ is exactlly. > >I switch mostly because of speed. > >Don Cole > > > >