'===========================================================================
' Subject: scientific calculator              Date: 09-29-01 (  :  )       
'  Author: Achilles B. Mina                   Code: rapidq                 
'  Origin: wasaywasay@i-manila.com.ph       Packet: RAPIDQ.ABC
'===========================================================================
'Calculait 3.41
'Updated: Sept. 29, 2001
'Now includes a Functions Selector and email sender
'Calculait is a full-featured scientific calculator with a world clock. 
'It's downloadable at ZDNet, RocketDownload, CNet and other freeware 
'sites, and at my website at http://pages.zdnet.com/wasaywasay/wasaywasay/

'You can do as you please with this code.

$INCLUDE "RAPIDQ.INC"
'$RESOURCE autumn AS "autumn.bmp"
'$RESOURCE Ico_Cal AS "cal.ico"
'$RESOURCE lionroar AS "lionroar.wav"
'$RESOURCE camera AS "camera.wav"
'$RESOURCE cashreg AS "cashreg.wav"
'$RESOURCE chicken AS "chicken.wav"
'$RESOURCE cuckoo AS "cuckoo.wav"
'$RESOURCE wipe AS "wipe.wav"
'$RESOURCE gong AS "gong.wav"
'$RESOURCE handbell AS "handbell.wav"
'$RESOURCE laser AS "laser.wav"
'$RESOURCE typing AS "typing.wav"
'$RESOURCE whooh AS "whooh.wav"
'$RESOURCE whoosh AS "whoosh.wav"

DECLARE Function GetFocus Lib "user32" Alias "GetFocus"() As Long
DECLARE FUNCTION SetFocus LIB "USER32" ALIAS "SetFocus" (HWnd AS LONG) AS LONG
DECLARE FUNCTION LoadCursorFromFile LIB "USER32" ALIAS "LoadCursorFromFileA" _
                 (CursorFileName AS STRING) AS LONG

