[comp.sys.handhelds] Progamming Flags

salvato@ENUXHA.EAS.ASU.EDU (Vincent H. Salvato) (05/02/91)

     I have a question regarding writing a program to set or clear a flag	automatically.  I am going into third semester calculus and just got done with
second semester claculus in which the whole class uses HP48sx's.  We seem to	do a lot of calculations in which we either need a real number answer or a
symbolic answer.  I hate having to always check the modes menu and to see if	symbolic is on or not.  I want to write a program that if symbolic is on it
automaticaly turns it off and says "SYM OFF" and in turn if symbolic is already
off I want it to turn it on and say "SYM ON".  I have not written anything with	if statements or anything with some type of checker.  The flag settings for	symbolic is -3, -3 clear returns symbolic result, -3 set returns numeric resultsif anyone has any ideas pleas post or E-mail me.

			-Vince
			-salvato@enuxha.eas.asu.edu

bson@rice-chex.ai.mit.edu (Jan Brittenson) (05/03/91)

In a posting of [2 May 91 14:44:20 GMT]
   salvato@enuxha.eas.asu.edu (Vincent H. Salvato) writes:

 > I want to write a program that if symbolic is on it automaticaly turns
 > it off and says "SYM OFF" and in turn if symbolic is already off I
 > want it to turn it on and say "SYM ON".

One possible solution (67.5 bytes):

	<< "SYM O" 1 FS?C "FF" << 1 SF "N" >> IFTE + 1 DISP 1 FREEZE >>


Of course, if you compromise your demands, it can be reduced:

	<< 1 FS?C "NUM" << 1 SF "SYM" >> IFTE 1 DISP 1 FREEZE >>

The latter will say "NUM" or "SYM". It's 61 bytes.

						-- Jan Brittenson
						   bson@ai.mit.edu

JMEYERS@MTUS5.BITNET (05/03/91)

In article <9105021444.AA14927@enuxha.eas.asu.edu>, salvato@ENUXHA.EAS.ASU.EDU
(Vincent H. Salvato) says:
>
>     I have a question regarding writing a program to set or clear a flag
>automatically.  I am going into third semester calculus an
>second semester claculus in which the whole class uses HP48sx's.  We seem to
>do
>a lot of calculations in which we either need a real
>symbolic answer.  I hate having to always check the modes menu and to see if
>symbolic is on or not.  I want to write a program that
>automaticaly turns it off and says "SYM OFF" and in turn if symbolic is
>already
>off I want it to turn it on and say "SYM ON".  I have not written anything
>with
>if statements or anything with some type of checker.
>
>                        -Vince
>                        -salvato@enuxha.eas.asu.edu

I had a little difficulty reading your file since you didn't include any
CR/LF.  However, I think that the following programm will do what you
want it to do.  I have hand typed it in so it is NOT in a down loadable
format!  This shouldn't be a problem since it is small.

<<  IF -3 SF?
    THEN -3 CF "SYM ON"
    ELSE -3 SF "SYM OFF"
    END 1 DISP 1 WAIT
>>

I named the program TSYM to stand for Toggle SYMbolic results.
If this isn't what you were looking for then please repost your
request with CR/LF inserted after about every 70 characters.  Most
systems don't allow more than 80 characters per line.
Sincerely,
Jason P. Meyers

 /========================= /========================================
| JMEYERS@mtus5.cts.mtu.edu |                                          |
|            or             | H   H PPPP        44   888   SSS  X   X  |
|   JMEYERS@MTUS5.BITNET    | H   H P   P      4 4  8   8 S      X X   |
|    HP-48 list owner       | HHHHH PPPP  ==  4  4   888   SSS    X    |
 >-------------------------<  H   H P        444444 8   8     S  X X   |
|   Michigan Technological  | H   H P            4   888   SSS  X   X  |
|        University         |                                          |
 =========================/ ========================================/

jurjen@cwi.nl (Jurjen NE Bos) (05/03/91)

[about setting and checking the symbolic results flag...]

There is also Bill Wickes' modebrowser, that is posted here recently.  This
nice little program gives you an overview off all flags.  It can give flag
numbers and toggle flags.  Check out your BBS around the corner.  (Sorry, I
don't have it on line :-( )

JMEYERS@MTUS5.BITNET (05/05/91)

In article <15533@life.ai.mit.edu>, bson@rice-chex.ai.mit.edu (Jan Brittenson)
says:
>
>In a posting of [2 May 91 14:44:20 GMT]
>   salvato@enuxha.eas.asu.edu (Vincent H. Salvato) writes:
>
> > I want to write a program that if symbolic is on it automaticaly turns
> > it off and says "SYM OFF" and in turn if symbolic is already off I
> > want it to turn it on and say "SYM ON".
>
>One possible solution (67.5 bytes):
>
>        << "SYM O" 1 FS?C "FF" << 1 SF "N" >> IFTE + 1 DISP 1 FREEZE >>
>
>
>Of course, if you compromise your demands, it can be reduced:
>
>        << 1 FS?C "NUM" << 1 SF "SYM" >> IFTE 1 DISP 1 FREEZE >>
>
>The latter will say "NUM" or "SYM". It's 61 bytes.
>
>                                                -- Jan Brittenson
>                                                   bson@ai.mit.edu

The problem with these programs is that they test the wrong flag.  You
want to test flag -3.  1 is a user flag (ie it does nothing).  Flag
-3 determines the status of symbolic vs. numerica results.
Sincerely,
Jason P. Meyers

 /========================= /========================================
| JMEYERS@mtus5.cts.mtu.edu |                                          |
|            or             | H   H PPPP        44   888   SSS  X   X  |
|   JMEYERS@MTUS5.BITNET    | H   H P   P      4 4  8   8 S      X X   |
|    HP-48 list owner       | HHHHH PPPP  ==  4  4   888   SSS    X    |
 >-------------------------<  H   H P        444444 8   8     S  X X   |
|   Michigan Technological  | H   H P            4   888   SSS  X   X  |
|        University         |                                          |
 =========================/ ========================================/

bson@rice-chex.ai.mit.edu (Jan Brittenson) (05/05/91)

In a posting of [4 May 91 17:04:12 GMT]
   JMEYERS@MTUS5.BITNET writes:

 > The problem with these programs is that they test the wrong flag.  You
 > want to test flag -3.  1 is a user flag (ie it does nothing).  Flag
 > -3 determines the status of symbolic vs. numerica results.

   Oops. I used flag 1 to test it and forgot to replace it with -3 for
the posting. Clumsy.

						-- Jan Brittenson
						   bson@ai.mit.edu