home *** CD-ROM | disk | FTP | other *** search
/ Megazine / Megazine-1.iso / PROGRAMA / CLIPPER / CALC223 / DEMO.PRG < prev    next >
Encoding:
Text File  |  1994-01-23  |  4.2 KB  |  151 lines

  1.  
  2. /* Simple Demo of Calculator 1.5
  3.  
  4.    Compile using RT.BAT for RTLINK or
  5.               BLINK.BAT for BLINKER
  6.  
  7.    Manually:
  8.              Clipper DEMO /n/w
  9.  
  10.              Blinker fi DEMO lib CALC
  11.           or RTLink  fi DEMO lib CALC
  12.  
  13. */
  14.  
  15. #define F_BLOCKS  "█▀███▄██ "
  16.  
  17. #command CLS [with <char>] [color <color>]  ;
  18.       => @ 0,0,MaxRow(),MaxCol() Box If(<.char.>,Repl(<char>,9),"         ") ;
  19.          [Color <color>]
  20.  
  21.  
  22. #include "inkey.ch"
  23.  
  24. #stdout
  25. #stdout Remember to LINK with the appropriate mouse object file:
  26. #stdout  FUNMOUSE for FunckyII, DCLMOUSE for dClip, NANMOUSE for NANFOR,
  27. #stdout  or NOMOUSE for none (this is the LIBRARY default)!
  28. #stdout
  29.  
  30. Function Demo()
  31. Local aColor, nVar1, nVar2, cVar1, GetList:={}
  32.  
  33.  
  34.    CalcReg(00000)                //insert your reg. no. here
  35.  
  36.  
  37.    SET KEY K_F5 TO CALCULATOR    //it's as easy as this!
  38.  
  39.  
  40.    //Set Environment
  41.    Set Scoreboard OFF
  42.    Set Confirm ON
  43.  
  44.    //Check Color
  45.    If IsColor()
  46.       aColor := {"W+/B,W/R,,,W/R","W/R","W/B,W/R,,,W/B","+W*/B"}
  47.    Else
  48.       aColor := {"W/N,N/W,,,W/N","N/W","W/N,N/W,,,W/N","N*/W"}
  49.    Endif
  50.  
  51.    //Setup Screen
  52.    SetMode(25,80)
  53.    SetColor(aColor[1])
  54.    CLS with "▒" Color "W/N"
  55.    @ 0,0,MaxRow(),52 Box F_BLOCKS
  56.  
  57.    //Setup Values
  58.    nVar1 := 1
  59.    nVar2 := 1.23
  60.  
  61.    cVar1 := Space(10)
  62.  
  63.    @ 9,2 Say "      Integer Test:"
  64.    @ 9,22 Get nVar1 Color aColor[3]
  65.  
  66.    @10,2 Say "Fixed Decimal Test:"
  67.    @10,22 Get nVar2 Color aColor[3]
  68.  
  69.    @12,2 Say "    Character Test:"
  70.    @12,22 Get cVar1 Color aColor[3]
  71.  
  72.    SetColor(aColor[2])
  73.    @ 1,2,7,50 Box F_BLOCKS
  74.    @ 2,3 Say "Adding something as simple as:"
  75.    @ 3,3 Say "SET KEY K_F5 TO CALCULATOR" Color "+"+SetColor()
  76.    @ 4,3 Say "will allow all wait states access to "
  77.    @ 5,3 Say "the Calculator() and will allow *all*"
  78.    @ 6,3 Say "numerics and characters to receive the results:"
  79.  
  80.    @ 14,2,21,50 Box F_BLOCKS
  81.    @15,3 Say "After you press F5, notice that it holds the"
  82.    @16,3 Say "value of the variable.  After doing"
  83.    @17,3 Say "calculations you can press CTRL-ENTER to paste"
  84.    @18,3 Say "back the result."
  85.  
  86.    @20,3 Say "(Press H for Help in the Calculator)"
  87.  
  88.    SetColor(aColor[1])
  89.    Read
  90.  
  91.    CLS
  92.    @ 0,0,24,79 Box F_BLOCKS
  93.    @ 16,2 Say "Now in SPANISH..." Color aColor[4]
  94.    Inkey(2)
  95.    @ 16,2 Say "Press 'H' to view help" Color aColor[1]
  96.    CalcLanguage("SPA")
  97.    Calculator()
  98.  
  99.    CLS
  100.    @ 0,0,24,79 Box F_BLOCKS
  101.  
  102.    @ 3,2 Say "Also, you can take advantage of the Trigonometrical functions"
  103.    @ 4,2 Say "which include Sin(), Cos(), Tan(), ArcSin(), ArcCos(), ArcTan(),"
  104.    @ 5,2 Say "Sec(), Csc(), Cot(), Pi(), and more (24 in all)"
  105.  
  106.    @ 7,2 Say "They were written in C and are very fast - yet, overlayable also."
  107.    @ 8,2 Say "Of course, if you are going for super-speed, put TRIG in the root"
  108.    @ 9,2 Say "since overlaying any function called many times becomes slow."
  109.  
  110.    Set Decimals to 10
  111.  
  112.    @11,2 Say "            RADIAN           DEGREE       RESULTS IN:"
  113.    @12,2 Say "Sine:       SinR(.785398)    Sin(45)      "
  114.    @12,38 Say Sin(45)
  115.  
  116.    @14,2 Say "---press a key---"
  117.    Inkey(0)
  118.  
  119.    CLS
  120.    @ 2,0,24,79 Box F_BLOCKS
  121.  
  122.    @ 3,2 Say "There are hundreds of users of the calculator including:"
  123.  
  124.    @ 5,2 Say "UPS"
  125.    @ 6,2 Say "JPL"
  126.    @ 7,2 Say "Statewide Insurance"
  127.    @ 7,2 Say "Transamerica Insurance Group"
  128.    @ 8,2 Say "Marriott Services"
  129.    @ 9,2 Say "Interamerican Development Bank"
  130.    @10,2 Say "First National Bank"
  131.    @11,2 Say " and many more including software development firms"
  132.  
  133.    @13,2 Say "And we're happy that banks and insurance companies can trust this to be the"
  134.    @14,2 Say "'Best Calculator by far for Clipper.'"
  135.  
  136.    @16,2 Say "So if you want to put the calculator to use for your users,"
  137.    @17,2 Say "then (1) try it out by linking it to your program, and"
  138.    @18,2 Say "     (2) review REGISTER.DOC for receiving your license"
  139.  
  140.    @20,2 Say "And... you can even receive your registration number to"
  141.    @21,2 Say "       activate your copy (no copyright message) by phone!"
  142.  
  143.    @23,2 Say "Touchstone Business Creations (909) 679-3364 voice   (909) 672-2731 fax"
  144.  
  145.    SetColor("W/N")
  146.    Scroll(0,0,MaxRow(),MaxCol(),1)
  147.    SetCursor(1)
  148.    SetPos(MaxRow(),0)
  149.  
  150. Return NIL
  151.