DECLARE SUB SendAnswer
DECLARE SUB VariablesEntered(key AS BYTE)
DECLARE SUB EmailMe
DECLARE SUB CloseSolver
DECLARE SUB ClrExpEdit
DECLARE SUB ClrLastExpEdit
DECLARE SUB OperatorButts 
DECLARE SUB MathButts(Sender AS QCOOLBTN)
DECLARE SUB CheckE(newstring$ AS STRING)
DECLARE SUB RoundF
DECLARE SUB Modulus
DECLARE SUB Cubed
DECLARE SUB CubeRoot
DECLARE SUB DaytoHr
DECLARE SUB HrtoDay
DECLARE SUB MessageEdit(key AS BYTE)
DECLARE SUB Screen
DECLARE SUB ColorChangeBut
DECLARE SUB preMessageEdit
DECLARE SUB MessageChange
DECLARE SUB Starfield
DECLARE SUB Comet
DECLARE SUB Message
DECLARE SUB Ini
DECLARE SUB ExitSave
DECLARE SUB ChangeAvocado
DECLARE SUB ChangeBurgundy
DECLARE SUB ChangeGreen
DECLARE SUB ChangeLavender
DECLARE SUB ChangeBlue
DECLARE SUB ChangeCobalt
DECLARE SUB ChangeFlesh
DECLARE SUB ChangeBlack
DECLARE SUB ChangePowder
DECLARE SUB ChangeWhite
DECLARE SUB ChangePurple
DECLARE SUB ChangeChrome
DECLARE SUB ChangeEtat
DECLARE SUB ButtonClickEnter
DECLARE SUB Keys09(key$ AS STRING)
DECLARE SUB ButtonClick1
DECLARE SUB ButtonClick2
DECLARE SUB ButtonClick3
DECLARE SUB ButtonClick4
DECLARE SUB ButtonClick5
DECLARE SUB ButtonClick6
DECLARE SUB ButtonClick7
DECLARE SUB ButtonClick8
DECLARE SUB ButtonClick9
DECLARE SUB ButtonClick0
DECLARE SUB Backslash
DECLARE SUB ButtonClickC
DECLARE SUB ButtonClickCA
DECLARE SUB ButtonClickPlus
DECLARE SUB ButtonClickMult
DECLARE SUB ButtonClickDot
DECLARE SUB ButtonClickMinus
DECLARE SUB ButtonClickDiv
DECLARE SUB ButtonClickPercent
DECLARE SUB Errorhandler
DECLARE SUB ButtonClickPi
DECLARE SUB ButtonClickSqr
DECLARE SUB ButtonClickSin
DECLARE SUB ButtonClickCos
DECLARE SUB ButtonClickTan
DECLARE SUB ButtonClickAtn
DECLARE SUB ButtonClickMPlus
DECLARE SUB MemNew
DECLARE SUB ButtonClickMR
DECLARE SUB ButtonClickMC
DECLARE SUB ButtonClickPower
DECLARE SUB ButtonClickInverse
DECLARE SUB ButtonClickftm
DECLARE SUB ButtonClickmft
DECLARE SUB ButtonClickft2m2
DECLARE SUB ButtonClickm2ft2
DECLARE SUB ButtonClickincm
DECLARE SUB ButtonClickcmin
DECLARE SUB ButtonClickin2cm2
DECLARE SUB ButtonClickcm2in2
DECLARE SUB ButtonClickft3m3
DECLARE SUB ButtonClickm3ft3
DECLARE SUB ButtonClickkglb
DECLARE SUB ButtonClicklbkg
DECLARE SUB ButtonClickFC
DECLARE SUB ButtonClickCF
DECLARE SUB ButtonClickkmmi
DECLARE SUB ButtonClickmikm
DECLARE SUB ButtonClickinft
DECLARE SUB ButtonClickftin
DECLARE SUB ButtonClickydm
DECLARE SUB ButtonClickmyd
DECLARE SUB ButtonClickmily
DECLARE SUB ButtonClicklymi
DECLARE SUB ButtonClickhaac
DECLARE SUB ButtonClickacha
DECLARE SUB DegtoRad
DECLARE SUB RadtoDeg
DECLARE SUB PsitoPas
DECLARE SUB PastoPsi
DECLARE SUB PsitoAtm
DECLARE SUB AtmtoPsi
DECLARE SUB PsitoKgscm
DECLARE SUB KgscmtoPsi
DECLARE SUB SectoMin
DECLARE SUB MintoSec
DECLARE SUB MintoHr
DECLARE SUB HrtoMin
DECLARE SUB MintoDay
DECLARE SUB DaytoMin
DECLARE SUB TsptoTbs
DECLARE SUB TbstoTsp
DECLARE SUB FoztoTbs
DECLARE SUB TbstoFoz
DECLARE SUB CupstoTbs
DECLARE SUB TbstoCups
DECLARE SUB PartoLy
DECLARE SUB LytoPar
DECLARE SUB CartoMg
DECLARE SUB MgtoCar
DECLARE SUB QrtoGal
DECLARE SUB GaltoQrt
DECLARE SUB ButtonClickmfa
DECLARE SUB ButtonClickfam
DECLARE SUB TontoKilo
DECLARE SUB KilotoTon
DECLARE SUB HptoWatt
DECLARE SUB WatttoHp
DECLARE SUB BTUtoWatt
DECLARE SUB WatttoBTU
DECLARE SUB KwtoWatt
DECLARE SUB WatttoKw
DECLARE SUB KphtoMph
DECLARE SUB MphtoKph
DECLARE SUB KnottoMph
DECLARE SUB MphtoKnot
DECLARE SUB FpstoMps
DECLARE SUB MpstoFps
DECLARE SUB LittoGal
DECLARE SUB GaltoLit
DECLARE SUB OztoGram
DECLARE SUB GramtoOz
DECLARE SUB PinttoLtr
DECLARE SUB LtrtoPint
DECLARE SUB DegtoDms
DECLARE SUB DmstoDeg
DECLARE SUB ButtonClickCK
DECLARE SUB ButtonClickKC
DECLARE SUB WorldTimeDate
DECLARE SUB GMT
DECLARE SUB Squared
DECLARE SUB Sign
DECLARE SUB Ln
DECLARE SUB KeyPressed(key AS BYTE)
DECLARE SUB DoMath
DECLARE SUB DoCheck
DECLARE SUB FormClose(Action AS INTEGER)
DECLARE SUB DummyProc
DECLARE SUB TZone
DECLARE SUB CloseTZone
DECLARE SUB CloseStats
DECLARE SUB ClipboardCopy
DECLARE SUB ClipboardPaste
DECLARE SUB HonTime
DECLARE SUB NYTime
DECLARE SUB HKTime
DECLARE SUB LATime
DECLARE SUB LonTime
DECLARE SUB ParTime
DECLARE SUB MadTime
DECLARE SUB RomTime
DECLARE SUB HelTime
DECLARE SUB BerTime
DECLARE SUB MosTime
DECLARE SUB TokTime
DECLARE SUB StoTime
DECLARE SUB ManTime
DECLARE SUB SydTime
DECLARE SUB RioTime
DECLARE SUB AucTime
DECLARE SUB GuaTime
DECLARE SUB MexTime
DECLARE SUB TorTime
DECLARE SUB MumTime
DECLARE SUB JakTime
DECLARE SUB RiyTime
DECLARE SUB HavTime
DECLARE SUB MilTime
DECLARE SUB CaiTime
DECLARE SUB SLTime
DECLARE SUB HouTime
DECLARE SUB KarTime
DECLARE SUB CarTime
DECLARE SUB TehTime
DECLARE SUB RanTime
DECLARE SUB City
DECLARE SUB Stats
DECLARE SUB Number
DECLARE SUB Sum
DECLARE SUB Average
DECLARE SUB SumSquares
DECLARE SUB StdDev
DECLARE SUB PopDev
DECLARE SUB Sort
DECLARE SUB Clear
DECLARE SUB Correlate
DECLARE SUB Correlate0
DECLARE SUB Correlate1
DECLARE SUB Correlate2
DECLARE SUB Correlation
DECLARE SUB StatsFormClose
DECLARE SUB Rates
DECLARE SUB Interest
DECLARE SUB Factor
DECLARE SUB FinClear
DECLARE SUB EnterRate
DECLARE SUB EnterTerm
DECLARE SUB Rate(key AS BYTE)
DECLARE SUB Term(key AS BYTE)
DECLARE SUB GetRate
DECLARE SUB GetPValue
DECLARE SUB CompoundInterest
DECLARE SUB CompInterest(key AS BYTE)
DECLARE SUB CompCInterest(key AS BYTE)
DECLARE SUB CompPeriod(key AS BYTE)
DECLARE SUB CompPrincipal(key AS BYTE)
DECLARE SUB EnterPeriod
DECLARE SUB EnterPrincipal
DECLARE SUB EnterInterest
DECLARE SUB EnterCInterest
DECLARE SUB InterestClear
DECLARE SUB PresentValue
DECLARE SUB PValueClear
DECLARE SUB IPValue(key AS BYTE)
DECLARE SUB CIPValue(key AS BYTE)
DECLARE SUB FVPValue(key AS BYTE)
DECLARE SUB PPValue(key AS BYTE)
DECLARE SUB EnterIPValue
DECLARE SUB EnterCIPValue
DECLARE SUB EnterFVPValue
DECLARE SUB EnterPPValue
DECLARE SUB PValueClear
DECLARE SUB FPValue
DECLARE SUB FSave
DECLARE SUB FSaveH
DECLARE SUB FPrintH
DECLARE SUB FPrintS
DECLARE SUB FSaveC
DECLARE SUB FPrintC
DECLARE SUB Author
DECLARE SUB Product
DECLARE SUB Equivalents
DECLARE SUB RNG
DECLARE SUB RNGLower(key AS BYTE)
DECLARE SUB RNGUpper(key AS BYTE)
DECLARE SUB RNGLowEnter
DECLARE SUB RNGHighEnter
DECLARE SUB RNGClr
DECLARE SUB RainSnow
DECLARE SUB InitSnow
DECLARE SUB CloseGeneric
DECLARE SUB TZask
DECLARE SUB Exp
DECLARE SUB Log
DECLARE SUB Root
DECLARE SUB Radians
DECLARE SUB Sine
DECLARE SUB Cosine
DECLARE SUB Tangent
DECLARE SUB Secant
DECLARE SUB CoSecant
DECLARE SUB CoTangent
DECLARE SUB ArcSin
DECLARE SUB ArcCos
DECLARE SUB ArcTan
DECLARE SUB ArcSec
DECLARE SUB ArcCsc
DECLARE SUB ArcCot
DECLARE SUB HyperSin
DECLARE SUB HyperCos
DECLARE SUB HyperTan
DECLARE SUB HyperCot
DECLARE SUB HyperSec
DECLARE SUB HyperCsc
DECLARE SUB ArcHyperSin
DECLARE SUB ArcHyperCos
DECLARE SUB ArcHyperTan
DECLARE SUB ArcHyperCot
DECLARE SUB ArcHyperSec
DECLARE SUB ArcHyperCsc
DECLARE SUB TrigFunc
DECLARE SUB ChangeMode
DECLARE SUB 10power
DECLARE SUB Factorial
DECLARE SUB Choices
DECLARE SUB Colors
DECLARE SUB Separator
DECLARE SUB DectoHex
DECLARE SUB preHextoDec
DECLARE SUB HextoDec(key AS BYTE)
DECLARE SUB DectoBin
DECLARE SUB preBintoDec
DECLARE SUB BintoDec(key AS BYTE)
DECLARE SUB Amortization
DECLARE SUB ALoan(key AS BYTE)
DECLARE SUB AInterest(key AS BYTE)
DECLARE SUB APeriod(key AS BYTE)
DECLARE SUB AcInterest(key AS BYTE)
DECLARE SUB APayment
DECLARE SUB EnterALoan
DECLARE SUB EnterAInterest
DECLARE SUB EnterAPeriod
DECLARE SUB EnterAcInterest
DECLARE SUB AmortClear
DECLARE SUB History
DECLARE SUB DaysD
DECLARE SUB DaysDEnd
DECLARE SUB preDaysDifference
DECLARE SUB DaysDifference(key AS BYTE)
DECLARE SUB NewD
DECLARE SUB NewDEnd
DECLARE SUB preNew_Date
DECLARE SUB New_Date(key AS BYTE)
DECLARE SUB GetMonth(monthtocheck AS STRING)
DECLARE SUB GetDay(daytocheck AS STRING)
DECLARE FUNCTION GetAOdays AS INTEGER
DECLARE FUNCTION GetOdays AS INTEGER
DECLARE SUB OutFinancial
DECLARE SUB OutScientific
DECLARE SUB OutComma
DECLARE SUB OutNone
DECLARE SUB OutUser(Sender AS QMENUITEM)
DECLARE SUB OutFormat
DECLARE SUB OutFormatType
DECLARE SUB FormsColor
DECLARE SUB NotesShow
DECLARE SUB CloseNotes
DECLARE SUB ConstantsAll(Sender AS QMENUITEM)
DECLARE SUB Quadratic
DECLARE SUB preQuadRoots
DECLARE SUB QuadRoots(key AS BYTE)
DECLARE SUB Pythagorean
DECLARE SUB preSolvePytha
DECLARE SUB SolvePytha(key AS BYTE)
DECLARE SUB getPosPanel
DECLARE SUB getNegPanel
DECLARE SUB getPythaPanel1
DECLARE SUB getPythaPanel2
DECLARE SUB Cubic
DECLARE SUB preCubicRoots
DECLARE SUB CubicRoots(key AS BYTE)
DECLARE SUB CubicRoot1
DECLARE SUB CubicRoot2
DECLARE SUB CubicRoot3
DECLARE SUB Drake
DECLARE SUB preDrakeSolve
DECLARE SUB DrakeSolve(key AS BYTE)
DECLARE SUB Coordinate
DECLARE SUB preRecPolar
DECLARE SUB RecPolar(key AS BYTE)
DECLARE SUB PRRadio
DECLARE SUB ExpSolver
DECLARE SUB ExpSolverEdit
DECLARE SUB Functions(par1 AS INTEGER, mathval$ AS STRING)
DECLARE SUB DoInPrecision(value AS DOUBLE, value$ AS STRING)
DECLARE SUB DoPrecision
DECLARE SUB preCheckSyntax
DECLARE SUB CheckSyntax(key AS BYTE)
DECLARE SUB IntImp
DECLARE SUB ClickDate
DECLARE SUB USDate
DECLARE SUB UKDate
DECLARE SUB IntDate
DECLARE SUB changeE
DECLARE SUB GaltoLitUK
DECLARE SUB LittoGalUK
DECLARE SUB PinttoLtrUK
DECLARE SUB LtrtoPintUK
DECLARE SUB HptoWattUK
DECLARE SUB WatttoHpUK
DECLARE SUB SendMe


