home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a114 / 2.img / TOOLKIT / TOOLKIT.ZIP / DOW8DEMO.SC < prev    next >
Encoding:
Text File  |  1990-08-25  |  4.7 KB  |  123 lines

  1. ; Copyright (c) 1987-1989 Borland International.  All Rights Reserved.
  2. ;
  3. ; General permission to re-distribute all or part of this script is granted,
  4. ; provided that this statement, including the above copyright notice, is not
  5. ; removed.  You may add your own copyright notice to secure copyright
  6. ; protection for new matter that you add to this script, but Borland
  7. ; International will not support, nor assume any legal responsibility for,
  8. ; material added or changes made to this script.
  9. ;
  10. ; Revs.:  DCY 12/15/88
  11. ; ****************************************************************************
  12.  
  13. DemoLib = SDir()+"DoW8Demo"     ;Name of demonstration library
  14. Createlib DemoLib
  15.  
  16. ; ****************************************************************************
  17. ;  NAME: DataEntry
  18. ; NOTES: This procedure initiates a sample data entry session under the
  19. ;        control of DoWait.  Because data entry is typically an independent
  20. ;        subsystem of an application, we have defined DataEntry() as a closed
  21. ;        procedure.  To begin the demonstration, you need simply execute the
  22. ;        following two commands:
  23. ;
  24. ;              Readlib SDir()+"DoW8Demo" DataEntry
  25. ;              DataEntry(Commentary)
  26. ;
  27. ;              where Commentary is a logical variable specifying whether or
  28. ;                    not to display commentary during the demonstration
  29. ;
  30. ;        DEMO.SC allows you to run the DoWait demonstration outside of the
  31. ;        TKMenu menu.  Refer to it for more information on running the
  32. ;        demonstration.
  33. ;
  34. Proc Closed DataEntry(Commentary)
  35. ;  Private;Commentary     ;Specifies whether or not to display commentary
  36.  
  37.    AutoLib = SDir()+"DoW8Demo," + ;Library containing demonstration procedures
  38.              SDir()+"Toolkit"   ;Library containing Toolkit utility procedures
  39.  
  40.  
  41.    SetPopup("Payment")          ;Prepare popup-style menu based on first
  42.                                 ; field of records in Payment table
  43.    SetKeyCodes()                ;Define mnemonic Paradox keycode variables
  44.  
  45.    InitWait(4,"2,1,4","Invoice,Cust,Orders")  ;Initialize DoWait
  46.  
  47.    ; Note that although there are actually four images on the workspace
  48.    ; during this demonstration, only three are used with DoWait. Thus we
  49.    ; need only include three tables in the InitWait argument list.  Note
  50.    ; also that numbers in the "image no." list need not be in numerical
  51.    ; sequence--what's important is that their order corresponds exactly
  52.    ; to the order of tables in the "table name" list.  Finally, the first
  53.    ; InitWait argument ("max image no.") should be equal to the highest
  54.    ; image number value of all tables to be monitored by DoWait.
  55.  
  56.    Release Procs InitWait,      ;Release procs no longer needed
  57.                  SetPopup,
  58.                  SetKeycodes
  59.  
  60.    AreaCode = "(415)"           ;Initialize additional variables
  61.    TaxRate = 7.5
  62.  
  63.    Setswap 28000                ;Ensure enough memory available to
  64.                                 ; view necessary table images
  65.  
  66.    Reset               ;Clear workspace
  67.  
  68.    View "Cust"
  69.    View "Invoice"
  70.  
  71.    If RecNo() = 0      ;If the table is empty, Paradox will open up a new
  72.       Then CoEditKey   ; record for us automatically
  73.            FormKey     ;Display multi-table form
  74.       Else End
  75.            FormKey     ;Display multi-table form
  76.            CtrlHome
  77.            CoEditKey
  78.            CtrlPgDn    ;Open up a new master invoice record
  79.    Endif
  80.  
  81.    DoWait("")          ;Call DoWait
  82.  
  83.    Clear
  84.    Prompt                  ;Restore Paradox system prompt
  85.    If Retval <> TKDo_It!   ;Did user cancel out of session?
  86.       Then RequiredCheck Off ; Yes-delete dependent records
  87.            If not IsValid()
  88.               Then CtrlBackSpace
  89.            Endif
  90.            Moveto "Orders" 
  91.            While NImageRecords() <> 1 ;Delete linked order records
  92.               Del
  93.            Endwhile
  94.            Del
  95.            Moveto "Invoice"
  96.            Del           ;Delete master record
  97.    Endif
  98.    Do_It!                ;Post changes
  99.    Reset                 ;Clear workspace
  100.  
  101. Endproc
  102. Writelib DemoLib DataEntry
  103. Release Procs DataEntry
  104.  
  105. Play "Ordrdpa"      ;Define DPA proc for Orders table
  106. Writelib DemoLib TKOrders_F
  107. Release Procs TKOrders_F
  108.  
  109. Play "Custdpa"      ;Define DPA proc for Cust
  110. Writelib DemoLib TKCust_F
  111. Release Procs TKCust_F
  112.  
  113. Play "Invdpa"       ;Define DPA proc for Invoice
  114. Writelib DemoLib TKInvoice_F
  115. Release Procs TKCust_F
  116.  
  117. Release Vars TableName, FormId, BorrowFile
  118.  
  119. Play "InvDemo"      ;InvDemo contains custom procedures for the Invoice table
  120. Play "CustDemo"     ;Contains procedures for Cust
  121. Play "OrdrDemo"     ;Contains procedures for Orders
  122. Play "HelpDemo"     ;Contains inactivity commentary procedures
  123.