home *** CD-ROM | disk | FTP | other *** search
/ High Voltage Shareware / high1.zip / high1 / DIR22 / JORF21_2.ZIP / REGISTER.J < prev    next >
Text File  |  1993-07-05  |  5KB  |  160 lines

  1. Register:Start
  2.   New (Contact:Con)
  3.   Jorf:File("Register.Jrf",Here)
  4.   Con=Struct:Find('Contact','FullName',Null)
  5.   If (Con==Null)
  6.     Con->Type = "JORFWIN"
  7.     Con->Location = "USA"
  8.  
  9.   Event:Add()
  10.   Win:Add ("JORF Registration",5,10)
  11.     Group:"Send to:" Row:1 Col:1 Len:6 Wid:40
  12.     Input:"&Name   ", Wid:30, Field:"Con->FullName"
  13.     Input:"Company",  Wid:30, Field:"Con->Company"
  14.     Input:"&Address", Wid:30, Field:"Con->Addr1"
  15.     Input:"       ",  Wid:30, Field:"Con->Addr2"
  16.     Input:"       ",  Wid:30, Field:"Con->Addr3"
  17.     Radio:"&USA"  Row:7 Col:2
  18.       Action:"Con->Location='USA'"
  19.       UnAction:"Con->Location=Null"
  20.       Check:"Con->Location=='USA'"
  21.       After:"Register:Calc(Con)"
  22.     Radio:"&Canada/Mexico" Row:7 Col:11
  23.       Action:"Con->Location='CanMex'"
  24.       UnAction:"Con->Location=Null"
  25.       Check:"Con->Location= ='CanMex'"
  26.       After:"Register:Calc(Con)"
  27.     Radio:"&Foreign" Row:7 Col:30
  28.       Action:"Con->Location='Foreign'"
  29.       UnAction:"Con->Location=Null"
  30.       Check:"Con->Location=='Foreign'"
  31.       After:"Register:Calc(Con)"
  32.     String:"Press TAB between fields" Row:8 Col:10
  33.  
  34.     Group:"Registration for"
  35.       Row:9  Col:1  Len:9  Wid:60
  36.     Radio:" &JORF PC Version"
  37.       Check:"Con->Type=='JPC'"
  38.       Action:"Con->Type='JPC'"
  39.       UnAction:"Con->Type= Null"
  40.       After:"Register:Calc(Con)"
  41.     String:"       Includes 250 page manual, quick reference card"
  42.     String:"       support, notice of upgrades, good karma."
  43.     Radio:" &DOS386/Win Version"
  44.       Check:"Con->Type=='JORFWIN'"
  45.       Action:"Con->Type='JORFWIN'"
  46.       UnAction:"Con->Type= Null"
  47.       After:"Register:Calc(Con)"
  48.     String:"       Includes all the above plus JORF386 (uses high"
  49.     String:"       memory to run faster) and MS Windows interpreters"
  50.     Radio:" JORF Developers &Kit"
  51.       Check:"Con->Type=='JDK'"
  52.       Action:"Con->Type='JDK'"
  53.       UnAction:"Con->Type= Null"
  54.       After:"Register:Calc(Con)"
  55.     String:"       Includes all the above, plus 100 page Developer's"
  56.     String:"       guide, link libraries,  sample PRJ and batch files"
  57.     String:"Press SPACE BAR to select a button" Row:19 Col:13
  58.  
  59.     Group:"Amount" Row:1 Col:43 Len:6 Wid:18
  60.       Display:"Register:Calc(Con)"
  61.  
  62.     Button:"&Print"   Row:20 Col:5  Wid:20 Action:"Register:Print(Con)"
  63.     Button:"E&xit"    Row:20 Col:35 Wid:20 Action:"Return Null"
  64.   Jorf:Write(Con)
  65.   Return(Ok)
  66.  
  67. Register:Calc(Con)
  68.   Switch (Con->Type)
  69.     Case "JPC"
  70.       Move:To(3,45)
  71.       Str:Put("JORF PC   "+Num:Str(45,"##0.00"))
  72.       Con->Total = 45
  73.     Case "JDK"
  74.       Move:To(3,45)
  75.       Str:Put("JDK       "+Num:Str(170,"##0.00"))
  76.       Con->Total = 170
  77.     Else "JORFWIN"
  78.       Move:To(3,45)
  79.       Str:Put("JORF/WIN  "+Num:Str(85,"##0.00"))
  80.       Con->Total = 85
  81.  
  82.   Switch (Con->Location)
  83.     Case "Foreign"
  84.       Move:To(4,45)
  85.       Str:Put("Shipping  "+Num:Str(10,"##0.00"))
  86.       Con->Total = Con->Total + 10
  87.     Else
  88.       Move:To(4,45)
  89.       Str:Put("Shipping  "+"  FREE")
  90.  
  91.   Move:To(5,45)
  92.   Str:Put("        --------")
  93.   Move:To(6,45)
  94.   Str:Put("Total     "+Num:Str(Con->Total,"##0.00"))
  95.   Return (Ok)
  96.  
  97. Register:Print(Con)
  98.   New (Dest,Date)
  99.   Dest=Jorf:Printer()
  100.   If (Dest)
  101.     Date = Date:Str(Date:Get,"s d, yyyy")
  102.  
  103.     Rep:Add ("JORF Registration Form", 5, 5, 60, 75, Here)
  104.       Item:"Date"                 NewRow:4
  105.       Item:"'To: Wayland Bruns'"  NewRow:2
  106.       Item:"'The JORF Company'"   NewRow:1
  107.       Item:"'25858 Elwood Road'"  NewRow:1
  108.       Item:"'Colton, OR 97017'"   NewRow:1
  109.       Item:""                     NewRow:1
  110.       Item:"'Wayland:'"           NewRow:1
  111.       Item:""                     NewRow:1
  112.       Item:"'I would like to register my copy of JORF.  I have enclosed'"
  113.         NewRow:1
  114.       Item:"'a check in the amount of $'+Str:Aft(Num:Str(Con->Total,'##0.00'),' ')+' for a:'"
  115.         NewRow:1
  116.       Item:""
  117.         NewRow:1
  118.       Item:"'     A JORF DOS Interpreter.     '"  Before:"Con->type=='JPC'"
  119.         NewRow:1
  120.       Item:"'     A JORF DOS-386/Windows Interpreter.'"  Before:"Con->type=='JORFWIN'"
  121.         NewRow:1
  122.       Item:"'     A JORF Developers Kit.         '"  Before:"Con->type=='JDK'"
  123.         NewRow:1
  124.       Item:""
  125.         NewRow:1
  126.       Item:"'Please send the package to:'"      NewRow:1
  127.       Item:""                                   NewRow:1
  128.       Item:"'       '+Con->FullName"            NewRow:1
  129.       Item:"'       '+Con->Company "            NewRow:1
  130.       Item:"'       '+Con->Addr1   "            NewRow:1
  131.       Item:"'       '+Con->Addr2   "            NewRow:1
  132.       Item:"'       '+Con->Addr3   "            NewRow:1
  133.       Item:""                                   NewRow:1
  134.       Item:"'Thank You'"                        NewRow:1
  135.       Next:"Null"
  136.     File:Print("Jreport.lst",Dest)
  137.   Return (Ok)
  138.  
  139. Class:Contact           | Class definition for a Contact structure
  140.   Index:FullName        | Full name
  141.   Index:Company         | Company
  142.   Index:WorkPhone       | Work Phone
  143.   Index:LastName        | Last Name
  144.   Index:ZipCode         | Zip Code
  145.   Addr1                 | Address
  146.   Addr2
  147.   Addr3
  148.   Location
  149.   HomePhone             | Home Phone
  150.   WorkPhone
  151.   FaxPhone
  152.   Birthday
  153.   Anniversary
  154.   Dear
  155.   Comment
  156.   Notes                 | Notepad
  157.   Type
  158.   Total
  159.  
  160.