TYPE Star
  X(100) AS BYTE
  Y(100) AS BYTE
  Z(100) AS BYTE
END TYPE

DEFSTR entry, entrynext, memvalue, memvaluenext, memvaluetotal, GMTDiff$, usermessage$, outform$, precision$
DEFSTR oldexpression, MathText, formula$, operand, operandold, inifile, FVPValueEdit$, PrincipalEdit$, ALoanEdit$, City$, DateLine$, wday$
DEFBYTE soundoff, Military, CometV, StarV, MessageV, ScreenV, dochecktag, escape
DEFSHORT HourDiff, MinDiff, GMTDiff
DEFDBL CMode, CModeN, funcanswer
DEFWORD monthnow, monththen, monthchecked, yearnow, yearthen, betyears
DEFBYTE formdate, clickeddate, leapnow, leapthen, bleap, circa, weekday, fmonth, emonth, pmonth, todate, inthepast
DEFINT byear, bmonth, bleapyear, yearhence, AOyears, fyear, eyear, pyear
DEFINT Bdays, rundays, edays, otherdays, totdays, yeardays,Odays, AOdays, diffdays, betleaps, daynow, daythen, Adays
DEFINT fday, eday, pday, neweday, newpday, monthdays, daysthence, dayshence, bday, days

DIM Snow AS Star
DIM Data1(1000) AS INTEGER, Data2(1000) AS INTEGER
DIM Math(1 TO 39) AS STRING

