home *** CD-ROM | disk | FTP | other *** search
/ C Programming Starter Kit 2.0 / SamsPublishing-CProgrammingStarterKit-v2.0-Win31.iso / bc45 / autocalc.pak / AUTOCALC.BAS < prev    next >
BASIC Source File  |  1997-07-23  |  1KB  |  46 lines

  1. Function CalcTest()
  2.   On Error Resume Next
  3.   Set Calc = GetObject(class:="OCCalc.Application")
  4.   Created = Err
  5.   If Err Then Set Calc = CreateObject("OCCalc.Application")
  6.   On Error GoTo 0
  7.   With Calc
  8.     .Operand = 123
  9.     .Op = "Equals"
  10.     .Evaluate
  11.     .Operand = 333
  12.     .Op = "Add"
  13.     .Evaluate
  14.     .Window.Color = 123456
  15.     .Display
  16.     .Button Key:="+10000+200000="
  17.     .Window.Caption = Now()
  18.      CalcTest = Calc
  19.     Debug.Print CalcTest
  20.     Debug.Print .Array.Count
  21.     For Each Item In .Array
  22.       Debug.Print Item;
  23.     Next Item
  24.     Debug.Print
  25.     Debug.Print .Window.Buttons.Count
  26.     For Each Key In .Window.Buttons
  27.       Save = Key.Text
  28.       Key.Activate = True
  29.       For i = 1 To 24
  30.         j = (i Mod 4) And (24 - i)
  31.         If ((i Mod 8) < 4) Then
  32.           Key.Text = Save & Space(j)
  33.         Else
  34.           Key.Text = Space(j) & Save
  35.         End If
  36.       Next i
  37.       Key.Activate = False
  38.      Next Key
  39.     .Accumulator = .LookAtWindow(Window:=.Window)
  40.     .Display
  41.     .Window.Color = RGB(255, 255, 0)
  42.     If Created Then .Quit
  43.   End With
  44. End Function
  45.  
  46.