Post Reply 
Setting calculator's auto shutoff
01-06-2015, 08:25 AM (This post was last modified: 01-06-2015 09:26 AM by Thomas_Sch.)
Post: #5
RE: Setting calculator's auto shutoff
(01-06-2015 01:06 AM)rprosperi Wrote:  When copying the source text, I get some invalid characters in the first line below the initial comment that begins //TF = readout catual...
Line 21 just below reads:
TF:=(B→R(TOff)/60000); (cannot paste exact same chars here)
...
The source code file is (should be) encoded in UTF-8.
Please try to change the encoding in your editor before copying.

Maybe Wolfgang can provide the source in a code block.

Thomas
Code:

#pragma mode( separator(.,;) integer(h32) )

EXPORT TOFF()
// Firmware 6975
// integer systems settings are not recommended
// Number Format: Standard
// Setting the auto shutoff system-variable TOff
// limits are set between 1 minute and 60 minutes
// Softmenu with 5 soft buttons
// selectable increment and decrement steps 
// steps of 1, 2, 5, 0.5 minutes
// WMWK 2015-01-05 Versin 0.97
// wolfgang.kuehn@vodafone.de

BEGIN

  LOCAL m,m1,mx,my,TF, TMul;
  RECT();
 
  //TF = readout catual TOff in minutes 
  TF:=(B→R(TOff)/60000);
  TEXTOUT_P("Setting Calculator's auto shutoff V 0.97",26,1,3);
  TEXTOUT_P("TOFF = ",26,50,2);
  // actual TOff
  // actual TOff in minutes
  TEXTOUT_P(B→R(TOff)/60000,65,50,2);
  TEXTOUT_P("min", 95,50,2);
  //actual TOff hex
  // 
  TEXTOUT_P(R→B(TF*60000,32,4)+"    ",139,50,2,#000000,100,#FFFFFF);
  //actual TOff decimal
  TEXTOUT_P(R→B(TF*60000,32,3)+"    ",229,50,2,#000000,100,#FFFFFF);

  // Softmenu 5 buttons
  DRAWMENU("TOff +","TOff -","SET","TOff *","BYE");
  //Multiplier incr / decr
   TMul:=1;
     
//outer loop 
While Z <= 9999 DO
 WHILE MOUSE(1)>=0 DO   END;
//inner loop
    REPEAT
      m:=MOUSE;
      m1:=m(1);
    UNTIL SIZE(m1)>0;
      
    mx:=m1(1);
    my:=m1(2);

    // query softbuttons
    IF my>=220 AND my<=239 THEN

    // menu button 1
      IF mx>=0 AND mx<=51 THEN
        TF:=TF+1*TMul;
        IF TF>60 THEN TF:=60; END; 

        TEXTOUT_P(TF+"   ",65,50,2,#000000,30,#FFFFFF);
        TEXTOUT_P(R→B(TF*60000,32,4)+"    ",139,50,2,#000000,140,#FFFFFF);
        TEXTOUT_P(R→B(TF*60000,32,3)+"    ",229,50,2,#000000,100,#FFFFFF);
      END;
      // menu button 2
      IF mx>=53 AND mx<=104 THEN
        TF:=TF-1*TMul;
        IF TF < 1 THEN TF:=1; END;

        TEXTOUT_P(TF+"   ",65,50,2,#000000,30,#FFFFFF);
        TEXTOUT_P(R→B(TF*60000,32,4)+"    ",139,50,2,#000000,140,#FFFFFF);
        TEXTOUT_P(R→B(TF*60000,32,3)+"    ",229,50,2,#000000,100,#FFFFFF);
      END;
       // menu button 3
      IF mx>=106 AND mx<=157 THEN
        TOff:=R→B(TF*60000);
        TEXTOUT_P("TOff set",112,205,1,#000000,50,#FFFFFF);
      END;     
       // menu button 4
       IF mx>=159 AND mx<=210 THEN
            CASE
                    IF TMul=1 THEN TMul:=2;END;
                    IF TMul=2 THEN TMul:=5;END;
                    IF TMul=5 THEN TMul:=0.5;END;
                    IF TMul=0.5 THEN TMul:=1;END;
             END;

                    TEXTOUT_P("TMul = "+TMul+"    ", 164,205,1,#000000,50,#FFFFFF);

      END;

        // menu button 5
       IF mx>=212 AND mx<=263 THEN
        RETURN;
      END;
// inner loop
  END;
// outer loop
END;
END;
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Setting calculator's auto shutoff - Thomas_Sch - 01-06-2015 08:25 AM



User(s) browsing this thread: 1 Guest(s)