CREATE Symbol AS QFONT
    Name = "Symbol"
    Color = clRed
    AddStyles(fsBold)
    Size = 11
END CREATE

CREATE SymbolG AS QFONT
    Name = "Symbol"
    Color = clGreen
    AddStyles(fsBold)
    Size = 11
END CREATE

CREATE SymbolB AS QFONT
    Name = "Symbol"
    Color = clRed
    AddStyles(fsBold)
    Size = 13
END CREATE

CREATE Arial AS QFONT
    Name = "Arial"
    Color = clRed  '&H00EAA
    AddStyles(fsBold)
    Size = 10
END CREATE

CREATE Helvetica12 AS QFONT
    Name = "Arial"
    Color = clRed  '&H00EAA
    AddStyles(fsBold)
    Size = 12
END CREATE

CREATE Helvetica16 AS QFONT
    Name = "Arial"
    Color = clRed  '&H00EAA
    AddStyles(fsBold)
    Size = 16
END CREATE

CREATE Helvetica10 AS QFONT
    Name = "Arial"
    Color = &H00FF00
    AddStyles(fsBold)
    Size = 10
END CREATE

CREATE HelveticaTae AS QFONT
    Name = "Arial"
    Color = &H00FF00
    AddStyles(fsBold)
    Size = 11
