50g group photo

Yahoo Groups archive

50g

Archive for 50g.

Index last updated: 2026-03-30 00:59 UTC

Message

Re: [50g] Re: Can someone answer a question about program sub-routines

2009-07-06 by Don Hart

> You're talking about subroutines and I'm talking about taking part of a
> program and pasting into another without using one.

So you want to do the cut/paste while YOU are editing the program and not make the program do the cut/paste? Did you even try looking it up? See page 2-26 (page 80 in Adobe reader) of the 49g manual I uploaded at drop.io

> So, can I put a directory on the first level and have all my subroutines
> found in that directory?

Yes, as long as you make subdirectories off of that directory where your programs reside. Or you can use ORDER to make main program one of the first ones in the soft menu thus making it easier to find. The only thing ORDER does is rearrange the order of what you see in the soft menus. You do have soft menus turned on (set flag -117)?

> I don't understand why you think that I think that I have to delete the
> subroutines when using the CASE construct.

Because you said..
> Not to mention that you have to purge them all if you plan
> to use them with a CASE statement as objects to be evaluated...

I'm not following what you're doing with CHOOSE box & CASE. And I've never used a CHOOSE box, so someone else will have to chime in.

> It doesn't matter how long a subroutine is or how many times you call it
> into the main program. The only way that would be a problem is if your
> calculator is lacking memory...

One of the major reasons for using a subroutine is to prevent bloated code. But once you see how to do cut/paste, you can knock yourself out writing all the bloated code you want.

--- On Sun, 7/5/09, rickwendel763242 <rickwendel763242@...> wrote:

> From: rickwendel763242 <rickwendel763242@...>
> Subject: [50g] Re: Can someone answer a question about program sub-routines
> To: 50g@yahoogroups.com
> Date: Sunday, July 5, 2009, 12:42 AM
> You're talking about subroutines and
> I'm talking about taking part of a program and pasting into
> another without using one.  I didn't know that it
> looked for subroutines in the directory you're in, and then
> looked for them in directories above that one.  So,
> they have it set up so that your subroutines can share the
> main programs directory and any above it.  Wow, that's
> pretty ingenious and good to no.  I would prefer to
> just use subroutines but it's kind of retarded having your
> programs look for them in directories above the current
> one.  I can't store 20 subroutines in the same program
> directory as the main programs directory.  So, can I
> put a directory on the first level and have all my
> subroutines found in that directory? That would make a
> little sense or do I have to use the ORDER command somehow
> to get it to find the special subroutine directory?  I
> don't understand why you think that I think that I have to
> delete the subroutines when using the CASE construct. 
> I've initialized the names used in a CHOOSE box with
> integers corresponding to the number of statements in the
> choose box so that I can direct each to a specific CASE
> number then at the end of the program I've PURGEd the names
> that got used as objects in CHOOSE box.  That's the
> only way I could figure out how to get the CHOOSE box to go
> to a specific CASE number.  I'm definitely not going to
> use that retarded INPUT statement to enter my data. 
> You shouldn't have to PURGE any variables if you use
> compiled variables.  I haven't tried doing that yet,
> have you?  So evidentially you've never heard of anyone
> being able to cut and paste parts of a program into
> another.  Is that true?  I don't see how copying
> something could be classified as self-modifying a
> program.  You can do it in any other programming
> language.  It doesn't matter how long a subroutine is
> or how many times you call it into the main program. 
> The only way that would be a problem is if your calculator
> is lacking memory and that can be remedied by simply getting
> an SD card formatted in FAT12 about 512K or so.  I
> don't think the calculator can do much with anything above
> 512k to 1 Meg but I'm not totally for sure on that. 
> Why are you so hung up on memory usage?  Is someone
> going to spank you, if you use memory unwisely or
> something?  I'm trying to write a stupid program that
> works.  I don't care if Billy Bob at the CNC shop is
> psychotic or not and keeping a tally of unnecessary
> commands. 
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>     mailto:50g-fullfeatured@yahoogroups.com
>
>
>

Attachments