END CREATE

CREATE ArialG AS QFONT
    Name = "Arial"
    Color = clGreen   
    AddStyles(fsBold)
    Size = 12
END CREATE

CREATE ArialG1 AS QFONT
    Name = "Arial"
    Color = clBlack '&HEEFE   
    AddStyles(fsBold)
    Size = 10
END CREATE

CREATE ArialG11 AS QFONT
    Name = "Arial"
    Color = clBlack '&HEEFE   
    AddStyles(fsBold)
    Size = 11
END CREATE

CREATE Arial9R AS QFONT
    Name = "Arial"
    Color = &HEEFE
    AddStyles(fsBold)
    Size = 9
END CREATE

CREATE Arial9G AS QFONT
    Name = "Arial"
    Color = clGreen
    AddStyles(fsBold)
    Size = 9
END CREATE

CREATE Arial11G AS QFONT
    Name = "Arial"
    Color = clGreen
    AddStyles(fsBold)
    Size = 11
END CREATE

CREATE Arial9B AS QFONT
    Name = "Arial"
    Color = clBlack
    AddStyles(fsBold)
    Size = 9
END CREATE

CREATE Arial9Y AS QFONT
    Name = "Arial"
    Color = &HFFFFF
    AddStyles(fsBold)
    Size = 9
END CREATE

CREATE Arial9W AS QFONT
    Name = "Arial"
    Color = clWhite
    AddStyles(fsBold)
    Size = 9
END CREATE

CREATE ArialW AS QFONT
    Name = "Arial"
    Color = clWhite
    AddStyles(fsBold)
    Size = 12
END CREATE

CREATE Arial10B AS QFONT
    Name = "Arial"
    Color = clBlack
    AddStyles(fsBold)
    Size = 10
END CREATE

CREATE Arial10W AS QFONT
    Name = "Arial"
    Color = clWhite
    AddStyles(fsBold)
    Size = 10
END CREATE

CREATE ArialB AS QFONT
    Name = "Arial"
    Color = clBlack
    AddStyles(fsBold)
    Size = 12
END CREATE

CREATE ArialR AS QFONT
    Name = "Arial"
    Color = &HEEFE
    AddStyles(fsBold)
    Size = 11
END CREATE

CREATE ArialW14 AS QFONT
    Name = "Arial"
    Color = clWhite
    AddStyles(fsBold)
    Size = 14
END CREATE

CREATE ArialR14 AS QFONT
    Name = "Arial"
    Color = 3333333
    AddStyles(fsBold)
    Size = 14
END CREATE

CREATE Vivaldi AS QFONT
    Name = "Arial"
    Color = clGreen
    AddStyles(fsBold)
    Size = 10
END CREATE

CREATE TimeFont AS QFONT
    Name = "Verdana"
    Color = clGreen
    Size = 12
    AddStyles(fsBold)
END CREATE

CREATE TimeFont11 AS QFONT
    Name = "Verdana"
    Color = clGreen
    Size = 10
    AddStyles(fsBold)
END CREATE

CREATE ArialBl AS QFONT
    Name = "Arial"
    Color = clBlue
    Size = 12
    AddStyles(fsBold)
END CREATE

CREATE DXTimer AS QTimer
  Enabled = 0
  Interval = 1
  OnTimer = RainSnow
END CREATE

CREATE Timer1 AS QTIMER
  Enabled = 1
  Interval = 1000
  OnTimer = WorldTimeDate
END CREATE

CREATE Timer2 AS QTIMER
  Enabled = 0
  Interval = 1
  OnTimer = NotesShow
END CREATE

CREATE Form AS QFORM  
  Center
  Caption = "Calculait"
  Width = 430
  Height = 345  '335
  Color = clBlack
  AutoScroll = 0
  'DelBorderIcons(biMaximize)
  'BorderStyle = bsSingle
  OnKeyPress = Keypressed
  WndProc = DummyProc
  CREATE TopPanel AS QPANEL
    Width = 425
    Height = 13
    Color = clBlack
    Hint = "Click to bring up Math-Expression Solver"
    Showhint = 1
    Cursor = -21
    BevelWidth = 0
    OnClick = ExpSolver
  END CREATE
  CREATE BottomPanel AS QPANEL
    Top = 287
    Width = 425
    Height = 13
    Color = clBlack
    Hint = "Click to bring up Math-Expression Solver"
    Showhint = 1
    Cursor = -21
    BevelWidth = 0
    OnClick = ExpSolver
  END CREATE
  CREATE ExpSolverForm AS QFORM
    Top = (Screen.Height + Form.Height)/2 
    Left = (Screen.Width - Form.Width)/2
    Height = 50
    Width = 430
    Color = &HABC111
    FormStyle = fsStayOnTop
    AutoScroll = 0
    'DelBorderIcons(biMaximize)
    'BorderStyle = bsSingle
    Caption = "Math-Expression Solver"
    OnClose = CloseSolver
    Hint = "Type in entry then press Enter to get answer"
    ShowHint = 1
    CREATE ExpEdit AS QEDIT
      Top = 1
      Left = 1
      Width = 423
      Height = 23
      Font = ArialG11
      OnKeyPress = CheckSyntax
    END CREATE
  END CREATE
  CREATE VariablesForm AS QFORM
    Top = Screen.Height/2 - 285
    Left = Screen.Width/2 - 215
    Height = 112
    Width = 430
    DelBorderIcons(biMaximize)
    FormStyle = fsStayOnTop
    Hint = "Type in value of each variable you used above"
    ShowHint = 1
    Caption = "Variables Input"
    Color = &HABC999
    OnClose = CloseGeneric
    CREATE UVarPanel AS QPANEL
      Top = 1
      Left = 5
      Width = 30
      Height = 25
      BevelOuter = 0
      Font = Arial10B
      Caption = " U = "
      Color = &HABC999
    END CREATE
    CREATE UVarEdit AS QEDIT
      Top = 1
      Left = 37
      Width = 170
      Height = 25
      Color = 0
      Font = Arial10W
      OnKeyPress = VariablesEntered
    END CREATE
    CREATE WVarPanel AS QPANEL
      Top = 30
      Left = 5
      Width = 30
      Height = 25
      BevelOuter = 0
      Font = Arial10B
      Caption = " W = "
      Color = &HABC999
    END CREATE
    CREATE WVarEdit AS QEDIT
      Top = 30
      Left = 37
      Width = 170
      Height = 25
      Color = 0
      Font = Arial10W
      OnKeyPress = VariablesEntered
    END CREATE
    CREATE YVarPanel AS QPANEL
      Top = 1
      Left = 215
      Width = 30
      Height = 25
      BevelOuter = 0
      Font = Arial10B
      Caption = " Y = "
      Color = &HABC999
    END CREATE
    CREATE YVarEdit AS QEDIT
      Top = 1
      Left = 247
      Width = 170
      Height = 25
      Color = 0
      Font = Arial10W
      OnKeyPress = VariablesEntered
    END CREATE
    CREATE ZVarPanel AS QPANEL
      Top = 30
      Left = 215
      Width = 30
      Height = 25
      BevelOuter = 0
      Font = Arial10B
      Caption = " Z = "
      Color = &HABC999
    END CREATE
    CREATE ZVarEdit AS QEDIT
      Top = 30
      Left = 247
      Width = 170
      Height = 25
      Color = 0
      Font = Arial10W
      OnKeyPress = VariablesEntered
    END CREATE
    CREATE JVarPanel AS QPANEL
      Top = 59
      Left = 5
      Width = 30
      Height = 25
      BevelOuter = 0
      Font = Arial10B
      Caption = " J = "
      Color = &HABC999
    END CREATE
    CREATE JVarEdit AS QEDIT
      Top = 59
      Left = 37
      Width = 170
      Height = 25
      Color = 0
      Font = Arial10W
      OnKeyPress = VariablesEntered
    END CREATE
    CREATE KVarPanel AS QPANEL
      Top = 59
      Left = 215
      Width = 30
      Height = 25
      BevelOuter = 0
      Font = Arial10B
      Caption = " K = "
      Color = &HABC999
    END CREATE
    CREATE KVarEdit AS QEDIT
      Top = 59
      Left = 247
      Width = 170
      Height = 25
      Color = 0
      Font = Arial10W
      OnKeyPress = VariablesEntered
    END CREATE
  END CREATE 
  CREATE FunctionsForm AS QFORM    
    Color = &HABC111
    Top = Screen.Height/2 - Form.Height/7.18
    Left = Screen.Width/2 - Form.Width/1.34
    Caption = "Functions Selector"
    Width =  354 '296
    Height = 220    
    Visible = 0
    Color = &HABC111
    FormStyle = fsStayOnTop
    AutoScroll = 0
    'DelBorderIcons(biMaximize)
    'BorderStyle = bsSingle
    OnClose = CloseGeneric
    CREATE ZeroButt AS QCOOLBTN
      Font = ArialB
      Top = 5
      Left = 232
      Width = 58
      Height = 18
      Flat = 1
      Caption = "0"
      OnClick = MathButts
    END CREATE
    CREATE OneButt AS QCOOLBTN
      Font = ArialW
      Top = 24
      Left = 232
      Width = 58
      Height = 18
      Flat = 1
      Caption = "1"
      OnClick = MathButts
    END CREATE
    CREATE TwoButt AS QCOOLBTN
      Font = ArialB
      Top = 43
      Left = 232
      Width = 58
      Height = 18
      Flat = 1
      Caption = "2"
      OnClick = MathButts
    END CREATE
    CREATE ThreeButt AS QCOOLBTN
      Font = ArialW
      Top = 62
      Left = 232
      Width = 58
      Height = 18
      Flat = 1
      Caption = "3"
      OnClick = MathButts
    END CREATE
    CREATE FourButt AS QCOOLBTN
      Font = ArialB
      Top = 81
      Left = 232
      Width = 58
      Height = 18
      Flat = 1
      Caption = "4"
      OnClick = MathButts
    END CREATE
    CREATE FiveButt AS QCOOLBTN
      Font = ArialW
      Top = 100
      Left = 232
      Width = 58
      Height = 18
      Flat = 1
      Caption = "5"
      OnClick = MathButts
    END CREATE
    CREATE SixButt AS QCOOLBTN
      Font = ArialB
      Top = 119
      Left = 232
      Width = 58
      Height = 18
      Flat = 1
      Caption = "6"
      OnClick = MathButts
    END CREATE
    CREATE SevenButt AS QCOOLBTN
      Font = ArialW
      Top = 138
      Left = 232
      Width = 58
      Height = 18
      Flat = 1
      Caption = "7"
      OnClick = MathButts
    END CREATE
    CREATE EightButt AS QCOOLBTN
      Font = ArialB
      Top = 157
      Left = 232
      Width = 58
      Height = 18
      Flat = 1
      Caption = "8"
      OnClick = MathButts
    END CREATE
    CREATE NineButt AS QCOOLBTN
      Font = ArialW
      Top = 176
      Left = 232
      Width = 58
      Height = 18
      Flat = 1
      Caption = "9"
      OnClick = MathButts
    END CREATE
    CREATE ClrButt AS QOVALBTN
      Layout = -1
      Flat = 1
      Font = ArialW
      Top = 5
      Left = 290
      Width = 29
      Height = 18.5
      Flat = 1
      Caption = "AC"
      Hint = "Clear all"
      ShowHint = 1
      OnClick = ClrExpEdit
    END CREATE
    CREATE LastClrButt AS QOVALBTN
      Layout = -1
      Flat = 1
      Font = ArialW
      Top = 5
      Left = 319
      Width = 29
      Height = 18.5
      Flat = 1
      Caption = "C"
      Hint = "Clear last entry"
      ShowHint = 1
      OnClick = ClrLastExpEdit
    END CREATE
    CREATE SendButt AS QCOOLBTN
      Font = Arial9B
      Top = 43
      Left = 290
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Send"
      Hint = "Send answer to expression"
      ShowHint = 1
      OnClick = SendAnswer
    END CREATE
    CREATE AddButt AS QCOOLBTN
      Font = ArialW
      Top = 62
      Left = 290
      Width = 58
      Height = 18
      Flat = 1
      Caption = "+"
      Hint = "Addition"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE SubButt AS QCOOLBTN
      Font = ArialB
      Top = 81
      Left = 290
      Width = 58
      Height = 18
      Flat = 1
      Caption = "--"
      Hint = "Subtraction"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE MulButt AS QCOOLBTN
      Font = ArialW
      Top = 100
      Left = 290
      Width = 58
      Height = 18
      Flat = 1
      Caption = "x"
      Hint = "Multiplication"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE DivButt AS QCOOLBTN
      Font = ArialB
      Top = 119
      Left = 290
      Width = 58
      Height = 18
      Flat = 1
      Caption = "÷"
      Hint = "Division"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE PowButt AS QCOOLBTN
      Font = ArialW
      Top = 138
      Left = 290
      Width = 58
      Height = 18
      Flat = 1
      Caption = "^"
      Hint = "Raise to the power..."
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE AnsButt AS QOVALBTN
      Layout = -1
      Flat = 1
      Font = ArialW
      Top = 175.5
      Left = 290
      Width = 58
      Height = 18.5
      Flat = 1
      Caption = "Ans"
      Hint = "Get answer"
      ShowHint = 1
      OnClick = preCheckSyntax
    END CREATE
    CREATE SinButt AS QCOOLBTN
      Font = Arial9B
      Top = 5
      Left = 0
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Sin"
      Hint = "Sine"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE CosButt AS QCOOLBTN
      Font = Arial9B
      Top = 5
      Left = 58
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Cos"
      Hint = "Cosine"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE TanButt AS QCOOLBTN
      Font = Arial9B
      Top = 5
      Left = 116
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Tan"
      Hint = "Tangent"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE CotButt AS QCOOLBTN
      Font = Arial9B
      Top = 5
      Left = 174
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Cot"
      Hint = "Cotangent"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE ASinButt AS QCOOLBTN
      Font = Arial9W
      Top = 24
      Left = 0
      Width = 58
      Height = 18
      Flat = 1
      Caption = "ASin"
      Hint = "Arcsine"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE ACosButt AS QCOOLBTN
      Font = Arial9W
      Top = 24
      Left = 58
      Width = 58
      Height = 18
      Flat = 1
      Caption = "ACos"
      Hint = "Arccosine"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE ATanButt AS QCOOLBTN
      Font = Arial9W
      Top = 24
      Left = 116
      Width = 58
      Height = 18
      Flat = 1
      Caption = "ATan"
      Hint = "Arctangent"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE ACotButt AS QCOOLBTN
      Font = Arial9W
      Top = 24
      Left = 174
      Width = 58
      Height = 18
      Flat = 1
      Caption = "ACot"
      Hint = "Arccotangent"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE SinhButt AS QCOOLBTN
      Font = Arial9B
      Top = 43
      Left = 0
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Sinh"
      Hint = "Hyperbolic sine"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE CoshButt AS QCOOLBTN
      Font = Arial9B
      Top = 43
      Left = 58
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Cosh"
      Hint = "Hyperbolic cosine"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE TanhButt AS QCOOLBTN
      Font = Arial9B
      Top = 43
      Left = 116
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Tanh"
      Hint = "Hyperbolic tangent"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE CothButt AS QCOOLBTN
      Font = Arial9B
      Top = 43
      Left = 174
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Coth"
      Hint = "Hyperbolic cotangent"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE ASinhButt AS QCOOLBTN
      Font = Arial9W
      Top = 62
      Left = 0
      Width = 58
      Height = 18
      Flat = 1
      Caption = "ASinh"
      Hint = "Hyperbolic arcsine"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE ACoshButt AS QCOOLBTN
      Font = Arial9W
      Top = 62
      Left = 58
      Width = 58
      Height = 18
      Flat = 1
      Caption = "ACosh"
      Hint = "Hyperbolic arccosine"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE ATanhButt AS QCOOLBTN
      Font = Arial9W
      Top = 62
      Left = 116
      Width = 58
      Height = 18
      Flat = 1
      Caption = "ATanh"
      Hint = "Hyperbolic arctangent"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE ACothButt AS QCOOLBTN
      Font = Arial9W
      Top = 62
      Left = 174
      Width = 58
      Height = 18
      Flat = 1
      Caption = "ACoth"
      Hint = "Hyperbolic arccotangent"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE SecButt AS QCOOLBTN
      Font = Arial9B
      Top = 81
      Left = 0
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Sec"
      Hint = "Secant"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE CscButt AS QCOOLBTN
      Font = Arial9B
      Top = 81
      Left = 58
      Width = 58
      Height = 18
      Flat = 1
      Caption = "Csc"
      Hint = "Cosecant"
      ShowHint = 1
      OnClick = MathButts
    END CREATE
    CREATE ASecButt AS QCOOLBTN
      Font = Arial9B
      Top = 81
