home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / database / tools401.zip / DS4_UTIL.SC
Text File  |  1993-05-25  |  179KB  |  4,022 lines

  1. ; ****************************************************************************
  2. ;       TITLE: DS4_UTIL.sc  (DS4UTL.EXE - Self-extracting file)
  3. ;     DEVTEAM: Dan Paolini - Micah Bleecher - Pat Paolini - David Kelton
  4. ;   COPYRIGHT: (c) 1991, 1992, 1993 - DataStar International
  5. ; DESCRIPTION: Over 50 Paradox 4 Generic Utilities from DataStar.
  6. ;
  7. ;              This is a sample of the over 200 routines in Paladin 4.0,
  8. ;              which will be shipping in May, 1993, from dp Solutions.
  9. ;              Paladin 4 contains an extensive library of routines for
  10. ;              Paradox 4, and an extensive library of routines for Paradox
  11. ;              3.5 and 4.0 Compatible mode, which simulate appearance and
  12. ;              behavior of 4.0 Standard mode.  It also includes a Help
  13. ;              system generator for Paradox 4, and the original Paladin 1.01,
  14. ;              which was a menu and help system generator for Paradox 3.
  15. ;              All source code is included!  The product may be obtained
  16. ;              from:
  17. ;                       dp Solutions
  18. ;                       3111 Route 38 #11
  19. ;                       Mount Laurel, NJ  08054  USA
  20. ;                       609.265.9500
  21. ;
  22. ;              "PALADIN" is a 1992 Paradox Informant Readers' Choice Award
  23. ;              Winner, includes all source code, and lists for $99.
  24. ;
  25. ;              Please note that these procedures are all FREEWARE.  You may
  26. ;              use them freely in your own applications, providing you make
  27. ;              acknowledgement of their source in your script comments.  You
  28. ;              are under no obligation to purchase Paladin.  These routines
  29. ;              are provided without warranty.  Use and enjoy!
  30. ;
  31. ;              Dan Paolini - dp Solutions - DataStar International
  32. ;
  33. ; ============================================================================
  34. ;       TITLE: dbAlert.l                (c) 1991 - 1993 DataStar International
  35. ;     RETURNS: True, for dBox Event Handler
  36. ; DESCRIPTION: Dialog Event Handler proc for IDLE event Alerts
  37. ; ----------------------------------------------------------------------------
  38. PROC dbAlert.l()                 ; Idle Alert called from Event Handler
  39. Private  n1, n2                  ; Transient loop counter
  40. ;Global  alert.n                 ; Alert Value from dBox (0 - 5)
  41. ;        onceflag.l              ; For non-continuous Alert (1, 2)
  42.    IF NOT IsAssigned(onceflag.l) THEN
  43.       onceflag.l = true
  44.    ENDIF
  45.    SWITCH
  46.       CASE alert.n = 1 AND onceflag.l :
  47.          Beep Sleep 50
  48.          Beep Sleep 50
  49.          Beep
  50.          onceflag.l = false            ; Turns off subsequent Alerts
  51.       CASE alert.n = 2 AND onceflag.l :
  52.          Sound 770 150
  53.          Sound 440 150
  54.          Sound 770 150
  55.          Sound 440 150
  56.          Sound 770 150
  57.          onceflag.l = false            ; Turns off subsequent Alerts
  58.       CASE alert.n = 3  :
  59.          Beep Sleep 50 Beep Sleep 1000
  60.       CASE alert.n = 4  :
  61.          Sound 300 50 Sleep 100
  62.          Sound 300 50 Sleep 100
  63.          Sound 150 50 Sleep 100
  64.          Sound 150 50 Sleep 100
  65.          Sleep 200
  66.       CASE alert.n = 5  :
  67.          Sound 770 150
  68.          Sound 440 150
  69.       CASE alert.n = 86 and onceflag.l :
  70.          FOR n1 From 4 To 0 Step -1
  71.             FOR n2 From 11 To 0 Step -1
  72.                Sound Int(Pow(2,n1+n2/12)*110) 5
  73.             ENDFOR
  74.          ENDFOR
  75.          Sound 10 3000
  76.          onceflag.l = false            ; Turns off subsequent Alerts
  77.    ENDSWITCH
  78.    Return true
  79. ENDPROC
  80. ; ============================================================================
  81. ;       TITLE: dbButtonPress.v          (c) 1991 - 1993 DataStar International
  82. ;     RETURNS: Whatever value is passed as parameter
  83. ; DESCRIPTION: Adds 300 millisecond delay to PushButton press
  84. ; ----------------------------------------------------------------------------
  85. PROC dbButtonPress.v(            ; Adds 300 ms delay to button press
  86.          retval.v)               ; Value to assign to Pushbutton variable
  87.    Sleep 300
  88.    Return retval.v
  89. ENDPROC
  90. ; ============================================================================
  91. ;       TITLE: dbEventHandler.l         (c) 1991 - 1993 DataStar International
  92. ;     RETURNS: Logical true/false id dBox accepted
  93. ; DESCRIPTION: Generic Dialog Box Event Handler
  94. ; ----------------------------------------------------------------------------
  95. PROC dbEventHandler.l(           ; Alert Siren in Idle Dialog Box
  96.          type.a,                 ; EVENT, or TRIGGER Name
  97.          tag.a,                  ; Control element tag or null
  98.          event.v,                ; DynArray of GetEvent, or control value
  99.          element.a)              ; Checkbox label or null
  100. Private  h,                      ; Transient window handle
  101.          y,                      ; Transient window attributes dynarray
  102.          retval.l,               ; Value to return
  103.          dboxcolors.y,           ; Custom Dialog Box Color Palette
  104.          proctag.a               ; Trigger name, or event type
  105. ;Global  alert.n                 ; Alert Value from dBox (0 - 5)
  106. ;        onceflag.l              ; For non-continuous Alert (1, 2)
  107. ;        dboxpalette.a           ; Palette name for custom colors
  108. ;        starticks.n             ; Starting Ticks, if assigned, enables timeout
  109. ;        frametag.a              ; Can be used by calling proc to paint frame
  110.    retval.l = true
  111.    SWITCH
  112.       CASE type.a = "OPEN" :
  113.          IF IsAssigned(dboxprocs.y["OPEN"]) THEN
  114.             ExecProc dboxprocs.y["OPEN"]
  115.             retval.l = retval
  116.          ELSE
  117.             Window Handle Dialog To h
  118.             DynArray y[]
  119.                y["OriginRow"] = toprow.n
  120.                y["OriginCol"] = leftcol.n
  121.             IF IsAssigned(dboxpalette.a) AND NOT IsBlank(dboxpalette.a) THEN
  122.                dbPaletteSet.u(dboxpalette.a)
  123.                Window SetColors h From dboxcolors.y
  124.                RepaintDialog
  125.             ENDIF
  126.             Window SetAttributes h From y
  127.          ENDIF
  128.       CASE type.a = "IDLE" :
  129.          IF IsAssigned(dboxprocs.y["IDLE"]) THEN
  130.             ExecProc dboxprocs.y["IDLE"]
  131.             retval.l = retval
  132.          ELSE
  133.             IF IsAssigned(starticks.n) AND Ticks() > starticks.n + 600000 THEN
  134.                CancelDialog
  135.             ENDIF
  136.          ENDIF
  137.       OTHERWISE :
  138.          proctag.a = IIF(type.a = "EVENT",event.v["Type"],type.a)
  139.          IF IsAssigned(dboxprocs.y[proctag.a]) THEN
  140.             ExecProc dboxprocs.y[proctag.a]
  141.             retval.l = retval
  142.          ENDIF
  143.    ENDSWITCH
  144.    frametag.a = tag.a
  145.    RepaintDialog
  146.    Return retval.l
  147. ENDPROC
  148. ; ============================================================================
  149. ;       TITLE: dbPaletteSet.u           (c) 1991 - 1993 DataStar International
  150. ;     RETURNS: No value (sets local global dynarray:  dboxcolors.y)
  151. ; DESCRIPTION: Creates a dynarray of dialog box colors based upon palette.a
  152. ; ----------------------------------------------------------------------------
  153. PROC dbPaletteSet.u(             ; Creates Palette for Dialog Boxes
  154.          palette.a)
  155. ;Global  dboxcolors.y
  156.    DynArray dboxcolors.y[]
  157.    SWITCH
  158.       CASE Upper(palette.a) = "BLUE" :
  159.          dboxcolors.y["1"]  = 27   ; Active dialog box frame and title
  160.          dboxcolors.y["2"]  = 26   ; Selected dialog box frame when dragging
  161.          dboxcolors.y["3"]  = 48   ; Scroll bar
  162.          dboxcolors.y["4"]  = 63   ; Scroll bar controls
  163.          dboxcolors.y["5"]  = 31   ; Default background text
  164.          dboxcolors.y["6"]  = 23   ; Label when linked control is inactive
  165.          dboxcolors.y["7"]  = 31   ; Label when linked control is active
  166.          dboxcolors.y["8"]  = 30   ; Label hot key
  167.          dboxcolors.y["9"]  = 48   ; Text for normal   push button label
  168.          dboxcolors.y["10"] = 59   ; Text for default  push button label
  169.          dboxcolors.y["11"] = 63   ; Text for selected push button label
  170.          dboxcolors.y["13"] = 62   ; Hot key for push button label
  171.          dboxcolors.y["14"] = 16   ; Button shadow
  172.          dboxcolors.y["16"] = 27   ; Normal      radio button / check box
  173.          dboxcolors.y["16"] = 31   ; Highlighted radio button / check box
  174.          dboxcolors.y["17"] = 30   ; Hot key for radio button / check box
  175.          dboxcolors.y["18"] = 63   ; Normal   typein box text
  176.          dboxcolors.y["19"] = 47   ; Selected typein box text
  177.          dboxcolors.y["20"] = 49   ; Typein box arrows
  178.          dboxcolors.y["25"] = 48   ; Normal   pick list item text
  179.          dboxcolors.y["26"] = 47   ; Selected text when pick list is active
  180.          dboxcolors.y["27"] = 63   ; Selected text when pick list is inactive
  181.          dboxcolors.y["28"] = 49   ; Column dividers
  182.          framehigh.n        = 25   ; Frame highlight (sunny side)
  183.          framelow.n         = 16   ; Frame lowlight (shadow side)
  184.       CASE Upper(palette.a) = "RED" :
  185.          dboxcolors.y["1"]  = 79   ; Active dialog box frame and title
  186.          dboxcolors.y["2"]  = 75   ; Selected dialog box frame when dragging
  187.          dboxcolors.y["3"]  = 112  ; Scroll bar
  188.          dboxcolors.y["4"]  = 127  ; Scroll bar controls
  189.          dboxcolors.y["5"]  = 71   ; Default background text
  190.          dboxcolors.y["6"]  = 65   ; Label when linked control is inactive
  191.          dboxcolors.y["7"]  = 79   ; Label when linked control is active
  192.          dboxcolors.y["8"]  = 78   ; Label hot key
  193.          dboxcolors.y["9"]  = 112  ; Text for normal   push button label
  194.          dboxcolors.y["10"] = 116  ; Text for default  push button label
  195.          dboxcolors.y["11"] = 127  ; Text for selected push button label
  196.          dboxcolors.y["13"] = 126  ; Hot key for push button label
  197.          dboxcolors.y["14"] = 64   ; Button shadow
  198.          dboxcolors.y["16"] = 71   ; Normal      radio button / check box
  199.          dboxcolors.y["16"] = 79   ; Highlighted radio button / check box
  200.          dboxcolors.y["17"] = 78   ; Hot key for radio button / check box
  201.          dboxcolors.y["18"] = 31   ; Normal   typein box text
  202.          dboxcolors.y["19"] = 47   ; Selected typein box text
  203.          dboxcolors.y["20"] = 27   ; Typein box arrows
  204.          dboxcolors.y["25"] = 112  ; Normal   pick list item text
  205.          dboxcolors.y["26"] = 31   ; Selected text when pick list is active
  206.          dboxcolors.y["27"] = 127  ; Selected text when pick list is inactive
  207.          dboxcolors.y["28"] = 116  ; Column dividers
  208.          framehigh.n        = 76   ; Frame highlight (sunny side)
  209.          framelow.n         = 64   ; Frame lowlight (shadow side)
  210.       CASE Upper(palette.a) = "CYAN" :
  211.          dboxcolors.y["1"]  = 63   ; Active dialog box frame and title
  212.          dboxcolors.y["2"]  = 59   ; Selected dialog box frame when dragging
  213.          dboxcolors.y["3"]  = 23   ; Scroll bar
  214.          dboxcolors.y["4"]  = 31   ; Scroll bar controls
  215.          dboxcolors.y["5"]  = 49   ; Default background text
  216.          dboxcolors.y["6"]  = 48   ; Label when linked control is inactive
  217.          dboxcolors.y["7"]  = 63   ; Label when linked control is active
  218.          dboxcolors.y["8"]  = 62   ; Label hot key
  219.          dboxcolors.y["9"]  = 27   ; Text for normal   push button label
  220.          dboxcolors.y["10"] = 29   ; Text for default  push button label
  221.          dboxcolors.y["11"] = 31   ; Text for selected push button label
  222.          dboxcolors.y["13"] = 30   ; Hot key for push button label
  223.          dboxcolors.y["14"] = 48   ; Button shadow
  224.          dboxcolors.y["16"] = 49   ; Normal      radio button / check box
  225.          dboxcolors.y["16"] = 63   ; Highlighted radio button / check box
  226.          dboxcolors.y["17"] = 62   ; Hot key for radio button / check box
  227.          dboxcolors.y["18"] = 31   ; Normal   typein box text
  228.          dboxcolors.y["19"] = 47   ; Selected typein box text
  229.          dboxcolors.y["20"] = 27   ; Typein box arrows
  230.          dboxcolors.y["25"] = 112  ; Normal   pick list item text
  231.          dboxcolors.y["26"] = 31   ; Selected text when pick list is active
  232.          dboxcolors.y["27"] = 127  ; Selected text when pick list is inactive
  233.          dboxcolors.y["28"] = 115  ; Column dividers
  234.          framehigh.n        = 59   ; Frame highlight (sunny side)
  235.          framelow.n         = 48   ; Frame lowlight (shadow side)
  236.       CASE Upper(palette.a) = "GREEN" :
  237.          dboxcolors.y["1"]  = 47   ; Active dialog box frame and title
  238.          dboxcolors.y["2"]  = 43   ; Selected dialog box frame when dragging
  239.          dboxcolors.y["3"]  = 96   ; Scroll bar
  240.          dboxcolors.y["4"]  = 111  ; Scroll bar controls
  241.          dboxcolors.y["5"]  = 32   ; Default background text
  242.          dboxcolors.y["6"]  = 42   ; Label when linked control is inactive
  243.          dboxcolors.y["7"]  = 47   ; Label when linked control is active
  244.          dboxcolors.y["8"]  = 46   ; Label hot key
  245.          dboxcolors.y["9"]  = 27   ; Text for normal   push button label
  246.          dboxcolors.y["10"] = 29   ; Text for default  push button label
  247.          dboxcolors.y["11"] = 31   ; Text for selected push button label
  248.          dboxcolors.y["13"] = 30   ; Hot key for push button label
  249.          dboxcolors.y["14"] = 32   ; Button shadow
  250.          dboxcolors.y["16"] = 33   ; Normal      radio button / check box
  251.          dboxcolors.y["16"] = 47   ; Highlighted radio button / check box
  252.          dboxcolors.y["17"] = 46   ; Hot key for radio button / check box
  253.          dboxcolors.y["18"] = 112  ; Normal   typein box text
  254.          dboxcolors.y["19"] = 31   ; Selected typein box text
  255.          dboxcolors.y["20"] = 114  ; Typein box arrows
  256.          dboxcolors.y["25"] = 112  ; Normal   pick list item text
  257.          dboxcolors.y["26"] = 31   ; Selected text when pick list is active
  258.          dboxcolors.y["27"] = 127  ; Selected text when pick list is inactive
  259.          dboxcolors.y["28"] = 114  ; Column dividers
  260.          framehigh.n        = 42   ; Frame highlight (sunny side)
  261.          framelow.n         = 32   ; Frame lowlight (shadow side)
  262.       CASE Upper(palette.a) = "BROWN" :
  263.          dboxcolors.y["1"]  = 111  ; Active dialog box frame and title
  264.          dboxcolors.y["2"]  = 107  ; Selected dialog box frame when dragging
  265.          dboxcolors.y["3"]  = 112  ; Scroll bar
  266.          dboxcolors.y["4"]  = 127  ; Scroll bar controls
  267.          dboxcolors.y["5"]  = 96   ; Default background text
  268.          dboxcolors.y["6"]  = 97   ; Label when linked control is inactive
  269.          dboxcolors.y["7"]  = 111  ; Label when linked control is active
  270.          dboxcolors.y["8"]  = 110  ; Label hot key
  271.          dboxcolors.y["9"]  = 27   ; Text for normal   push button label
  272.          dboxcolors.y["10"] = 29   ; Text for default  push button label
  273.          dboxcolors.y["11"] = 31   ; Text for selected push button label
  274.          dboxcolors.y["13"] = 30   ; Hot key for push button label
  275.          dboxcolors.y["14"] = 96   ; Button shadow
  276.          dboxcolors.y["16"] = 97   ; Normal      radio button / check box
  277.          dboxcolors.y["16"] = 111  ; Highlighted radio button / check box
  278.          dboxcolors.y["17"] = 110  ; Hot key for radio button / check box
  279.          dboxcolors.y["18"] = 112  ; Normal   typein box text
  280.          dboxcolors.y["19"] = 47   ; Selected typein box text
  281.          dboxcolors.y["20"] = 118  ; Typein box arrows
  282.          dboxcolors.y["25"] = 112  ; Normal   pick list item text
  283.          dboxcolors.y["26"] = 47   ; Selected text when pick list is active
  284.          dboxcolors.y["27"] = 127  ; Selected text when pick list is inactive
  285.          dboxcolors.y["28"] = 118  ; Column dividers
  286.          framehigh.n        = 110  ; Frame highlight (sunny side)
  287.          framelow.n         = 96   ; Frame lowlight (shadow side)
  288.       CASE Upper(palette.a) = "MAGENTA" :
  289.          dboxcolors.y["1"]  = 95   ; Active dialog box frame and title
  290.          dboxcolors.y["2"]  = 91   ; Selected dialog box frame when dragging
  291.          dboxcolors.y["3"]  = 23   ; Scroll bar
  292.          dboxcolors.y["4"]  = 31   ; Scroll bar controls
  293.          dboxcolors.y["5"]  = 80   ; Default background text
  294.          dboxcolors.y["6"]  = 81   ; Label when linked control is inactive
  295.          dboxcolors.y["7"]  = 95   ; Label when linked control is active
  296.          dboxcolors.y["8"]  = 94   ; Label hot key
  297.          dboxcolors.y["9"]  = 27   ; Text for normal   push button label
  298.          dboxcolors.y["10"] = 29   ; Text for default  push button label
  299.          dboxcolors.y["11"] = 31   ; Text for selected push button label
  300.          dboxcolors.y["13"] = 30   ; Hot key for push button label
  301.          dboxcolors.y["14"] = 80   ; Button shadow
  302.          dboxcolors.y["16"] = 81   ; Normal      radio button / check box
  303.          dboxcolors.y["16"] = 95   ; Highlighted radio button / check box
  304.          dboxcolors.y["17"] = 94   ; Hot key for radio button / check box
  305.          dboxcolors.y["18"] = 112  ; Normal   typein box text
  306.          dboxcolors.y["19"] = 31   ; Selected typein box text
  307.          dboxcolors.y["20"] = 113  ; Typein box arrows
  308.          dboxcolors.y["25"] = 112  ; Normal   pick list item text
  309.          dboxcolors.y["26"] = 31   ; Selected text when pick list is active
  310.          dboxcolors.y["27"] = 127  ; Selected text when pick list is inactive
  311.          dboxcolors.y["28"] = 117  ; Column dividers
  312.          framehigh.n        = 93   ; Frame highlight (sunny side)
  313.          framelow.n         = 80   ; Frame lowlight (shadow side)
  314.       CASE Upper(palette.a) = "GRAY" :
  315.          dboxcolors.y["1"]  = 127  ; Active dialog box frame and title
  316.          dboxcolors.y["2"]  = 123  ; Selected dialog box frame when dragging
  317.          dboxcolors.y["3"]  = 19   ; Scroll bar
  318.          dboxcolors.y["4"]  = 27   ; Scroll bar controls
  319.          dboxcolors.y["5"]  = 112  ; Default background text
  320.          dboxcolors.y["6"]  = 113  ; Label when linked control is inactive
  321.          dboxcolors.y["7"]  = 127  ; Label when linked control is active
  322.          dboxcolors.y["8"]  = 126  ; Label hot key
  323.          dboxcolors.y["9"]  = 32   ; Text for normal   push button label
  324.          dboxcolors.y["10"] = 43   ; Text for default  push button label
  325.          dboxcolors.y["11"] = 47   ; Text for selected push button label
  326.          dboxcolors.y["13"] = 46   ; Hot key for push button label
  327.          dboxcolors.y["14"] = 112  ; Button shadow
  328.          dboxcolors.y["16"] = 112  ; Normal      radio button / check box
  329.          dboxcolors.y["16"] = 127  ; Highlighted radio button / check box
  330.          dboxcolors.y["17"] = 126  ; Hot key for radio button / check box
  331.          dboxcolors.y["18"] = 31   ; Normal   typein box text
  332.          dboxcolors.y["19"] = 47   ; Selected typein box text
  333.          dboxcolors.y["20"] = 26   ; Typein box arrows
  334.          dboxcolors.y["25"] = 48   ; Normal   pick list item text
  335.          dboxcolors.y["26"] = 47   ; Selected text when pick list is active
  336.          dboxcolors.y["27"] = 63   ; Selected text when pick list is inactive
  337.          dboxcolors.y["28"] = 55   ; Column dividers
  338.          framehigh.n        = 127  ; Frame highlight (sunny side)
  339.          framelow.n         = 112  ; Frame lowlight (shadow side)
  340.    ENDSWITCH
  341.    Return
  342. ENDPROC
  343. ;=============================================================================
  344. ;       TITLE: hsEngine.u              (c) 1992, 1993 DataStar International
  345. ;     RETURNS: No value
  346. ; DESCRIPTION: Main help engine procedure. Expects global dynarray called
  347. ;              g.help.y to contain tags pointing to procedure created by
  348. ;              the help compiler the load the necessary text strings into
  349. ;              the proper arrays.
  350. ;-----------------------------------------------------------------------------
  351. PROC hsEngine.u(                 ; Engine for Context Help Dialog System
  352.          context.a,              ; Help procedure DynArray tag
  353.          g.help.y)               ; Help Procedure DynArray
  354. Private  help.n,                 ; pick array index
  355.          colorshelp.y,           ; color attributes of dialog box
  356.          prompts.y,              ; prompts on dialog box
  357.          helptag.a,              ; current element
  358.          seealso.r,              ; array of linked topics
  359.          seealsotitles.r,        ; array of linked topic titles
  360.          title.a,                ; current title
  361.          dbox.w,                 ; DB window handle
  362.          pushbutton.l,           ; button variable
  363.          helptext.r,             ; array of help text
  364.          retval.v                ; return variable
  365.  
  366.  
  367.    DynArray colorshelp.y[]
  368.       colorshelp.y[1032] = 116
  369.       colorshelp.y[1034] = 15
  370.       colorshelp.y[1035] = 15
  371.       colorshelp.y[1056] = 112
  372.       colorshelp.y[1057] = 112
  373.       colorshelp.y[1058] = 112
  374.    SetColors From colorshelp.y
  375.    IF IsAssigned(g.help.y[context.a]) THEN
  376.       ExecProc g.help.y[context.a]
  377.       ; This procedure should assign the memovar for help, as well as
  378.       ; the ShowPullDown Menu
  379.    ELSE
  380.       ; Default Help Text and Menu
  381.       IF IsAssigned(g.help.y["DEFAULT"]) THEN
  382.          EXECPROC g.help.y["DEFAULT"]
  383.       ELSE
  384.       Array helptext.r[31]
  385.  
  386.       helptext.r[1] = ""
  387.       helptext.r[2] = ""
  388.       helptext.r[3] = "      ─── Help on Using the DataStar Help System ──┐"
  389.       helptext.r[4] = "                                                    │"
  390.       helptext.r[5] = "                                                    │"
  391.       helptext.r[6] = "            Help ▄    Brings Up This Screen.        │"
  392.       helptext.r[7] = "         ▀▀▀▀▀▀▀▀▀                                  │"
  393.       helptext.r[8] = "       ┌────────────────────────────────────────────┘"
  394.       helptext.r[9] = "       │"
  395.       helptext.r[10] = "       │"
  396.       helptext.r[11] = "       │  Index  ▄    Displays Index of Help Topics."
  397.       helptext.r[12] = "       │ ▀▀▀▀▀▀▀▀▀"
  398.       helptext.r[13] = "       └─────────────────────────────────────────────┐"
  399.       helptext.r[14] = "                                                     │"
  400.       helptext.r[15] = "                                                     │"
  401.       helptext.r[16] = "          SeeAlso ▄   Displays List of Linked Topics │"
  402.       helptext.r[17] = "         ▀▀▀▀▀▀▀▀▀▀   if any Exist.                  │"
  403.       helptext.r[18] = "                                                     │"
  404.       helptext.r[19] = "       ┌─────────────────────────────────────────────┘"
  405.       helptext.r[20] = "       │"
  406.       helptext.r[21] = "       │"
  407.       helptext.r[22] = "       │   Print  ▄   Sends Current Help Screen To"
  408.       helptext.r[23] = "       │ ▀▀▀▀▀▀▀▀▀▀   the Printer."
  409.       helptext.r[24] = "       │"
  410.       helptext.r[25] = "       └─────────────────────────────────────────────┐"
  411.       helptext.r[26] = "                                                     │"
  412.       helptext.r[27] = "           Exit   ▄   Exit the Help System Back to   │"
  413.       helptext.r[28] = "         ▀▀▀▀▀▀▀▀▀▀   the Application.               │"
  414.       helptext.r[29] = "                                                     │"
  415.       helptext.r[30] = "                                                     │"
  416.       helptext.r[31] = "      ──────────────────────────────────────────────┘"
  417.  
  418.       Array seealso.r[1]
  419.       Array seealsotitles.r[1]
  420.       ENDIF
  421.    ENDIF
  422.  
  423.    DynArray prompts.y[]
  424.       prompts.y["TEXT"]  = "Use Mouse, Cursor  Keys or <PgUp>/<PgDn> to Scroll Help Text"
  425.       prompts.y["HELP"]  = "How to Use the Help System"
  426.       prompts.y["INDEX"] = "Index of Available Help Screens"
  427.       prompts.y["ALSO"]  = "Menu of Related Help Topics"
  428.       prompts.y["PRINT"] = "Print this Help Screen"
  429.       prompts.y["BACK"]  = "Return to Previous Help Screen"
  430.       prompts.y["EXIT"]  = "Return to what you were doing before Help"
  431.  
  432.    retval.v     = ""
  433.    pushbutton.l = false
  434.    helptag.a = "TEXT"
  435.    title.a = IIF(IsAssigned(g.helpindex.y[context.a]),
  436.                             g.helpindex.y[context.a],
  437.                            "Application Help System")
  438.  
  439.    SHOWDIALOG title.a
  440.       PROC "hsEngineEP.l"
  441.          Trigger "ARRIVE","OPEN"  ;MJB 1/27/93
  442.       @ 2, 3 Height 20 Width 74
  443.  
  444.       PaintCanvas Fill Format("w70,ac",prompts.y[helptag.a])
  445.                   Attribute 113 17,1,17,70
  446.  
  447.       Frame Single From 0,1 To 14,70
  448.       PaintCanvas Border Attribute 127 0,1,14,70
  449.       PaintCanvas Attribute 112 0,1,0,69
  450.       PaintCanvas Attribute 112 0,1,14,1
  451.  
  452.       PickArray
  453.          @ 1,2
  454.          Height 13 Width 67
  455.          helptext.r Tag "TEXT"
  456.       To help.n
  457.  
  458.       PushButton @ 15, 5 Width 8 "~H~elp"
  459.          Value hsEngineHelp.l() Tag "HELP"
  460.       To pushbutton.l
  461.  
  462.       PushButton @ 15, 17 Width 9 "~I~ndex"
  463.          Value hsEngineIndex.l(g.helpindex.y)
  464.          Tag "INDEX"
  465.       To pushbutton.l
  466.  
  467.       PushButton @ 15, 30 Width 12 "~S~ee Also"
  468.          Value hsEngineSeeAlso.l(seealso.r,seealsotitles.r) Tag "ALSO"
  469.       To pushbutton.l
  470.  
  471.       PushButton @ 15, 46 Width 9 "~P~rint"
  472.          Value hsEnginePrint.l(helptext.r) Tag "PRINT"
  473.       To pushbutton.l
  474.  
  475.       PushButton @ 15, 59 Width 8 "~E~xit"
  476.          Cancel Value False Tag "EXIT"
  477.       To pushbutton.l
  478.    ENDDIALOG
  479.    SetColors From g.appcolors.y
  480.    msWorkingClear.u()
  481.    Return
  482. ENDPROC
  483. ;===========================================================================
  484. ;       TITLE: hsEngineEP.l
  485. ;      AUTHOR: (c) 1992 - DataStar International
  486. ;     RETURNS: Nothing
  487. ; DESCRIPTION: Event proc for help engine dialog boxes
  488. ;---------------------------------------------------------------------------
  489. PROC hsEngineEP.l(               ; Help Engine Event Handler
  490.          type.a,                 ; event type or trigger
  491.          tag.a,                  ; name of current TAG
  492.          event.v,                ; event bag
  493.          element.a)              ; element for check boxes
  494.    IF type.a = "OPEN" THEN
  495.       WINDOW HANDLE DIALOG TO dbox.w
  496.    ENDIF
  497.    helptag.a = tag.a
  498.    RepaintDialog
  499.    Return true
  500. ENDPROC
  501. ;===========================================================================
  502. ;       TITLE: hsEngineHelp.l          (c) 1992, 1993 DataStar International
  503. ;     RETURNS: Logical true/false if
  504. ; DESCRIPTION:
  505. ;---------------------------------------------------------------------------
  506. PROC hsEngineHelp.l()            ; Help for the Help Engine
  507. Private  helptext.r,             ; array of help text
  508.          pushbutton.l,           ; pushbutton variable
  509.          help.n,                 ; pickarray index
  510.          helptag.a               ; current element
  511.  
  512.    IF IsAssigned(g.help.y["HELP"]) THEN
  513.       EXECPROC g.help.y["HELP"]
  514.    ELSE
  515.       Array helptext.r[31]
  516.  
  517.       helptext.r[1] = ""      ;default help text
  518.       helptext.r[2] = ""
  519.       helptext.r[3] = "      ─── Help on Using the DataStar Help System ──┐"
  520.       helptext.r[4] = "                                                    │"
  521.       helptext.r[5] = "                                                    │"
  522.       helptext.r[6] = "            Help ▄    Brings Up This Screen.        │"
  523.       helptext.r[7] = "         ▀▀▀▀▀▀▀▀▀                                  │"
  524.       helptext.r[8] = "       ┌────────────────────────────────────────────┘"
  525.       helptext.r[9] = "       │"
  526.       helptext.r[10] = "       │"
  527.       helptext.r[11] = "       │  Index  ▄    Displays Index of Help Topics."
  528.       helptext.r[12] = "       │ ▀▀▀▀▀▀▀▀▀"
  529.       helptext.r[13] = "       └─────────────────────────────────────────────┐"
  530.       helptext.r[14] = "                                                     │"
  531.       helptext.r[15] = "                                                     │"
  532.       helptext.r[16] = "          SeeAlso ▄   Displays List of Linked Topics │"
  533.       helptext.r[17] = "         ▀▀▀▀▀▀▀▀▀▀   if any Exist.                  │"
  534.       helptext.r[18] = "                                                     │"
  535.       helptext.r[19] = "       ┌─────────────────────────────────────────────┘"
  536.       helptext.r[20] = "       │"
  537.       helptext.r[21] = "       │"
  538.       helptext.r[22] = "       │   Print  ▄   Sends Current Help Screen To"
  539.       helptext.r[23] = "       │ ▀▀▀▀▀▀▀▀▀▀   the Printer."
  540.       helptext.r[24] = "       │"
  541.       helptext.r[25] = "       └─────────────────────────────────────────────┐"
  542.       helptext.r[26] = "                                                     │"
  543.       helptext.r[27] = "           Exit   ▄   Exit the Help System Back to   │"
  544.       helptext.r[28] = "         ▀▀▀▀▀▀▀▀▀▀   the Application.               │"
  545.       helptext.r[29] = "                                                     │"
  546.       helptext.r[30] = "                                                     │"
  547.       helptext.r[31] = "      ──────────────────────────────────────────────┘"
  548.  
  549.      Array seealso.r[1]
  550.    ENDIF
  551.    helptag.a = "TEXT"
  552.  
  553.    SHOWDIALOG "Help on Using Help"
  554.       PROC "hsEngineEP.l"
  555.          Trigger "ARRIVE"
  556.       @ 2, 3 Height 20 Width 74
  557.       PaintCanvas Fill Format("w70,ac",prompts.y[helptag.a])
  558.                   Attribute 113 17,1,17,70
  559.       Frame Single From 0,1 To 14,70
  560.       PaintCanvas Border Attribute 127 0,1,14,70
  561.       PaintCanvas Attribute 112 0,1,0,69
  562.       PaintCanvas Attribute 112 0,1,14,1
  563.       PickArray
  564.          @ 1,2
  565.          Height 13 Width 67
  566.          helptext.r Tag "TEXT"
  567.       To help.n
  568.  
  569.       PushButton @ 15, 24 Width 24 "~P~revious Help Screen"
  570.          OK Value True Tag "BACK"
  571.       To pushbutton.l
  572.    ENDDIALOG
  573.    Return true
  574. ENDPROC
  575. ;===========================================================================
  576. ;       TITLE: hsEngineIndex.l            (c) 1993 - DataStar International
  577. ;     RETURNS: Logical true
  578. ; DESCRIPTION: Help System index. Select with index button on the help DB.
  579. ;---------------------------------------------------------------------------
  580. PROC hsEngineIndex.l(            ; Help System Index Engine
  581.          helpindex.y)            ; index dynarray
  582. Private  pushbutton.l,           ; button variable
  583.          y                       ; window attributes dynarray
  584.  
  585.    IF DynarraySize(helpindex.y) = 0 THEN
  586.       msWorking.u("Sorry, No Help Index is Available in this System",111,2,2)
  587.    ELSE
  588.       pushbutton.l = false
  589.       dynarray y[]
  590.  
  591.       SetColors From g.appcolors.y
  592.  
  593.       SHOWDIALOG "Select Help Topic"
  594.          @ 3,17 Height 15 Width 49 ;46 MJB 1/27/93
  595.          PickDynArray
  596.             @ 1,1 Height 9 Width 43
  597.             helpindex.y Tag "PICKINDEX"
  598.          To context.a
  599.  
  600.          PushButton @ 11,8 Width 10 "~S~elect"
  601.             OK Default Value True Tag "INDEXBUTTON"
  602.          To pushbutton.l
  603.  
  604.          PushButton @ 11,26 Width 10 "~C~ancel"
  605.             Cancel Value False Tag "INDEXBUTTON"
  606.          To pushbutton.l
  607.       ENDDIALOG
  608.       SetColors From colorshelp.y
  609.  
  610.       IF pushbutton.l THEN
  611.          ExecProc g.help.y[context.a]
  612.          y["Title"] = IIF(IsAssigned(g.helpindex.y[context.a]),
  613.                                  g.helpindex.y[context.a],
  614.                                  "Application Help System")
  615.          WINDOW SetAttributes dbox.w FROM y
  616.          help.n = 1
  617.          RefreshDialog
  618.          SelectControl "TEXT"
  619.       ENDIF
  620.    ENDIF
  621.    Return true
  622. ENDPROC
  623. ;===========================================================================
  624. ;       TITLE: hsEngineSeeAlso.l       (c) 1992, 1993 DataStar International
  625. ;     RETURNS: Logical true/false
  626. ; DESCRIPTION:
  627. ;---------------------------------------------------------------------------
  628. PROC hsEngineSeeAlso.l(          ; Help System See-Also Engine
  629.          seealso.r,              ; Array of module names
  630.          seealsotitles.r)        ; Array of help screen titles
  631. Private  seealso.v,              ; return variable from ioPickArray
  632.          helptag.a,              ; current element
  633.          retval.l,               ; return variable
  634.          help.n,                 ; pick array index
  635.          helptext.r,             ; help text array
  636.          pushbutton.l            ; button variable
  637.    retval.l = true
  638.  
  639.    WHILE true
  640.       IF IsAssigned(seealso.r[1]) THEN
  641.  
  642.          SetColors From g.appcolors.y
  643.          seealso.v = ioPickArrayDialog.v(seealsotitles.r, 43,
  644.                               "Select See Also Help Topic",
  645.                               "Help Topics",3,17,"")
  646.          SetColors From colorshelp.y
  647.          IF seealso.v <> "" THEN
  648.             IF IsAssigned(seealso.r[seealso.v]) THEN
  649.                EXECPROC "hsHelp" + seealso.r[seealso.v] + ".u"
  650.             ELSE
  651.                retval.l = false
  652.                QUITLOOP
  653.             ENDIF
  654.          ELSE
  655.             QUITLOOP
  656.          ENDIF
  657.       ELSE
  658.          retval.l = false
  659.          QUITLOOP
  660.       ENDIF
  661.  
  662.       helptag.a = "TEXT"
  663.       SHOWDIALOG seealsotitles.r[seealso.v]
  664.          PROC "hsEngineEP.l"
  665.             Trigger "ARRIVE"
  666.          @ 2, 3 Height 20 Width 74
  667.          PaintCanvas Fill Format("w70,ac",prompts.y[helptag.a])
  668.                      Attribute 113 17,1,17,70
  669.          Frame Single From 0,1 To 14,70
  670.          PaintCanvas Border Attribute 127 0,1,14,70
  671.          PaintCanvas Attribute 112 0,1,0,69
  672.          PaintCanvas Attribute 112 0,1,14,1
  673.          PickArray
  674.             @ 1,2
  675.             Height 13 Width 67
  676.             helptext.r Tag "TEXT"
  677.          To help.n
  678.  
  679.          PushButton @ 15, 24 Width 24 "~P~revious Help Screen"
  680.             OK Value True Tag "BACK"
  681.          To pushbutton.l
  682.       ENDDIALOG
  683.       QUITLOOP
  684.    ENDWHILE
  685.    IF NOT retval.l THEN
  686.     msWorking.u("No Links Available for this Topic - Choose <Index>",31, 3, 2)
  687.    ENDIF
  688.    Return retval.l
  689. ENDPROC
  690. ;===========================================================================
  691. ;       TITLE: hsEnginePrint.l         (c) 1992, 1993 DataStar International
  692. ;     RETURNS: Logical true/false if
  693. ; DESCRIPTION:
  694. ;---------------------------------------------------------------------------
  695. PROC hsEnginePrint.l(            ; Help System Screen Print
  696.          helptext.r)             ; generic editor handler
  697. Private  n1, n2,                 ; counter variables
  698.          a,                      ; temp file name
  699.          file.m,                 ; memo text stream
  700.          line.n                  ; line number counter
  701.  
  702.    IF ioPrinterStatus.l() THEN   ; test printer
  703.       msWorking.u("One Moment - Printing Help Screen",31,0,0)
  704.       n1 = ArraySize(helptext.r)
  705.       a = PrivDir() + StrVal(Ticks())
  706.  
  707.       file.m = "\n" + Format("w80,ac","Help Screen: " + g.helpindex.y[context.a])
  708.       file.m = file.m + "\n" + Spaces(10) + Fill("-",60) + "\n\n"
  709.       line.n = 3
  710.  
  711.       FOR n2 From 1 To n1
  712.          line.n = line.n + 1
  713.          file.m = file.m +  Spaces(10) + helptext.r[n2] + "\n"
  714.          IF line.n >= 55 AND line.n <> n1 THEN
  715.             file.m = file.m + "\012\n\n"
  716.             line.n = 2
  717.          ENDIF
  718.       ENDFOR
  719.  
  720.       file.m = file.m + "\012"
  721.       FileWrite a FROM file.m
  722.  
  723.       OPEN Printer
  724.          Run NOREFRESH "Copy " + a + " LPT1 > NUL"
  725.          EDITOR OPEN a DO_IT!
  726.       CLOSE Printer
  727.       msWorkingClear.u()
  728.    ENDIF
  729.    Return true
  730. ENDPROC
  731. ; ===========================================================================
  732. ;       TITLE: hsHelpFind.u
  733. ;   GENERATED: 4/13/93 - 05:31:38
  734. ; DESCRIPTION: Help Screen: Help on Finding or Locating Data
  735. ; ---------------------------------------------------------------------------
  736. PROC hsHelpFind.u()              ; Help on Locating Data
  737. ;Global  helptext.r,             ; array of Help Text
  738. ;        seealso.r               ; array of See Also Links
  739. ;        seealsotitles.r         ; array of See Also Titles
  740.  
  741.    IF NOT IsAssigned(g.helpindex.y) THEN
  742.       Dynarray g.helpindex.y[]
  743.    ENDIF
  744.    g.helpindex.y["FIND"] = "Help on Finding or Locating Data"
  745.  
  746.    Array helptext.r[44]
  747.    Array seealso.r[4]
  748.    Array seealsotitles.r[4]
  749.  
  750.    helptext.r[1] = " There are several ways to search for data."
  751.    helptext.r[2] = " ────────────────────────────────────────────────────────────────"
  752.    helptext.r[3] = " While in a table:"
  753.    helptext.r[4] = ""
  754.    helptext.r[5] = "  1) [Home] moves to the first record in the table,"
  755.    helptext.r[6] = "     [End] moves to the last one."
  756.    helptext.r[7] = ""
  757.    helptext.r[8] = "  2) [Ctrl Z] Zooms to the first occurrence of a value for"
  758.    helptext.r[9] = "     the field that you are in."
  759.    helptext.r[10] = ""
  760.    helptext.r[11] = "     You will be asked to type in a search value."
  761.    helptext.r[12] = "     a) Enter the EXACT value for a case sensitive search."
  762.    helptext.r[13] = "        Example:  New York  Would not find NEW YORK or new york"
  763.    helptext.r[14] = ""
  764.    helptext.r[15] = "     b) Use wildcards for a case insensitive search."
  765.    helptext.r[16] = "           @  Any one character."
  766.    helptext.r[17] = "          ..  Any string of characters."
  767.    helptext.r[18] = ""
  768.    helptext.r[19] = "        Examples:  ..new..  In a city field would find the first"
  769.    helptext.r[20] = "                            field that has the word \"new\" in it."
  770.    helptext.r[21] = "                       @..  Finds first field that is not blank."
  771.    helptext.r[22] = ""
  772.    helptext.r[23] = "     * Note: leave Zoom blank to find the first blank value."
  773.    helptext.r[24] = ""
  774.    helptext.r[25] = "  3) [Alt Z] finds the next occurrence of the last Zoom value"
  775.    helptext.r[26] = "     specified."
  776.    helptext.r[27] = " ────────────────────────────────────────────────────────────────"
  777.    helptext.r[28] = " Select from the {Image} menu:"
  778.    helptext.r[29] = ""
  779.    helptext.r[30] = "        Zoom...   Same as pressing [Ctrl Z] to Zoom to the first"
  780.    helptext.r[31] = "                  occurrence of a value for the current field."
  781.    helptext.r[32] = ""
  782.    helptext.r[33] = "       ZoomNext   Same as pressing [Alt Z] to go to the next"
  783.    helptext.r[34] = "                  occurrence of the last value Zoomed in"
  784.    helptext.r[35] = "                  this field."
  785.    helptext.r[36] = ""
  786.    helptext.r[37] = "    Record #...   Enter a specific record number to move to."
  787.    helptext.r[38] = ""
  788.    helptext.r[39] = "  +# records...   Specify the number of records to move forward"
  789.    helptext.r[40] = "                  in the table."
  790.    helptext.r[41] = ""
  791.    helptext.r[42] = "  -# records...   Specify the number of records to move backward"
  792.    helptext.r[43] = "                  in the table."
  793.    helptext.r[44] = " ════════════════════════════════════════════════════════════════"
  794.  
  795.    seealso.r[1] = "HELP"
  796.    seealsotitles.r[1] = "Help on Using Help"
  797.    seealso.r[2] = "KEYS"
  798.    seealsotitles.r[2] = "Help Using The Keyboard"
  799.    seealso.r[3] = "MENUS"
  800.    seealsotitles.r[3] = "Help Using Application Menus"
  801.    seealso.r[4] = "MOUSE"
  802.    seealsotitles.r[4] = "Help for Using Your Mouse"
  803.  
  804.    Return
  805. ENDPROC
  806. ; ===========================================================================
  807. ;       TITLE: hsHelpHelp.u
  808. ;   GENERATED: 4/13/93 - 05:31:47
  809. ; DESCRIPTION: Help Screen: Help on Using Help
  810. ; ---------------------------------------------------------------------------
  811. PROC hsHelpHelp.u()              ; Help on using Help
  812. ;Global  helptext.r,             ; array of Help Text
  813. ;        seealso.r               ; array of See Also Links
  814. ;        seealsotitles.r         ; array of See Also Titles
  815.  
  816.    IF NOT IsAssigned(g.helpindex.y) THEN
  817.       Dynarray g.helpindex.y[]
  818.    ENDIF
  819.    g.helpindex.y["HELP"] = "Help on Using Help"
  820.  
  821.    Array helptext.r[31]
  822.    Array seealso.r[4]
  823.    Array seealsotitles.r[4]
  824.  
  825.    helptext.r[1] = ""
  826.    helptext.r[2] = ""
  827.    helptext.r[3] = "      ─── Help on Using the DataStar Help System ──┐"
  828.    helptext.r[4] = "                                                    │"
  829.    helptext.r[5] = "                                                    │"
  830.    helptext.r[6] = "            Help ▄    Brings Up This Screen.        │"
  831.    helptext.r[7] = "         ▀▀▀▀▀▀▀▀▀                                  │"
  832.    helptext.r[8] = "       ┌────────────────────────────────────────────┘"
  833.    helptext.r[9] = "       │"
  834.    helptext.r[10] = "       │"
  835.    helptext.r[11] = "       │  Index  ▄    Displays Index of Help Topics."
  836.    helptext.r[12] = "       │ ▀▀▀▀▀▀▀▀▀"
  837.    helptext.r[13] = "       └─────────────────────────────────────────────┐"
  838.    helptext.r[14] = "                                                     │"
  839.    helptext.r[15] = "                                                     │"
  840.    helptext.r[16] = "          SeeAlso ▄   Displays List of Linked Topics │"
  841.    helptext.r[17] = "         ▀▀▀▀▀▀▀▀▀▀   if any Exist.                  │"
  842.    helptext.r[18] = "                                                     │"
  843.    helptext.r[19] = "       ┌─────────────────────────────────────────────┘"
  844.    helptext.r[20] = "       │"
  845.    helptext.r[21] = "       │"
  846.    helptext.r[22] = "       │   Print  ▄   Sends Current Help Screen To"
  847.    helptext.r[23] = "       │ ▀▀▀▀▀▀▀▀▀▀   the Printer."
  848.    helptext.r[24] = "       │"
  849.    helptext.r[25] = "       └─────────────────────────────────────────────┐"
  850.    helptext.r[26] = "                                                     │"
  851.    helptext.r[27] = "           Exit   ▄   Exit the Help System Back to   │"
  852.    helptext.r[28] = "         ▀▀▀▀▀▀▀▀▀▀   the Application.               │"
  853.    helptext.r[29] = "                                                     │"
  854.    helptext.r[30] = "                                                     │"
  855.    helptext.r[31] = "      ──────────────────────────────────────────────┘"
  856.  
  857.    seealso.r[1] = "FIND"
  858.    seealsotitles.r[1] = "Help on Finding or Locating Data"
  859.    seealso.r[2] = "KEYS"
  860.    seealsotitles.r[2] = "Help Using The Keyboard"
  861.    seealso.r[3] = "MENUS"
  862.    seealsotitles.r[3] = "Help Using Application Menus"
  863.    seealso.r[4] = "MOUSE"
  864.    seealsotitles.r[4] = "Help for Using Your Mouse"
  865.    Return
  866. ENDPROC
  867. ; ===========================================================================
  868. ;       TITLE: hsHelpKeys.u
  869. ;   GENERATED: 4/13/93 - 05:32:05
  870. ; DESCRIPTION: Help Screen: Help Using The Keyboard
  871. ; ---------------------------------------------------------------------------
  872. PROC hsHelpKeys.u()              ; Help on using Keyboard
  873. ;Global  helptext.r,             ; array of Help Text
  874. ;        seealso.r               ; array of See Also Links
  875. ;        seealsotitles.r         ; array of See Also Titles
  876.  
  877.    IF NOT IsAssigned(g.helpindex.y) THEN
  878.       Dynarray g.helpindex.y[]
  879.    ENDIF
  880.    g.helpindex.y["KEYS"] = "Help Using The Keyboard"
  881.  
  882.    Array helptext.r[96]
  883.    Array seealso.r[4]
  884.    Array seealsotitles.r[4]
  885.  
  886.    helptext.r[1] = " ════════════════════════════════════════════════════════════════"
  887.    helptext.r[2] = " Cursor keys:"
  888.    helptext.r[3] = ""
  889.    helptext.r[4] = "               [Up] Next field up"
  890.    helptext.r[5] = "             [Down] Next field down"
  891.    helptext.r[6] = "             [Home] First record"
  892.    helptext.r[7] = "        [Ctrl Home] First field of form or table"
  893.    helptext.r[8] = "              [End] Last record"
  894.    helptext.r[9] = "         [Ctrl End] Last field of form or table"
  895.    helptext.r[10] = "             [Left] Previous field left"
  896.    helptext.r[11] = "        [Ctrl Left] Previous screen left"
  897.    helptext.r[12] = "            [Right] Next field right"
  898.    helptext.r[13] = "       [Ctrl Right] Next screen right"
  899.    helptext.r[14] = "             [PgUp] Next screen up"
  900.    helptext.r[15] = "        [Ctrl PgUp] Previous record, same field"
  901.    helptext.r[16] = "             [PgDn] Next screen down"
  902.    helptext.r[17] = "        [Ctrl PgDn] Next record, same field"
  903.    helptext.r[18] = " ────────────────────────────────────────────────────────────────"
  904.    helptext.r[19] = " Special keys:"
  905.    helptext.r[20] = ""
  906.    helptext.r[21] = "              [Esc] Exit table or menu"
  907.    helptext.r[22] = "              [F10] Activate menu"
  908.    helptext.r[23] = "          [Alt F10] Activate popup menu"
  909.    helptext.r[24] = "        [Alt Space] Select system menu choice (≡)"
  910.    helptext.r[25] = "               [F1] Field help if available"
  911.    helptext.r[26] = "               [F3] UpImage"
  912.    helptext.r[27] = "               [F4] DownImage"
  913.    helptext.r[28] = "               [F7] FormToggle"
  914.    helptext.r[29] = "        [Backspace] Delete character left of cursor"
  915.    helptext.r[30] = "   [Ctrl Backspace] Delete field"
  916.    helptext.r[31] = "           [Ctrl D] Ditto (copy field from previous record)"
  917.    helptext.r[32] = "           [Ctrl Z] Zoom to first occurrence of value"
  918.    helptext.r[33] = "            [Alt Z] ZoomNext"
  919.    helptext.r[34] = "            [Alt S] Set table sort order based on current field"
  920.    helptext.r[35] = "         [Shift F5] Maximize/Restore current window"
  921.    helptext.r[36] = "          [Ctrl F5] Move/Resize current window"
  922.    helptext.r[37] = "          [Ctrl F3] Go to previous window"
  923.    helptext.r[38] = "          [Ctrl F4] Go to next window"
  924.    helptext.r[39] = "          [Ctrl F8] Close current window"
  925.    helptext.r[40] = "           [Ctrl U] Undo last change to field or record"
  926.    helptext.r[41] = " ────────────────────────────────────────────────────────────────"
  927.    helptext.r[42] = " To allow cursor movement within a field (FieldView),"
  928.    helptext.r[43] = " press [Ctrl F] or [Alt F5]."
  929.    helptext.r[44] = " Cursor keys while in FieldView in a Regular field:"
  930.    helptext.r[45] = ""
  931.    helptext.r[46] = "             [Left] One character left"
  932.    helptext.r[47] = "        [Ctrl Left] One word left"
  933.    helptext.r[48] = "            [Right] One character right"
  934.    helptext.r[49] = "       [Ctrl Right] One word right"
  935.    helptext.r[50] = "             [Home] First character in field"
  936.    helptext.r[51] = "              [End] Last character in field"
  937.    helptext.r[52] = "              [Del] Delete character at cursor"
  938.    helptext.r[53] = "              [Ins] Toggle insert mode on/off"
  939.    helptext.r[54] = " ────────────────────────────────────────────────────────────────"
  940.    helptext.r[55] = " Cursor keys while in a Memo or Editor window:"
  941.    helptext.r[56] = ""
  942.    helptext.r[57] = "             [Left] One character left"
  943.    helptext.r[58] = "        [Ctrl Left] One word left"
  944.    helptext.r[59] = "       [Shift Left] Select one character left"
  945.    helptext.r[60] = "  [Ctrl Shift Left] Select one word left"
  946.    helptext.r[61] = "            [Right] One character right"
  947.    helptext.r[62] = "       [Ctrl Right] One word right"
  948.    helptext.r[63] = "      [Shift Right] Select one character right"
  949.    helptext.r[64] = " [Ctrl Shift Right] Select one word right"
  950.    helptext.r[65] = "             [Home] First character of line"
  951.    helptext.r[66] = "       [Shift Home] Select from cursor to start of line"
  952.    helptext.r[67] = "              [End] Last character of line"
  953.    helptext.r[68] = "        [Shift End] Select from cursor to end of line"
  954.    helptext.r[69] = "               [Up] Up one line"
  955.    helptext.r[70] = "         [Shift Up] Select one line up"
  956.    helptext.r[71] = "             [Down] Down one line"
  957.    helptext.r[72] = "       [Shift Down] Select one line down"
  958.    helptext.r[73] = "             [PgUp] Up one screen"
  959.    helptext.r[74] = "        [Ctrl PgUp] First character of memo"
  960.    helptext.r[75] = "       [Shift PgUp] Select from cursor up one screen"
  961.    helptext.r[76] = "  [Ctrl Shift PgUp] Select from cursor to first character of memo"
  962.    helptext.r[77] = "             [PgDn] Down one screen"
  963.    helptext.r[78] = "        [Ctrl PgDn] Last character of memo"
  964.    helptext.r[79] = "       [Shift PgDn] Select from cursor down one screen"
  965.    helptext.r[80] = "  [Ctrl Shift PgDn] Select from cursor to last character of memo"
  966.    helptext.r[81] = "              [Del] Delete selected text or character at cursor"
  967.    helptext.r[82] = "              [Ins] Toggle insert mode on/off"
  968.    helptext.r[83] = " ────────────────────────────────────────────────────────────────"
  969.    helptext.r[84] = " Text editing keys while in a Memo or Editor window:"
  970.    helptext.r[85] = ""
  971.    helptext.r[86] = "         [Ctrl Del] Cut selected text to Clipboard"
  972.    helptext.r[87] = "         [Ctrl Ins] Copy selected text to Clipboard"
  973.    helptext.r[88] = "        [Shift Ins] Paste Clipboard contents at cursor position"
  974.    helptext.r[89] = "            [Alt D] Delete from cursor position to end of word"
  975.    helptext.r[90] = "           [Ctrl Y] Delete entire cursor line"
  976.    helptext.r[91] = "           [Ctrl Z] Find a value"
  977.    helptext.r[92] = "            [Alt Z] Find next value"
  978.    helptext.r[93] = "           [Ctrl A] Replace a value with another value"
  979.    helptext.r[94] = "            [Alt A] Replace next value with replacement value"
  980.    helptext.r[95] = "            [Alt W] Show cursor position"
  981.    helptext.r[96] = " ════════════════════════════════════════════════════════════════"
  982.  
  983.    seealso.r[1] = "FIND"
  984.    seealsotitles.r[1] = "Help on Finding or Locating Data"
  985.    seealso.r[2] = "HELP"
  986.    seealsotitles.r[2] = "Help on Using Help"
  987.    seealso.r[3] = "MENUS"
  988.    seealsotitles.r[3] = "Help Using Application Menus"
  989.    seealso.r[4] = "MOUSE"
  990.    seealsotitles.r[4] = "Help for Using Your Mouse"
  991.    Return
  992. ENDPROC
  993. ; ===========================================================================
  994. ;       TITLE: hsHelpMenus.u
  995. ;   GENERATED: 4/13/93 - 05:32:21
  996. ; DESCRIPTION: Help Screen: Help Using Application Menus
  997. ; ---------------------------------------------------------------------------
  998. PROC hsHelpMenus.u()             ; Help on using Menus
  999. ;Global  helptext.r,             ; array of Help Text
  1000. ;        seealso.r               ; array of See Also Links
  1001. ;        seealsotitles.r         ; array of See Also Titles
  1002.  
  1003.    IF NOT IsAssigned(g.helpindex.y) THEN
  1004.       Dynarray g.helpindex.y[]
  1005.    ENDIF
  1006.    g.helpindex.y["MENUS"] = "Help Using Application Menus"
  1007.  
  1008.    Array helptext.r[30]
  1009.    Array seealso.r[4]
  1010.    Array seealsotitles.r[4]
  1011.  
  1012.    helptext.r[1] = " ════════════════════════════════════════════════════════════════"
  1013.    helptext.r[2] = " A menu presents you with a list of options."
  1014.    helptext.r[3] = ""
  1015.    helptext.r[4] = " To activate the menu, press [F10]."
  1016.    helptext.r[5] = " To activate the special popup menu, press [Alt F10] or click"
  1017.    helptext.r[6] = " the right mouse button."
  1018.    helptext.r[7] = ""
  1019.    helptext.r[8] = " Choices which are not currently available are grayed out."
  1020.    helptext.r[9] = " Each menu choice has a descriptive line attached to it."
  1021.    helptext.r[10] = " ────────────────────────────────────────────────────────────────"
  1022.    helptext.r[11] = " There are three ways to select a menu choice:"
  1023.    helptext.r[12] = ""
  1024.    helptext.r[13] = "   1) Press the first letter of the menu selection."
  1025.    helptext.r[14] = ""
  1026.    helptext.r[15] = "   2) Use the cursor keys to highlight the menu choice,"
  1027.    helptext.r[16] = "      then press [Enter]."
  1028.    helptext.r[17] = "      (When a menu choice is highlighted, it displays a"
  1029.    helptext.r[18] = "      descriptive help line at the bottom of the screen.)"
  1030.    helptext.r[19] = ""
  1031.    helptext.r[20] = "   3) Mouse click on the menu selection."
  1032.    helptext.r[21] = ""
  1033.    helptext.r[22] = " To escape from the menu, returning to whatever you were doing"
  1034.    helptext.r[23] = " before you asked for it, press [Esc] or mouse click outside of"
  1035.    helptext.r[24] = " the menu area."
  1036.    helptext.r[25] = " ────────────────────────────────────────────────────────────────"
  1037.    helptext.r[26] = " Special keys for menus:"
  1038.    helptext.r[27] = ""
  1039.    helptext.r[28] = "             [Home]  Move to the first menu selection"
  1040.    helptext.r[29] = "              [End]  Move to the last menu selection"
  1041.    helptext.r[30] = " ════════════════════════════════════════════════════════════════"
  1042.  
  1043.    seealso.r[1] = "FIND"
  1044.    seealsotitles.r[1] = "Help on Finding or Locating Data"
  1045.    seealso.r[2] = "HELP"
  1046.    seealsotitles.r[2] = "Help on Using Help"
  1047.    seealso.r[3] = "KEYS"
  1048.    seealsotitles.r[3] = "Help Using The Keyboard"
  1049.    seealso.r[4] = "MOUSE"
  1050.    seealsotitles.r[4] = "Help for Using Your Mouse"
  1051.    Return
  1052. ENDPROC
  1053. ; ===========================================================================
  1054. ;       TITLE: hsHelpMouse.u
  1055. ;   GENERATED: 4/13/93 - 05:32:36
  1056. ; DESCRIPTION: Help Screen: Help for Using Your Mouse
  1057. ; ---------------------------------------------------------------------------
  1058. PROC hsHelpMouse.u()             ; Help on using Mouse
  1059. ;Global  helptext.r,             ; array of Help Text
  1060. ;        seealso.r               ; array of See Also Links
  1061. ;        seealsotitles.r         ; array of See Also Titles
  1062.  
  1063.    IF NOT IsAssigned(g.helpindex.y) THEN
  1064.       Dynarray g.helpindex.y[]
  1065.    ENDIF
  1066.    g.helpindex.y["MOUSE"] = "Help for Using Your Mouse"
  1067.  
  1068.    Array helptext.r[70]
  1069.    Array seealso.r[4]
  1070.    Array seealsotitles.r[4]
  1071.  
  1072.    helptext.r[1] = " ════════════════════════════════════════════════════════════════"
  1073.    helptext.r[2] = " All application functions can be accessed with the mouse."
  1074.    helptext.r[3] = " ────────────────────────────────────────────────────────────────"
  1075.    helptext.r[4] = " Mouse Actions:"
  1076.    helptext.r[5] = ""
  1077.    helptext.r[6] = "           Click  Press and release a mouse button quickly."
  1078.    helptext.r[7] = "    Double-Click  Rapidly press and release a mouse button"
  1079.    helptext.r[8] = "                  twice without moving the mouse."
  1080.    helptext.r[9] = "            Drag  Press a mouse button and hold it down"
  1081.    helptext.r[10] = "                  while moving the mouse."
  1082.    helptext.r[11] = " ────────────────────────────────────────────────────────────────"
  1083.    helptext.r[12] = " To activate the special popup menu of actions for the table or"
  1084.    helptext.r[13] = " window you are currently on, click the right mouse button."
  1085.    helptext.r[14] = ""
  1086.    helptext.r[15] = " To move to a field or select from a menu, click on the field"
  1087.    helptext.r[16] = " or choice you want."
  1088.    helptext.r[17] = ""
  1089.    helptext.r[18] = " To enter FieldView, double-click on the field (same as pressing"
  1090.    helptext.r[19] = " [Alt F5] or [Ctrl F])."
  1091.    helptext.r[20] = " ────────────────────────────────────────────────────────────────"
  1092.    helptext.r[21] = " Window Controls:"
  1093.    helptext.r[22] = ""
  1094.    helptext.r[23] = " Click anywhere on a window to make it current.  The current"
  1095.    helptext.r[24] = " window has a highlighted double-line border.  Inactive windows"
  1096.    helptext.r[25] = " have a single-line border and are not highlighted."
  1097.    helptext.r[26] = " Drag on the top line to move a window."
  1098.    helptext.r[27] = ""
  1099.    helptext.r[28] = "   ┌───────────────────────── Close window (same as [Ctrl F8])."
  1100.    helptext.r[29] = "   │"
  1101.    helptext.r[30] = "   │        ┌──────────────── Restore window to previous size"
  1102.    helptext.r[31] = " ╔[■]══════[]╗               and position, if Maximized, or"
  1103.    helptext.r[32] = " ║── │ ── │ ─ ▒         ┌──── Maximize (same as [Shift F5])."
  1104.    helptext.r[33] = " ║── │ ── │ ─ ▒  ╔[■]══[]╗   Also double-click on top line."
  1105.    helptext.r[34] = " ║── │ ── │ ─ ▒  ║── │ ── ▒"
  1106.    helptext.r[35] = " ╚══════▒▒▒▒▒─┘  ╚══▒▒▒▒▒─┘── Drag to Resize window"
  1107.    helptext.r[36] = "                              (same as [Ctrl F5])."
  1108.    helptext.r[37] = " ────────────────────────────────────────────────────────────────"
  1109.    helptext.r[38] = " SpeedBar Buttons:"
  1110.    helptext.r[39] = ""
  1111.    helptext.r[40] = "   ┌ Drag on the handle to reposition the SpeedBar."
  1112.    helptext.r[41] = "   │"
  1113.    helptext.r[42] = "   │           ┌─── Move to the previous record (same as [Up] in"
  1114.    helptext.r[43] = "   │           │    TableView or [CtrlPgUp] in FormView)."
  1115.    helptext.r[44] = "   │           │"
  1116.    helptext.r[45] = "   │           │  ┌ Move to the next record (same as [Down] in"
  1117.    helptext.r[46] = "   │           │  │ TableView or [CtrlPgDn] in FormView)."
  1118.    helptext.r[47] = "   │           │  │"
  1119.    helptext.r[48] = "   │   ┌───────┼──┼──────── Move to the first record"
  1120.    helptext.r[49] = "   │   │       │  │         (same as [Home])."
  1121.    helptext.r[50] = "   │   │       │  │"
  1122.    helptext.r[51] = "   │   │       │  │       ┌ Move to the last record"
  1123.    helptext.r[52] = "   │   │       │  │       │ (same as [End])."
  1124.    helptext.r[53] = "   ╠═(|)()(─)(─)()(|)(F1)── Same as pressing [F1]."
  1125.    helptext.r[54] = "           │          └ Move to the next group of records for"
  1126.    helptext.r[55] = "           │            master tables in TableView and"
  1127.    helptext.r[56] = "           │            multi-record detail tables in FormView"
  1128.    helptext.r[57] = "           │            (same as [PgDn]).  Move ahead by the"
  1129.    helptext.r[58] = "           │            specified number of records for"
  1130.    helptext.r[59] = "           │            master tables in FormView."
  1131.    helptext.r[60] = "           │"
  1132.    helptext.r[61] = "           └─────────── Move to the previous group of records"
  1133.    helptext.r[62] = "                        for master tables in TableView and"
  1134.    helptext.r[63] = "                        multi-record detail tables in FormView"
  1135.    helptext.r[64] = "                        (same as [PgUp]).  Move back by the"
  1136.    helptext.r[65] = "                        specified number of records for master"
  1137.    helptext.r[66] = "                        tables in FormView."
  1138.    helptext.r[67] = ""
  1139.    helptext.r[68] = "   Right-click on the SpeedBar to set the button style,"
  1140.    helptext.r[69] = "   orientation and number of records to move for () and ()."
  1141.    helptext.r[70] = " ════════════════════════════════════════════════════════════════"
  1142.  
  1143.    seealso.r[1] = "FIND"
  1144.    seealsotitles.r[1] = "Help on Finding or Locating Data"
  1145.    seealso.r[2] = "HELP"
  1146.    seealsotitles.r[2] = "Help on Using Help"
  1147.    seealso.r[3] = "KEYS"
  1148.    seealsotitles.r[3] = "Help Using The Keyboard"
  1149.    seealso.r[4] = "MENUS"
  1150.    seealsotitles.r[4] = "Help Using Application Menus"
  1151.    Return
  1152. ENDPROC
  1153. ; ============================================================================
  1154. ;       TITLE: inAllFieldsChecked.l()   (c) 1991 - 1993 DataStar International
  1155. ;     RETURNS: Logical true/false if all fields are checked
  1156. ; DESCRIPTION: Checks all query fields to determine if all have a positive
  1157. ;              check mark (check, checkplus or groupby)
  1158. ; ----------------------------------------------------------------------------
  1159. PROC inAllFieldsChecked.l(       : Used by quPAL.u - Checks Checked Fields
  1160.          fieldorder.r,           ; Sequential order of fields
  1161.          checkstatus.y,          ; Check mark status of the field
  1162.          columns.n)              ; Number of columns in the image
  1163. Private  firstcheck.a,           ; Status of the first field
  1164.          retval.l,               ; Return variable
  1165.          n                       ; Transient loop counter
  1166.    firstcheck.a = checkstatus.y[fieldorder.r[2]]
  1167.    retval.l = false
  1168.    IF NOT IsBlank(firstcheck.a) THEN
  1169.       retval.l = true
  1170.       FOR n From 2 To columns.n
  1171.          IF firstcheck.a <> checkstatus.y[fieldorder.r[n]] THEN
  1172.             retval.l = false
  1173.             QUITLOOP
  1174.          ENDIF
  1175.       ENDFOR
  1176.    ENDIF
  1177.    Return retval.l
  1178. ENDPROC
  1179. ; ============================================================================
  1180. ;       TITLE: inAttributeConvert.n     (c) 1991 - 1993 DataStar International
  1181. ;     RETURNS: Color attribute
  1182. ; DESCRIPTION: Returns either the intense foreground of a background color if
  1183. ;              highlight.l = true, else black on background color.
  1184. ; ----------------------------------------------------------------------------
  1185. PROC inAttributeConvert.n(       ; Converts color into highlight or lowlight
  1186.          color.n,                ; Background color
  1187.          highlight.l)            ; True=highlight, false=lowlight
  1188.    Return (Int(color.n/16)*16) + IIF(highlight.l,Int(color.n/16)+8,0)
  1189. ENDPROC
  1190. ; ============================================================================
  1191. ;       TITLE: inBackSlashDouble.a      (c) 1991 - 1993 DataStar International
  1192. ;     RETURNS: No Value
  1193. ; DESCRIPTION: Doubles backslashes in a String
  1194. ; ----------------------------------------------------------------------------
  1195. PROC inBackSlashDouble.a(        ; Doubles backslashes in a string
  1196.          path.a)                 ; Path to double
  1197. Private  a1, a2, a3              ; Transient string variables
  1198.    a1 = path.a
  1199.    a2 = ""
  1200.    WHILE Match(a1,"..\\..",a3,a1)
  1201.       a2 = a2 + a3 +"\\\\"
  1202.    ENDWHILE
  1203.    Return IIF(a1 = path.a, path.a, a2 + a1)
  1204. ENDPROC
  1205. ; ============================================================================
  1206. ;       TITLE: inBackSlashQuotes.a      (c) 1991 - 1993 DataStar International
  1207. ;     RETURNS: String with backslash preceding all embedded quotes
  1208. ; DESCRIPTION: Adds escape characters (backslashes) to quoted strings
  1209. ; ----------------------------------------------------------------------------
  1210. PROC inBackSlashQuotes.a(        ; Adds backslashes preceding quotes
  1211.          string.a)               ; String to process
  1212. Private  len.n,                  ; Origional length of string
  1213.          n                       ; Loop counter
  1214.    IF Search("\"",string.a) > 0 THEN
  1215.       len.n = Len(string.a)
  1216.       FOR n From len.n To 1 Step -1          ; Step backwords to account for
  1217.          IF SubStr(string.a,n,1) = "\"" THEN ; increasing length of string
  1218.             string.a = SubStr(string.a,1,n-1) + "\\" +
  1219.                        SubStr(string.a,n,Len(string.a))
  1220.          ENDIF
  1221.       ENDFOR
  1222.    ENDIF
  1223.    Return string.a
  1224. ENDPROC
  1225. ; ============================================================================
  1226. ;       TITLE: inErrorHandler.n         (c) 1991 - 1993 DataStar International
  1227. ;     RETURNS: Error Continuation Code
  1228. ; DESCRIPTION: Main Error Handling Procedure - calls inErrorLog.u
  1229. ;              The initial switch deals with specific errors, and attempts
  1230. ;              to continue the application.  You should do this only when
  1231. ;              you are sure it won't end up breaking something else (e.g.
  1232. ;              If you continue from a query error, and later code expects
  1233. ;              that the query will have performed successfully, you are
  1234. ;              just postponing the inevitable.  That is one reason to use a
  1235. ;              Query Execute procedure, so that you can interrupt the
  1236. ;              process in the event of an error.
  1237. ; ----------------------------------------------------------------------------
  1238. PROC inErrorHandler.n()          ; Main Error Handler
  1239. Private  errorproc,              ; Keeps errorproc from being recursive
  1240.          error.y,                ; DynArray from ErrorInfo
  1241.          message.a,              ; Formatted message to user
  1242.          script.a,               ; Concatonated re-named Savevars.sc
  1243.          errorwin.a,             ; Paradox Window()
  1244.          a,                      ; Counter for FOREACH command
  1245.          windows.r,              ; Array of Windows from WINDOW LIST
  1246.          n1, n2                  ; Transient Loop Counters
  1247. ;Global  g.sysinfo.y             ; System info dynarray
  1248. ;        g.debug.l               ; Development DEBUG flag
  1249. ;        g.y                     ; Dynarray of Passwords
  1250. ;        g.startmemleft.n        ; Memory at Startup
  1251. ;        error.l                 ; Error flag passed back to routine
  1252.    errorwin.a = Window()                     ; Capture the Paradox Window
  1253.    IF NImages() > 0 AND ImageType() <> "Query" THEN
  1254.       SetBatch Off                           ; Just in case
  1255.    ENDIF
  1256.    ErrorInfo to error.y                      ; Capture the error info bag
  1257.    retval.n = 2                              ; Initialize returned value
  1258.    SWITCH
  1259.       CASE error.y["Proc"] = "WSDITTO.U"        :
  1260.          msContinue!.u("","You cannot ditto " + StrVal(record.r[Field()]) +
  1261.                           " - " + errorwin.a,79,"RED",1)
  1262.          retval.n = 1                        ; Ignore Ditto
  1263.       CASE error.y["Proc"] = "WSFIELDVIEW.U" AND error.y["Code"] = 23 :
  1264.          msContinue!.u("","The Field Value does not satisfy current validity " +
  1265.                           "checks.  Current field value is:  " +
  1266.                            StrVal([]),30,"BLUE",1)
  1267.          error.l = True                      ; Set error flag
  1268.          retval.n = 1                        ; Step over the []=[] assignment
  1269.       CASE error.y["Proc"] = "WSPICKFORM.L"     :
  1270.          error.l = True                      ; Set error flag
  1271.          msContinue!.u("",error.y["Message"],79,"RED",1)
  1272.          retval.n = 1
  1273.       CASE error.y["Proc"] = "WSCOPYFROMARRAY.U"   :
  1274.          SWITCH
  1275.             CASE (error.y["Code"] = 60 AND
  1276.                  Match (error.y["Message"],"..linked fields in ..") OR
  1277.                  Match (error.y["Message"],"..master record is blank..")) OR
  1278.                  (error.y["Code"] = 23 AND
  1279.                  Match(error.y["Message"],"..value must be provided..")):
  1280.                retval.n = 1
  1281.             CASE error.y["Code"] = 23 AND
  1282.                  MATCH(error.y["Message"],"..not one of the possible value.."):
  1283.                wsCopyFromArrayRecover.u(arrayname.a)
  1284.          ENDSWITCH
  1285.       CASE error.y["Code"] = 23
  1286.        AND ImageType() = "Query"
  1287.        AND error.y["Proc"] = "QUEXECUTE.L" :
  1288.          a = []
  1289.          CtrlBackSpace                       ; Eliminate offending expression
  1290.          msContinue!.u("","","The invalid query criterion: " + a +
  1291.                              " was deleted from the " + Field() + " field," +
  1292.                              " so that the Query could continue.",31,"BLUE",1)
  1293.          retval.n = 1                        ; Skip over error command
  1294.       CASE error.y["Code"] = 34
  1295.        AND Search("procedure",error.y["Message"]) <> 0  :
  1296.          SWITCH
  1297.             CASE Search("!",error.y["Message"]) <> 0    :
  1298.                error.l = true
  1299.                retval.n = 1
  1300.             CASE Search("help",error.y["Message"]) <> 0 :
  1301.                helpchoice.a = "HELP"
  1302.                helpmenu.a = "DEFAULT"
  1303.                retval.n = 0
  1304.          ENDSWITCH
  1305.       CASE error.y["Code"] = 27              ; Using quExecute.l proc
  1306.        AND ImageType() = "Query"
  1307.        AND error.y["Proc"] = "QUEXECUTE.L" :
  1308.          error.l = true                      ; Set Query Error flag
  1309.          retval.n = 1                        ; Skip over error command
  1310.       CASE error.y["Code"] = 27              ; Not using quExecute.l proc
  1311.        AND ImageType() = "Query" :
  1312.          msContinue!.u("","Query Error - " +Window(),79,"RED",3)
  1313.          retval.n = 1                        ; Skip over error command
  1314.       CASE error.y["Code"] = 27 :
  1315.          msContinue!.u("","Sorry, the Query could NOT be Completed",79,"RED",3)
  1316.          retval.n = 1                        ; Skip over error command
  1317.       CASE error.y["Code"] = 43
  1318.         OR error.y["Message"] = "Printer not ready" :
  1319.          ioPrinterStatus.l()
  1320.          IF retval THEN
  1321.             retval.n = 0
  1322.          ELSE
  1323.             retval.n = 1
  1324.          ENDIF
  1325.       CASE error.y["Proc"] = "INSTARTUP.L"
  1326.        AND error.y["Code"] = 11     :        ; PrivDir conflict
  1327.          retval.n = 1
  1328.       CASE error.y["Proc"] = "INERRORRESET.U"
  1329.        AND error.y["Code"] = 30     :        ; ErrorReset
  1330.          retval.n = 1
  1331.    ENDSWITCH
  1332.  
  1333.    IF retval.n = 2 THEN                      ; Error still not resolved
  1334.       Echo OFF
  1335.       password.a = ""                        ; Deassign any password variables
  1336.       IF NOT IsAssigned(g.sysinfo.y) THEN
  1337.          SysInfo to g.sysinfo.y              ; Capture System Info
  1338.       ENDIF
  1339.  
  1340.       IF g.sysinfo.y["UIMode"] = "COMPATIBLE" THEN
  1341.          Canvas ON                           ; Just in case
  1342.       ENDIF
  1343.  
  1344.       IF IsAssigned(g.y) THEN                ; Deassign any password variables
  1345.          FOREACH a In g.y
  1346.             UnPassword g.y[a]
  1347.             g.y[a] = "********"
  1348.          ENDFOREACH
  1349.       ENDIF
  1350.  
  1351.       IF IsAssigned(g.a) THEN
  1352.          UnPassword g.a
  1353.          g.a = "********"
  1354.       ENDIF
  1355.  
  1356.       IF IsAssigned(t.a) THEN
  1357.          UnPassword t.a
  1358.          t.a = "********"
  1359.       ENDIF
  1360.  
  1361.       IF IsAssigned(chars.a) THEN
  1362.          chars.a = "********"
  1363.       ENDIF
  1364.  
  1365.       IF NOT Match(error.y["Message"],"..run Error..",a,message.a) THEN
  1366.          IF NOT Match(error.y["Message"],"..Syntax Error..",a,message.a) THEN
  1367.                message.a = error.y["Message"]
  1368.          ENDIF
  1369.       ENDIF
  1370.  
  1371.       msWorking.u(message.a,79,0,0)
  1372.       IF NOT IsAssigned(g.debug.l) OR NOT g.debug.l THEN
  1373.          msContinue!.u("","Error in Procedure: " + error.y["Proc"] + " - " +
  1374.                            message.a,79,"RED",4)
  1375.          IF DirExists("ERR") = 0 THEN        ; Create an ERR directory if none
  1376.             Run NOREFRESH "MD ERR"           ; Store error logs in separate Dir
  1377.          ENDIF                               ; Log the error info
  1378.          script.a = "ERR\\"+StrVal(Ticks())  ; Easy Unique Name
  1379.  
  1380.          inErrorLog.u(error.y,g.sysinfo.y)   ; Log the error to disk and printer
  1381.  
  1382.          msWorking.u("Saving Current Variable Assignments to Disk",110,0,0)
  1383.          SaveVars ALL                        ; Rename Savevars.sc for posterity
  1384.          IF Sysmode() <> "Main" Then
  1385.             RUN NOREFRESH "REN "+PrivDir()+"savevars.sc "+Directory()+"\\"+script.a
  1386.          ELSE
  1387.             {Tools} {Rename} {Script} Select "Savevars" Select script.a
  1388.             IF MenuChoice() = "Cancel" THEN     ; VERY unlikely
  1389.                {Replace}
  1390.             ENDIF
  1391.          ENDIF
  1392.       ELSE
  1393.          msContinue!.u("","Error in Procedure: " + error.y["Proc"],79,
  1394.                        "RED",1)
  1395.       ENDIF
  1396.       msWorkingClear.u()                     ; Removes message window
  1397.  
  1398.       IF NOT IsAssigned(g.debug.l) OR NOT g.debug.l THEN
  1399.          msContinue!.u("","Log Complete - Please Contact Technical Support",
  1400.                        31,"BLUE",1)
  1401.          Reset
  1402.          {Tools} {More} {Protect} {Clearpasswords}
  1403.          SetColors DEFAULT
  1404.          EXIT
  1405.       ELSE                                   ; Allow access to DEBUG prompt
  1406.          msConfirm!.l("","IF <Debug>, Use <Ctrl><T> to Trace Back to Error",79,
  1407.                       "RED",3,"~D~ebug","~C~ancel",true)
  1408.          IF retval THEN
  1409.             msConfirm!.l("","Maintain Context, or Display SAVEVARS?",63,
  1410.                          "CYAN",1,"~C~ontext","~S~avevars",true)
  1411.             IF NOT retval THEN
  1412.                CancelDialog
  1413.                Window List To windows.r
  1414.                n1 = ArraySize(windows.r)
  1415.                FOR n2 From 1 To n1
  1416.                   IF IsWindow(windows.r[n2]) THEN
  1417.                      Window Select windows.r[n2]
  1418.                      Window Close
  1419.                   ENDIF
  1420.                ENDFOR
  1421.                SaveVars All
  1422.                Editor Open PrivDir() + "Savevars.sc"
  1423.             ENDIF
  1424.             Debug                            ; Must <Ctrl><T> back to error
  1425.             retval.n = 0
  1426.          ELSE
  1427.             Reset
  1428.             {Tools} {More} {Protect} {Clearpasswords}
  1429.             SetColors DEFAULT
  1430.             QUIT "You have Canceled the Application from the Error Prompt..."
  1431.          ENDIF
  1432.       ENDIF
  1433.    ELSE
  1434.       PROC epErrorReset.n()      ; Reset the ErrorCode
  1435.       Private errorproc
  1436.          Return 1
  1437.       ENDPROC
  1438.       errorproc = "epErrorReset.n"           ; Specialized errorproc
  1439.       retval = 1 + "A"                       ; Create errorcode 30
  1440.       errorproc = ""                         ; Deassign errorproc
  1441.       Release Procs epErrorReset.n           ; Release procedure
  1442.    ENDIF
  1443.    Return retval.n                           ; 0, 1 or 2
  1444. ENDPROC
  1445. ; ============================================================================
  1446. ;       TITLE: inErrorLog.u             (c) 1991 - 1993 DataStar International
  1447. ;     RETURNS: No value
  1448. ; DESCRIPTION: Error Logging Procedure - called by inErrorHandler.n
  1449. ;              Creates a Memo Variable and writes it to disk from the
  1450. ;              contents of error.y (ErrorInfo, SysInfo & selected info).
  1451. ; ----------------------------------------------------------------------------
  1452. PROC inErrorLog.u(               ; Logs Error to file and printer
  1453.          error.y,                ; ErrorInfo DynArray
  1454.          g.sysinfo.y)            ; SysInfo DynArray
  1455. Private  a,                      ; Tag of error.y in FOREACH loop
  1456.          error.m                 ; Memo variable holding errorlog
  1457. ;Global  g.debug.l               ; Development DEBUG flag
  1458.    msWorking.u("An Error has occurred, please wait while it is logged",79,3,0)
  1459.  
  1460.    error.y["Date of Error"] = Today()
  1461.    error.y["Working Directory"] = Directory()
  1462.    error.y["Working Drivespace"] = DriveSpace(SubStr(Directory(),1,1))
  1463.    error.y["Current MemLeft"] = MemLeft()
  1464.    error.y["Private Directory"] = PrivDir()
  1465.    error.y["Private Drivespace"] = DriveSpace(SubStr(PrivDir(),1,1))
  1466.    error.y["Printer Status"] = Format("LO",PrinterStatus())
  1467.    error.y["RunTime"] = Format("LY",IsRunTime())
  1468.    error.y["Current SysMode"] = SysMode()
  1469.    error.y["Time of Error"] = Time()
  1470.    error.y["Paradox version"] = Version()
  1471.  
  1472.    error.y["Paradox Build"] = g.sysinfo.y["Build"]
  1473.    error.y["Current Extended Memory"] = g.sysinfo.y["Extended"]
  1474.    error.y["Current Expanded Memory"] = g.sysinfo.y["Expanded"]
  1475.    error.y["Mouse Available"] = g.sysinfo.y["Mouse"]
  1476.    error.y["Screen Height"] = StrVal(g.sysinfo.y["ScreenHeight"]) + " Rows"
  1477.    error.y["Screen Width"] = StrVal(g.sysinfo.y["ScreenWidth"]) + " Columns"
  1478.    error.y["UI Mode"] = g.sysinfo.y["UIMode"]
  1479.  
  1480.    IF NImages() <> 0 THEN                    ; occurred on image on workspace
  1481.       error.y["Number of Images"] = NImages()
  1482.       error.y["Current Table"] = Table()
  1483.       error.y["Current Image Type"] = ImageType()
  1484.       error.y["Current Field"] = Field()
  1485.       IF ImageType() = "Display" THEN
  1486.          error.y["Current Field Value"] = IIF(NImageRecords() <> 0,[],"No Records Present")
  1487.       ELSE
  1488.          error.y["Current Field Value"] = []
  1489.       ENDIF
  1490.  
  1491.       error.y["Shared Table"] = IsShared(Table())
  1492.       IF error.y["Current Image Type"] = "Query" THEN
  1493.          IF CheckMarkStatus() <> "" THEN ; store checkmark if appropriate
  1494.             error.y["Current Field Value"] = CheckMarkStatus()+" "+[]
  1495.          ENDIF
  1496.          error.y["Formview"] = "N/A"
  1497.          error.y["Record Number"] = "N/A"
  1498.       ELSE
  1499.          error.y["Formview"] = Format("LN",IsFormView())
  1500.          error.y["Record Number"] = RecNo()
  1501.       ENDIF
  1502.       error.y["Number of Records"] = NRecords(TABLE())
  1503.    ELSE                                      ; not in an image
  1504.       error.y["Number of Images"] = "N/A"
  1505.       error.y["Current Table"] = "N/A"
  1506.       error.y["Current Image Type"] = "N/A"
  1507.       error.y["Current Field"] = "N/A"
  1508.       error.y["Current Field Value"] = "N/A"
  1509.       error.y["Shared Table"] = "N/A"
  1510.       error.y["Number of Records"] = "N/A"
  1511.       error.y["Formview"] = "N/A"
  1512.       error.y["Record Number"] = "N/A"
  1513.    ENDIF
  1514.  
  1515.    IF IsAssigned(g.sysinfo.y["Starting MemLeft"]) THEN
  1516.       error.y["Starting MemLeft"] = g.sysinfo.y["Starting MemLeft"]
  1517.    ELSE
  1518.       error.y["Starting MemLeft"] = "UA"
  1519.    ENDIF
  1520.  
  1521.    IF error.y["User"] = "" THEN
  1522.       error.y["User"] = "N/A"
  1523.    ENDIF
  1524.  
  1525.    error.m = Fill("-",80) + "\n" +
  1526.              Format("w80,ac","*** Error while in Procedure " +
  1527.                               error.y["Proc"] + " ***") + "\n" +
  1528.               Spaces(8) + "Error: #" + StrVal(error.y["Code"]) + " - " +
  1529.               error.y["Message"] + "\n" + Spaces(8) + Fill("-",64) + "\n"
  1530.    FOREACH a In error.y
  1531.       error.m = error.m + Format("w31,ar",a) + ":  " + StrVal(error.y[a]) + "\n"
  1532.    ENDFOREACH
  1533.                                              ; Write memo variable to diskfile
  1534.    msWorking.u("Writing Error Log to Disk",31,0,0)
  1535.    FileWrite APPEND "ERR\\Errorlog.sc" From error.m
  1536.    IF NOT IsAssigned(g.debug.l) OR NOT g.debug.l THEN
  1537.       IF PrinterStatus() THEN             ; prints log if printer is available
  1538.          msWorking.u("Writing Error Log to Printer",111,0,0)
  1539.          Open PRINTER
  1540.          FileWrite PrivDir()+"Errorlog" FROM error.m
  1541.          RUN NoRefresh "Copy "+PrivDir()+"Errorlog LPT1 > NUL"
  1542.          Editor New PrivDir()+"Errorlog"
  1543.          {Cancel} {Yes}
  1544.          Close PRINTER
  1545.       ENDIF
  1546.    ENDIF
  1547.    Return
  1548. ENDPROC
  1549. ; ============================================================================
  1550. ;       TITLE: ioAcceptDialog.v         (c) 1991 - 1993 DataStar International
  1551. ;     RETURNS: Value Entered, or false if Cancelled
  1552. ; DESCRIPTION: Generic routine for accepting data from user, with or without
  1553. ;              a Picture or Default value, Hidden or unhidden.
  1554. ; ----------------------------------------------------------------------------
  1555. PROC ioAcceptDialog.v(           ; One value DialogBox Accept
  1556.          top.n,                  ; Top Row for Box (999 = Centered)
  1557.          left.n,                 ; Left Column (999 = Centered)
  1558.          title.a,                ; Title for dBox
  1559.          prompt.a,               ; Data Input Prompt
  1560.          type.a,                 ; Type of Data Input
  1561.          picture.a,              ; Additional validity string
  1562.          default.v,              ; Any Default for the Accept Value?
  1563.          hidden.l,               ; Hidden, or not?
  1564.          colors.y)               ; DynArray of Colors
  1565. Private  width.n,                ; Width of Dialog Box
  1566.          length.n,               ; Length of Input
  1567.          right.n,                ; Right edge of Box
  1568.          input.v,                ; Value entered by user
  1569.          oldcolors.y,            ; Previous Color Set
  1570.          accept.v,               ; Variable to capture Accept
  1571.          spot.n,                 ; Where to begin Prompt
  1572.          pbutton.a               ; Pushbutton variable
  1573. ;Global  g.sysinfo.y
  1574.    IF NOT IsAssigned(g.sysinfo.y) THEN
  1575.       SysInfo To g.sysinfo.y             ; Determine Screen Size
  1576.    ENDIF
  1577.    IF NOT IsAssigned(g.appcolors.y) THEN
  1578.       GetColors To g.appcolors.y
  1579.    ENDIF
  1580.    IF g.sysinfo.y["UIMode"] = "COMPATIBLE" THEN
  1581.       accept.v = ioCanvasAccept.v(top.n, left.n, 79, prompt.a, type.a,
  1582.                                   IIF(IsBlank(picture.a),"",
  1583.                                  "Picture \""+picture.a+"\""))
  1584.    ELSE
  1585.       IF Len(prompt.a) > 50 THEN          ; Must keep to a reasonable length
  1586.          accept.v = false
  1587.          Message "ERROR - Prompt is too Long!!!"
  1588.          Beep Beep Beep
  1589.          Sleep 5000
  1590.       ELSE
  1591.          IF Type(colors.y) = "DY" THEN    ; Must be a DynArray, or else ignore
  1592.             SetColors From colors.y
  1593.          ENDIF
  1594.          SWITCH                           ; Determine length of Accept Datatype
  1595.             CASE type.a = "D" :           ; Set Default value to passed value
  1596.                length.n = 11              ;  or a blank value if none passed
  1597.                accept.v = IIF(IsBlank(default.v),BlankDate(),default.v)
  1598.             CASE type.a = "N" OR type.a = "$"   :
  1599.                length.n = 20
  1600.                accept.v = IIF(IsBlank(default.v),BlankNum(),default.v)
  1601.             CASE type.a = "S" :
  1602.                length.n = 8
  1603.                accept.v = IIF(IsBlank(default.v),BlankNum(),default.v)
  1604.             OTHERWISE         :
  1605.                length.n = NumVal(SubStr(type.a,2,3)) + 3
  1606.                accept.v = default.v
  1607.          ENDSWITCH                        ; Are we beyond 80 column screen width?
  1608.          IF length.n + Len(prompt.a) > 69 THEN
  1609.             length.n = 69 - Len(prompt.a)
  1610.             spot.n = 1
  1611.          ENDIF
  1612.          width.n = Min(74,Max(32,Max(Len(title.a)+10,length.n+Len(prompt.a)+5)))
  1613.          IF NOT IsAssigned(spot.n) THEN   ; Calculate starting spot if needed
  1614.             spot.n = Int((width.n - 3 - length.n - Len(prompt.a))/2)
  1615.          ENDIF
  1616.          IF IsBlank(picture.a) THEN       ; Set "global" Picture if none passed
  1617.             IF type.a = "D" THEN          ; Dates are tricky!
  1618.                picture.a = "{"+StrVal(Month(Today()))+",#[#]}"+"/"+
  1619.                            "{"+StrVal(Day(Today()))+",#[#]}"+"/"+
  1620.                            "{"+SubStr(StrVal(Year(Today())),3,2)+",#[#[#[#]]]}"
  1621.             ELSE
  1622.                picture.a = "*@"
  1623.             ENDIF
  1624.          ENDIF
  1625.          top.n = IIF(top.n = 999, Int((g.sysinfo.y["ScreenHeight"]-8)/2), top.n)
  1626.          top.n = IIF(top.n < 0 OR top.n > g.sysinfo.y["ScreenHeight"]-8, 8, top.n)
  1627.          left.n = IIF(left.n = 999 OR left.n < 0 OR
  1628.                      left.n > g.sysinfo.y["ScreenWidth"]-width.n-3,
  1629.                      Int((g.sysinfo.y["ScreenWidth"]-width.n)/2), left.n)
  1630.          IF hidden.l THEN
  1631.             accept.v = ioAcceptDialogHidden.v(top.n, left.n, title.a,
  1632.                                              prompt.a, type.a, picture.a,
  1633.                                              width.n, spot.n, "CANCEL")
  1634.          ELSE
  1635.             accept.v = ioAcceptDialogValue.v(top.n, left.n, title.a,
  1636.                                              prompt.a, type.a, picture.a,
  1637.                                              width.n, spot.n, "CANCEL")
  1638.          ENDIF
  1639.       ENDIF
  1640.       SetColors From g.appcolors.y
  1641.    ENDIF
  1642.    Return accept.v                     ; Return entered value or FALSE
  1643. ENDPROC
  1644. ; ============================================================================
  1645. ;       TITLE: ioAcceptDialogHidden.v   (c) 1991 - 1993 DataStar International
  1646. ;     RETURNS: Value Entered, or false if Cancelled
  1647. ; DESCRIPTION: Dialog Box definition to accept a Hidden Value
  1648. ; ----------------------------------------------------------------------------
  1649. PROC ioAcceptDialogHidden.v(     ; Accepts value, using HIDDEN parameter
  1650.          top.n,                  ; Top Row for Box
  1651.          left.n,                 ; Left Column
  1652.          title.a,                ; Title for dBox
  1653.          prompt.a,               ; Data Input Prompt
  1654.          type.a,                 ; Type of Data Input
  1655.          picture.a,              ; Additional validity string
  1656.          width.a,                ; Width of dialog box
  1657.          spot.n,                 ; Where to begin prompt
  1658.          pbutton.a)              ; Pushbutton variable
  1659. Private  accept.v                ; Variable to capture Accept
  1660.    SHOWDIALOG title.a                  ; Begin DialogBox definition
  1661.       @ top.n,left.n Height 7 Width width.n
  1662.       @ 1,spot.n ?? prompt.a+":"
  1663.       Accept @ 1,spot.n+Len(prompt.a)+1 Width length.n type.a
  1664.          Picture picture.a
  1665.          Required
  1666.          Hidden
  1667.          Tag "ACCEPT"
  1668.       To accept.v
  1669.       PushButton @3,3 Width 10 "~O~K"
  1670.          Ok
  1671.          Default
  1672.          Value "OK"
  1673.          Tag "OK"
  1674.       To pbutton.a
  1675.       PushButton @3,width.n-15 Width 10 "~C~ancel"
  1676.          Cancel
  1677.          Value "CANCEL"
  1678.          Tag "CANCEL"
  1679.       To pbutton.a
  1680.    EndDialog                           ; Now evaluate results
  1681.    IF NOT retval OR pbutton.a = "CANCEL" THEN
  1682.       accept.v = false
  1683.    ENDIF
  1684.    Return accept.v                     ; Return entered value or FALSE
  1685. ENDPROC
  1686. ; ============================================================================
  1687. ;       TITLE: ioAcceptDialogValue.v    (c) 1991 - 1993 DataStar International
  1688. ;     RETURNS: Value Entered, or false if Cancelled
  1689. ; DESCRIPTION: Generic routine for accepting data from user, with or without
  1690. ;              a Picture or Default value.  Use ioAcceptHidden.v for hidden.
  1691. ; ----------------------------------------------------------------------------
  1692. PROC ioAcceptDialogValue.v(      ; Accepts value from user
  1693.          top.n,                  ; Top Row for Box
  1694.          left.n,                 ; Left Column
  1695.          title.a,                ; Title for dBox
  1696.          prompt.a,               ; Data Input Prompt
  1697.          type.a,                 ; Type of Data Input
  1698.          picture.a,              ; Additional validity string
  1699.          width.a,                ; Width of dialog box
  1700.          spot.n,                 ; Where to begin prompt
  1701.          pbutton.a)              ; Pushbutton variable
  1702. Private  accept.v                ; Variable to capture Accept
  1703.    SHOWDIALOG title.a                  ; Begin DialogBox definition
  1704.       @ top.n,left.n Height 7 Width width.n
  1705.       @ 1,spot.n ?? prompt.a+":"
  1706.       Accept @ 1,spot.n+Len(prompt.a)+1 Width length.n type.a
  1707.          Picture picture.a
  1708.          ;Required
  1709.          Tag "ACCEPT"
  1710.       To accept.v
  1711.       PushButton @3,3 Width 10 "~O~K"
  1712.          Ok
  1713.          Default
  1714.          Value "OK"
  1715.          Tag "OK"
  1716.       To pbutton.a
  1717.       PushButton @3,width.n-15 Width 10 "~C~ancel"
  1718.          Cancel
  1719.          Value "CANCEL"
  1720.          Tag "CANCEL"
  1721.       To pbutton.a
  1722.    EndDialog                           ; Now evaluate results
  1723.    IF NOT retval OR pbutton.a = "CANCEL" THEN
  1724.       accept.v = false
  1725.    ENDIF
  1726.    Return accept.v                     ; Return entered value or FALSE
  1727. ENDPROC
  1728. ;=============================================================================
  1729. ;       TITLE: ioPickArrayDialog.v      (c) 1991 - 1993 DataStar International
  1730. ;     RETURNS: Value selected, or ""
  1731. ; DESCRIPTION:
  1732. ;-----------------------------------------------------------------------------
  1733. PROC ioPickArrayDialog.v(        ; Generic PickArray dBox
  1734.          listarray.r,            ; Array to use for Picklist
  1735.          pickwidth.n,            ; Width for Picklist
  1736.          title.a,                ; Title for dBox
  1737.          label.a,                ; Label to place above Picklist
  1738.          toprow.n,               ; Top row (999 = centered vertically)
  1739.          leftcolumn.n,           ; Left Column (999 = centered horizontally)
  1740.          dboxpalette.a)          ; Dynamic Array of colors, or ""
  1741. Private  dboxheight.n,
  1742.          dboxwidth.n,
  1743.          pushbutton.l
  1744.  
  1745.    IF NOT IsAssigned(g.sysinfo.y) THEN
  1746.       SysInfo To g.sysinfo.y
  1747.    ENDIF
  1748.    dboxwidth.n  = Max(pickwidth.n + 4,30)
  1749.    dboxheight.n = Max(10,Min(DynArraySize(listarray.y) + 7,
  1750.                              g.sysinfo.y["ScreenHeight"] - 3))
  1751.    retval.v     = ""
  1752.    pushbutton.l = false
  1753.    SHOWDIALOG title.a
  1754.       PROC "dbEventHandler.l"  Trigger "ARRIVE"
  1755.       @ toprow.n, leftcolumn.n Height dboxheight.n Width dboxwidth.n
  1756.  
  1757. ;      @ 1,Int((dboxwidth.n-Len(label.a)-2)/2) label.a "PICKLIST"
  1758.  
  1759.       PickArray
  1760.          @ 2,Int((dboxwidth.n-pickwidth.n-2)/2)
  1761.          Height dboxheight.n - 7 Width pickwidth.n
  1762.          listarray.r Tag "PICKLIST"
  1763.       To retval.v
  1764.  
  1765.       PushButton @ dboxheight.n - 4, 2 Width 10 "~S~elect"
  1766.          OK Default Value True Tag "BUTTON"
  1767.       To pushbutton.l
  1768.  
  1769.       PushButton @ dboxheight.n - 4, dboxwidth.n - 14 Width 10 "~C~ancel"
  1770.          Cancel Value False Tag "BUTTON"
  1771.       To pushbutton.l
  1772.    ENDDIALOG
  1773.    Return retval.v
  1774. ENDPROC
  1775. ; ============================================================================
  1776. ;       TITLE: ioPrinterStatus.l        (c) 1991 - 1993 DataStar International
  1777. ;     RETURNS: logical true or false if printer available
  1778. ; DESCRIPTION: Generic printer status, called from ErrorProc
  1779. ; ----------------------------------------------------------------------------
  1780. PROC ioPrinterStatus.l()         ; Generic printer status
  1781. Private  retval.l                ; Value to return
  1782.    retval.l = true
  1783.    msWorking.u("Checking Printer Status",96,0,0)
  1784.    WHILE NOT PrinterStatus()
  1785.       msWorkingClear.u()
  1786.       retval.l = msConfirm!.l("","N",79,"RED",3,"~R~eady","~C~ancel",true)
  1787.       IF NOT retval.l THEN
  1788.          QUITLOOP
  1789.       ENDIF
  1790.       msWorking.u("Checking Printer Status",96,0,0)
  1791.    ENDWHILE
  1792.    IF NOT retval.l THEN
  1793.       msContinue!.u("","The Report has been Canceled - Attempting to " +
  1794.                        "Continue with Application",79,"BLUE",1)
  1795.    ENDIF
  1796.    msWorkingClear.u()
  1797.    Return retval.l
  1798. ENDPROC
  1799. ; ============================================================================
  1800. ;       TITLE: ioReportToFile.u         (c) 1991 - 1993 DataStar International
  1801. ;     RETURNS: No Value
  1802. ; DESCRIPTION: Prints a Report to a designated File Name
  1803. ; ----------------------------------------------------------------------------
  1804. PROC ioReportToFile.u(           ; Generic report to file
  1805.          table.a,                ; Table to Report on
  1806.          report.a,               ; Report to Output
  1807.          file.a)                 ; Name of File to Output to
  1808. Private  pica.a,                 ; These set embedded printer control
  1809.          elite.a,                ;  variables to blank
  1810.          condensed.a,
  1811.          compressed.a,
  1812.          picalandscape.a,
  1813.          elitelandscape.a,
  1814.          condensedlandscape.a,
  1815.          boldon.a,
  1816.          boldoff.a,
  1817.          reset.a
  1818.  
  1819.    msWorking.u("Preparing Report - Please Wait",111,0,0)
  1820.    ; Sets blank Setup string
  1821.    {Report} {Change} Select table.a Select report.a Enter
  1822.    {Setting} {Setup} {Custom} Enter       ; Enter chooses default Port
  1823.       Select "" Select ""                 ; Second SELECT removes Reset
  1824.    {Output} {File} Select file.a          ; Outputs to File
  1825.    IF MenuChoice() = "Cancel" THEN
  1826.       {Replace}
  1827.    ENDIF
  1828.    {Cancel} {Yes}
  1829.    msWorkingClear.u()
  1830.    Return
  1831. ENDPROC
  1832. ; ============================================================================
  1833. ;       TITLE: ioSelectOutput.u         (c) 1991 - 1993 DataStar International
  1834. ;     CREATED: 07-01-92 03:50:00am
  1835. ; DESCRIPTION: Generic Output Loop
  1836. ; ----------------------------------------------------------------------------
  1837. PROC ioSelectOutput.u(           ; Generic Report Output Loop
  1838.          title.a,                ; Report Title
  1839.          table.a,                ; Table to report on
  1840.          report.a,               ; Report number
  1841.          default.a,              ; default printer port for Local
  1842.          printername.a,          ; printer name
  1843.          setup.a,                ; Report Setup String
  1844.          setupfield.a,           ; Printer Setup String Field in printable.a
  1845.          printable.a,            ; Full path to Printers table, or ""
  1846.          custom.a,               ; Custom Printer Select routine or ""
  1847.          pause.l)                ; Pause before Printing?
  1848. Private  menu.a,                 ; destination for report
  1849.          file.a,                 ; name for saved report file
  1850.          n,                      ; Menu selection number
  1851.          file.l,                 ; Is Report already in file?
  1852.          netport.a,              ; selected network port
  1853.          destination.a,          ; Report destination
  1854.          pushbutton.l,
  1855.          screenfile.a,
  1856.          printers.r,
  1857.          framehigh.n,
  1858.          framelow.n,
  1859.          titlelength.n,
  1860.          titleleft.n,
  1861.          frametag.a,
  1862.          destination.n
  1863. ;Global  g.user.r,
  1864. ;        pica.a,
  1865. ;        elite.a,
  1866. ;        condensed.a,
  1867. ;        compressed.a,
  1868. ;        picalandscape.a,
  1869. ;        elitelandscape.a,
  1870. ;        condensedlandscape.a,
  1871. ;        boldon.a,
  1872. ;        boldoff.a,
  1873. ;        reset.a,
  1874.  
  1875.    msWorking.u("W",111,0,0)
  1876.    IF NOT IsBlank(printable.a) THEN
  1877.       ioSelectOutputPrinter.u(printable.a)
  1878.    ENDIF
  1879.  
  1880.    file.l         = false
  1881.    screenfile.a   = PrivDir() + StrVal(Ticks())+".sc"
  1882.    file.a         = PrivDir() + "Filesave.rpt"
  1883.    destination.n  = 1
  1884.    pushbutton.l   = false
  1885.    framehigh.n    = inAttributeConvert.n(g.appcolors.y["1036"],true)
  1886.    framelow.n     = inAttributeConvert.n(g.appcolors.y["1036"],false)
  1887.    frametag.a     = "OUTPUT"
  1888.    titlelength.n  = Min(54,Len(title.a)+2)
  1889.    titleleft.n    = 29 - Int(titlelength.n/2)
  1890.  
  1891.    msWorkingClear.u()
  1892.  
  1893.    SHOWDIALOG "Select Report Destination for"
  1894.       PROC "dbEventHandler.l"
  1895.          Trigger "UPDATE", "ARRIVE", "DEPART"
  1896.       @ 5,10 Height 12 Width 60
  1897.  
  1898.       Frame Single From 3,1 To 5,56
  1899.          PaintCanvas Border
  1900.                      Attribute IIF(frametag.a="DESTINATION",framehigh.n,framelow.n)
  1901.                      3,1,5,56
  1902.          PaintCanvas Border
  1903.                      Attribute IIF(frametag.a="DESTINATION",framelow.n,framehigh.n)
  1904.                      3,1,3,55
  1905.          PaintCanvas Border
  1906.                      Attribute IIF(frametag.a="DESTINATION",framelow.n,framehigh.n)
  1907.                      3,1,5, 1
  1908.       Frame Single From 6,7 To 9,50
  1909.          PaintCanvas Border
  1910.                      Attribute IIF(frametag.a="OK" OR frametag.a = "CANCEL",
  1911.                      framehigh.n,framelow.n)
  1912.                      6,7,9,50
  1913.          PaintCanvas Border
  1914.                      Attribute IIF(frametag.a="OK" OR frametag.a = "CANCEL",
  1915.                      framelow.n,framehigh.n)
  1916.                      6,7,6,49
  1917.          PaintCanvas Border
  1918.                      Attribute IIF(frametag.a="OK" OR frametag.a = "CANCEL",
  1919.                      framelow.n,framehigh.n)
  1920.                      6,7,9, 7
  1921.  
  1922.       @ 1,titleleft.n ?? Format("w"+StrVal(titlelength.n)+",ac",title.a)
  1923.          PaintCanvas Attribute 95 1,titleleft.n,1,titleleft.n+titlelength.n-1
  1924.  
  1925.       @ 2,titleleft.n+1 ?? Fill("▀",titlelength.n)
  1926.          PaintCanvas Attribute 120 2,titleleft.n+1,2,titleleft.n+titlelength.n
  1927.  
  1928.       @ 1,titleleft.n+titlelength.n ?? "▄"
  1929.          PaintCanvas Attribute 120  1,titleleft.n+titlelength.n,
  1930.                                     1,titleleft.n+titlelength.n
  1931.  
  1932.       RadioButtons @ 4,2 Height 1 Width 54
  1933.          "Screen",
  1934.          "Printer",
  1935.          "Alternate",
  1936.          "DiskFile"
  1937.          Tag "DESTINATION"
  1938.       To destination.n
  1939.  
  1940.       PushButton @ 7,11 Width 12
  1941.          "~O~utput"
  1942.          Default Value ioSelectOutputProcess.l() Tag "OK"
  1943.       To pushbutton.l
  1944.  
  1945.       PushButton @ 7,35 Width 12
  1946.          "~C~ontinue"
  1947.          Cancel Value dbButtonPress.v(false) Tag "CANCEL"
  1948.       To pushbutton.l
  1949.    ENDDIALOG
  1950.  
  1951.    msWorking.u("W",111,0,0)
  1952.    {Report} {SetPrinter} {Regular}
  1953.    {Report} {SetPrinter} {Override} {EndOfPage} {FormFeed}
  1954.  
  1955.    IF file.l THEN
  1956.       Run NOREFRESH "Del " + screenfile.a + " > NUL"
  1957.    ENDIF
  1958.  
  1959.    IF NOT IsBlank(printable.a) THEN
  1960.       tbView.u(printable.a,true)
  1961.       ClearImage
  1962.       UnLock printable.a PFL
  1963.    ENDIF
  1964.  
  1965.    msWorkingClear.u()
  1966.    Return
  1967. ENDPROC
  1968. ; ============================================================================
  1969. ;       TITLE: ioSelectOutputPrinter.u  (c) 1991 - 1993 DataStar International
  1970. ;     CREATED: 07-01-92 03:50:00am
  1971. ; DESCRIPTION: Generic Output Dialog Box Proc
  1972. ; ----------------------------------------------------------------------------
  1973. PROC ioSelectOutputPrinter.u(    ; Reads Printers from printer table
  1974.          printable.a)
  1975. Private  count.n,
  1976.          w
  1977.    count.n = 0
  1978.    Lock printable.a PFL
  1979.    WHILE NOT retval AND count.n < 5
  1980.       count.n = count.n + 1
  1981.       Sleep 1000
  1982.       Lock printable.a PFL
  1983.    ENDWHILE
  1984.    IF count.n = 5 THEN
  1985.       printable.a = ""
  1986.    ELSE
  1987.       View printable.a
  1988.       Window Handle Image ImageNo() To w
  1989.       MoveTo [Printer Name]
  1990.       Array printers.r[NImageRecords()]
  1991.       SCAN
  1992.          printers.r[RecNo()] = []
  1993.          IF [] = printername.a Then
  1994.             Moveto Field SetupField.a
  1995.             setup.a=[]
  1996.             Moveto [Printer Name]
  1997.          ENDIF
  1998.       ENDSCAN
  1999.    ENDIF
  2000.    wsWindowPark.u(w)
  2001.    Return
  2002. ENDPROC
  2003. ; ============================================================================
  2004. ;       TITLE: ioSelectOutputProcess.l  (c) 1991 - 1993 DataStar International
  2005. ;     CREATED: 07-01-92 03:50:00am
  2006. ; DESCRIPTION: Generic Output Dialog Box Proc
  2007. ; ----------------------------------------------------------------------------
  2008. PROC ioSelectOutputProcess.l()   ; Generic Report Output Loop
  2009. Private  print.l,
  2010.          v,
  2011.          altprinter.n,
  2012.          pushbutton.l
  2013. ;Global  printable.a
  2014. ;        g.user.r,
  2015. ;        pica.a,
  2016. ;        elite.a,
  2017. ;        condensed.a,
  2018. ;        compressed.a,
  2019. ;        picalandscape.a,
  2020. ;        elitelandscape.a,
  2021. ;        condensedlandscape.a,
  2022. ;        boldon.a,
  2023. ;        boldoff.a,
  2024. ;        reset.a,
  2025. ;        setup.a,
  2026. ;        custom.a,
  2027. ;        printers.r
  2028. ;        printername.a
  2029.  
  2030.    print.l = false
  2031.    SWITCH
  2032.       CASE destination.n = 1  :
  2033.          msWorking.u("Sending Report to Screen - Press <Esc> when Finished Viewing",
  2034.                         31, 1, 0)
  2035.          IF NOT file.l THEN
  2036.             ioReportToFile.u(table.a,report.a,screenfile.a)
  2037.          ENDIF
  2038.          Run NoRefresh "Readme " + screenfile.a
  2039.          file.l = true
  2040.       CASE destination.n = 2  :
  2041.          IF NOT IsBlank(printable.a) THEN
  2042.             tbView.u(printable.a,true)
  2043.             MoveTo [Printer Name]
  2044.             Locate printername.a
  2045.             IF retval THEN
  2046.                pica.a = [Pica]
  2047.                elite.a = [Elite]
  2048.                condensed.a = [Condensed]
  2049.                compressed.a = [Compressed]
  2050.                picalandscape.a = [Pica Landscape]
  2051.                elitelandscape.a = [Elite Landscape]
  2052.                condensedlandscape.a = [Condensed Landscape]
  2053.                boldon.a = [Bold ON]
  2054.                boldoff.a = [Bold OFF]
  2055.                reset.a = [Reset]
  2056.                MoveTo FIELD setupfield.a
  2057.                setup.a = []
  2058.             ENDIF
  2059.          ENDIF
  2060.          print.l = true
  2061.       CASE destination.n = 3 :
  2062.          SWITCH
  2063.             CASE NOT IsBlank(custom.a) :
  2064.                ExecProc custom.a    ; Must assign variables, true/false
  2065.                v = retval
  2066.                IF NOT Type(v) = "L" OR NOT v THEN
  2067.                   print.l = true
  2068.                ENDIF
  2069.             CASE NOT IsBlank(printable.a) :
  2070.                altprinter.n = 1
  2071.                pushbutton.l = false
  2072.                SHOWDIALOG "Select Alternate Printer"
  2073.                   @9,17 Height 11 Width 46
  2074.  
  2075.                   PickArray @1,1 Height 5 Width 42
  2076.                      Columns 1 printers.r Tag "ALTPRINTER"
  2077.                   To altprinter.n
  2078.  
  2079.                   PushButton @7,7 Width 10 "~S~elect"
  2080.                      Ok Default Value dbButtonPress.v(true) Tag "OK"
  2081.                   To pushbutton.l
  2082.  
  2083.                   PushButton @7,27 Width 10 "~C~ancel"
  2084.                      Cancel Value dbButtonPress.v(false) Tag "CANCEL"
  2085.                   To pushbutton.l
  2086.                ENDDIALOG
  2087.  
  2088.                IF retval THEN
  2089.                   tbView.u(printable.a,true)
  2090.                   MoveTo [Printer Name]
  2091.                   Locate printers.r[altprinter.n]
  2092.                   IF retval THEN
  2093.                      pica.a = [Pica]
  2094.                      elite.a = [Elite]
  2095.                      condensed.a = [Condensed]
  2096.                      compressed.a = [Compressed]
  2097.                      picalandscape.a = [Pica Landscape]
  2098.                      elitelandscape.a = [Elite Landscape]
  2099.                      condensedlandscape.a = [Condensed Landscape]
  2100.                      boldon.a = [Bold ON]
  2101.                      boldoff.a = [Bold OFF]
  2102.                      reset.a = [Reset]
  2103.                      MoveTo FIELD setupfield.a
  2104.                      setup.a = []
  2105.                      print.l = true
  2106.                   ELSE
  2107.                      msContinue!.u("","SelectedPrinter is NOT Available",
  2108.                                    79,"RED",2)
  2109.                   ENDIF
  2110.                ENDIF
  2111.             OTHERWISE :
  2112.                msContinue!.u("","No Alternate Printers are Available",31,"BLUE",1)
  2113.          ENDSWITCH
  2114.       CASE destination.n = 4  : ; SaveFile()
  2115.          printfile.l = true
  2116.          file.v = ioAcceptDialog.v(12,18,"Enter File Name for Your Private Directory",
  2117.                                     "File Name","A12","",file.a,false,"")
  2118.          IF file.v <> false THEN
  2119.             file.a = file.v
  2120.             IF IsFile(PrivDir()+file.a) THEN        ; Whoops!
  2121.                msConfirm!.l("","That Filename Exists - Overwrite?",31,
  2122.                         "BLUE",2,
  2123.                         "~N~O - Try again",
  2124.                         "~Y~ES - Overwrite",false)
  2125.                IF NOT retval THEN
  2126.                   printfile.l = false
  2127.                ENDIF
  2128.             ENDIF
  2129.             IF printfile.l THEN
  2130.                IF NOT file.l THEN
  2131.                   msWorking.u("One Moment - Preparing Report",49,0,0)
  2132.                   ioReportToFile.u(table.a,report.a,screenfile.a)
  2133.                   file.l = true
  2134.                ENDIF
  2135.                msWorking.u("Saving Report as "+PrivDir()+file.a,49,0,0)
  2136.                Run NOREFRESH "Copy " + screenfile.a + " " + PrivDir()+file.a
  2137.             ENDIF
  2138.          ENDIF
  2139.    ENDSWITCH
  2140.    IF print.l THEN
  2141.       IF pause.l THEN
  2142.          msContinue!.u("","Make sure Printer is Ready with the proper paper",79,"RED",2)
  2143.       ENDIF
  2144.       ioPrinterStatus.l()                ; Check printer status
  2145.       IF retval THEN
  2146.          {Report} {SetPrinter} {Override} {Setup} Select setup.a
  2147.          Report table.a report.a
  2148.       ENDIF
  2149.    ENDIF
  2150.    msWorkingClear.u()
  2151.    Return true
  2152. ENDPROC
  2153. ; ============================================================================
  2154. ;       TITLE: mnVerticalDialog.n       (c) 1991 - 1993 DataStar International
  2155. ;     RETURNS: Number of menu item selected, or zero if canceled
  2156. ; DESCRIPTION: Displays a vertical menu in a dialog box
  2157. ; ----------------------------------------------------------------------------
  2158. PROC mnVerticalDialog.n(         ; Displays a vertical menu in dialog box
  2159.          menuitems.r,            ; Array of menu items
  2160.          menuprompts.r,          ; Array of menu prompts
  2161.          menutitle.a,            ; Title for menu
  2162.          user.a,                 ; User name to display on menu
  2163.          menucolors.y,           ; Optional alternate window colors
  2164.          eventhandler.a)         ; Optional alternate event handler
  2165. Private  n,                      ; Transient loop counter
  2166.          row.n,                  ; Top row for dialog box
  2167.          column.n,               ; Left column for dialog box
  2168.          menutag.n,              ; Menu item selected
  2169.          width.n,                ; Width of menu item picklist
  2170.          frameleft.n,            ; Left column for menu item frame
  2171.          framebottom.n,          ; Bottom row for menu item frame
  2172.          frameright.n,           ; Right column for menu item frame
  2173.          searchstring.a,         ; String of 1st characters of each item
  2174.          items.n,                ; Number of items in menu
  2175.          textcolor.n,            ; Window text color
  2176.          height.n                ; Menu dialog box height
  2177. ;Global  g.sysinfo.y             ; Stores SysInfo elements
  2178.  
  2179.    IF NOT IsAssigned(g.sysinfo.y) THEN
  2180.       SysInfo To g.sysinfo.y              ; Capture SysInfor for screen size
  2181.    ENDIF
  2182.  
  2183.    IF IsBlank(eventhandler.a) THEN        ; Substitute default event handler
  2184.       eventhandler.a = "mnVerticalDialogEH.l"
  2185.    ENDIF
  2186.  
  2187.    items.n = ArraySize(menuitems.r)       ; How many items?
  2188.    width.n = 0
  2189.    searchstring.a = ""                    ; String of item hotkeys
  2190.    FOR n From 1 To items.n                ; Calculate max width and hotkeys
  2191.       width.n = Max(width.n,Len(menuitems.r[n])+2)
  2192.       searchstring.a = searchstring.a + SubStr(menuitems.r[n],1,1)
  2193.    ENDFOR
  2194.    width.n = Min(54,width.n)              ; Maximum width is 54
  2195.  
  2196.    frameleft.n = Int((56 - width.n)/2)    ; Calculate menu item frame
  2197.    framebottom.n = 2 + Min(items.n,10)    ;  coordinates
  2198.    frameright.n = frameleft.n + width.n + 3
  2199.  
  2200.    height.n = 9 + framebottom.n           ; Calculate dialog box dimensions
  2201.    row.n = Int((g.sysinfo.y["ScreenHeight"]- height.n - 1)/2)
  2202.    column.n = Int((g.sysinfo.y["ScreenWidth"]-58)/2)
  2203.    menutag.n = 0                          ; Initialize menu choice variable
  2204.                                           ; Determine text color
  2205.    textcolor.n = IIF(Type(menucolors.y) = "DY" AND
  2206.                       IsAssigned(menucolors.y["5"]),
  2207.                       menucolors.y["5"], SysColor(1036))
  2208.  
  2209.    SHOWDIALOG ""
  2210.       PROC eventhandler.a ALL
  2211.       @ -200, -200 Height height.n Width 62
  2212.                                           ; Menu items frame
  2213.       Frame Single From 1,frameleft.n To framebottom.n,frameright.n
  2214.          PaintCanvas Border
  2215.                      Attribute inAttributeConvert.n(textcolor.n,false)
  2216.                      1,frameleft.n,framebottom.n,frameright.n
  2217.          PaintCanvas Border
  2218.                      Attribute inAttributeConvert.n(textcolor.n,true)
  2219.                      framebottom.n,frameleft.n+1,framebottom.n,frameright.n
  2220.          PaintCanvas Border
  2221.                      Attribute inAttributeConvert.n(textcolor.n,true)
  2222.                      1,frameright.n,framebottom.n,frameright.n
  2223.                                           ; Menu prompt frame
  2224.       Frame Single From framebottom.n+1,1 To framebottom.n+3,58
  2225.          PaintCanvas Border
  2226.                      Attribute inAttributeConvert.n(textcolor.n,true)
  2227.                      framebottom.n+1,1,framebottom.n+3,58
  2228.          PaintCanvas Border
  2229.                      Attribute inAttributeConvert.n(textcolor.n,false)
  2230.                      framebottom.n+3,2,framebottom.n+3,58
  2231.          PaintCanvas Border
  2232.                      Attribute inAttributeConvert.n(textcolor.n,false)
  2233.                      framebottom.n+1,58,framebottom.n+3,58
  2234.                                           ; Date/user/time frame
  2235.       Frame Single From framebottom.n+4,12 To framebottom.n+6,47
  2236.          PaintCanvas Border
  2237.                      Attribute inAttributeConvert.n(textcolor.n,true)
  2238.                      framebottom.n+4,12,framebottom.n+6,47
  2239.          PaintCanvas Border
  2240.                      Attribute inAttributeConvert.n(textcolor.n,false)
  2241.                      framebottom.n+6,13,framebottom.n+6,47
  2242.          PaintCanvas Border
  2243.                      Attribute inAttributeConvert.n(textcolor.n,false)
  2244.                      framebottom.n+4,47,framebottom.n+6,47
  2245.                                           ; Menu title placement
  2246.       PaintCanvas Fill Format("w58,ac",menutitle.a)
  2247.                   Attribute (Int(textcolor.n/16) * 16) + 15
  2248.                   0,1,0,58
  2249.                                           ; Date/user/time placement
  2250.       PaintCanvas Fill Format("w8,d1",Today()) +
  2251.                        Format("w16,ac",user.a) + Time()
  2252.                   Attribute (Int(textcolor.n/16) * 16) + 15
  2253.                   framebottom.n+5,14,framebottom.n+5,45
  2254.                                           ; Menu prompt placement
  2255.       PaintCanvas Fill Format("W54,ac",menuprompts.r[menutag.n])
  2256.                   Attribute textcolor.n
  2257.                   framebottom.n+2,3,framebottom.n+2,54
  2258.                                           ; Menu item placement
  2259.       PickArray @ 2,frameleft.n+2 Height framebottom.n-2 Width width.n
  2260.          Columns 1 menuitems.r Tag "MENULIST"
  2261.       To menutag.n
  2262.                                           ; help/exit buttons placement
  2263.       PushButton @ framebottom.n+5,2 Width 8
  2264.          "~H~elp" Value "HELP" Tag "HELP"
  2265.       To button.a
  2266.  
  2267.       PushButton @ framebottom.n+5,50 Width 8
  2268.          "~E~xit" Cancel Value "EXIT" Tag "EXIT"
  2269.       To button.a
  2270.    ENDDIALOG
  2271.    Return menutag.n                       ; Number of item selected, or zero
  2272. ENDPROC
  2273. ; ============================================================================
  2274. ;       TITLE: mnVerticalDialogEH.l     (c) 1991 - 1993 DataStar International
  2275. ;     RETURNS: Logical true/false if event is accepted
  2276. ; DESCRIPTION: Default event handler for vertical menu dialog box
  2277. ; ----------------------------------------------------------------------------
  2278. PROC mnVerticalDialogEH.l(       ; Event handler for dbox vertical menu
  2279.          type.a,                 ; EVENT or trigger name
  2280.          tag.a,                  ; Current control tag
  2281.          event.v,                ; Dynarray of EVENT; UPDATE value; next
  2282.                                  ;  control from DEPART; or null string
  2283.          checkbox.a)             ; Checkbox label; or null string
  2284. Private  oldtag.n,               ; Current menutag.n
  2285.          retval.l,               ; Value to return
  2286.          h, y                    ; Transient window and dynarray variables
  2287. ;Global  menutag.n,              ; Current item from mnVerticalDialog.n
  2288. ;        searchstring.n          ; First character of each menu item
  2289. ;        row.n                   ; Menu origin row
  2290. ;        column.n                ; Menu origin column
  2291. ;        height.n                ; Height of menu dialog box
  2292. ;        items.n                 ; Number of menu items
  2293.    retval.l = false
  2294.    IF type.a = "EVENT" THEN      ; Not a trigger
  2295.       SWITCH
  2296.          CASE event.v["TYPE"] = "KEY"  :
  2297.             IF tag.a = "MENULIST" THEN
  2298.                SWITCH
  2299.                   CASE event.v["KEYCODE"] = 13 :
  2300.                      AcceptDialog
  2301.                   CASE event.v["KEYCODE"] = -72 :
  2302.                      menutag.n = menutag.n - 1
  2303.                      IF menutag.n < 1 THEN
  2304.                         menutag.n = items.n
  2305.                      ENDIF
  2306.                   CASE event.v["KEYCODE"] = -80  :
  2307.                      menutag.n = menutag.n + 1
  2308.                      IF menutag.n > items.n THEN
  2309.                         menutag.n = 1
  2310.                      ENDIF
  2311.                   CASE event.v["KEYCODE"] = -71  :
  2312.                      menutag.n = 1
  2313.                   CASE event.v["KEYCODE"] = -79  :
  2314.                      menutag.n = items.n
  2315.                   CASE event.v["KEYCODE"] > 31 AND event.v["KEYCODE"] < 127 :
  2316.                      oldtag.n = menutag.n
  2317.                      menutag.n = Search(Chr(event.v["KeyCode"]),searchstring.a)
  2318.                      IF menutag.n = 0 THEN
  2319.                         menutag.n = oldtag.n
  2320.                      ELSE
  2321.                         AcceptDialog
  2322.                      ENDIF
  2323.                   CASE event.v["KEYCODE"] = 9 OR
  2324.                        event.v["KEYCODE"] = -15 OR
  2325.                        event.v["KEYCODE"] = 27 OR
  2326.                        event.v["KEYCODE"] = -35 OR
  2327.                        event.v["KEYCODE"] = -18 :
  2328.                      retval.l = true
  2329.                   OTHERWISE               : Beep
  2330.                ENDSWITCH
  2331.                IF NOT retval.l THEN
  2332.                   ResyncControl "MENULIST"
  2333.                ENDIF
  2334.             ELSE
  2335.                retval.l = true
  2336.             ENDIF
  2337.          OTHERWISE   :
  2338.             retval.l = true
  2339.       ENDSWITCH
  2340.       RepaintDialog
  2341.    ELSE
  2342.       SWITCH
  2343.          CASE type.a = "OPEN" :
  2344.             Window Handle Dialog To h
  2345.             IF Type(menucolors.y) = "DY" THEN
  2346.                Window SetColors h From menucolors.y
  2347.             ENDIF
  2348.             RepaintDialog
  2349.             Window GetColors h To menucolors.y
  2350.             DynArray y[]
  2351.                y["HASFRAME"] = false
  2352.                y["OriginCol"] = column.n
  2353.                y["OriginRow"] = row.n
  2354.             Window SetAttributes h From y
  2355.          CASE type.a = "UPDATE" AND tag.a = "HELP" :
  2356.             mnVerticalDialogHelp.u(row.n,column.n,row.n+height.n-5)
  2357.          CASE type.a = "UPDATE" AND tag.a = "EXIT" :
  2358.             CancelDialog
  2359.          CASE type.a = "UPDATE" AND tag.a = "MENULIST" :
  2360.             AcceptDialog
  2361.       ENDSWITCH
  2362.       retval.l = true
  2363.    ENDIF
  2364.    Return retval.l
  2365. ENDPROC
  2366. ; ============================================================================
  2367. ;       TITLE: mnVerticalDialogHelp.u   (c) 1991 - 1993 DataStar International
  2368. ;     RETURNS: No value
  2369. ; DESCRIPTION: Default help dialog box for vertical menu dialog box
  2370. ; ----------------------------------------------------------------------------
  2371. PROC mnVerticalDialogHelp.u(     ; Default help for vertical menu dialog box
  2372.          toprow.n,               ; Origin row for menu dialog box
  2373.          leftcolumn.n,           ; Origin column of menu dialog box
  2374.          helprow.n)              ; origin row for help dialog box
  2375. Private  button.l                ; Value of continue pushbutton
  2376.    SHOWDIALOG ""
  2377.       @ Min(helprow.n,g.sysinfo.y["ScreenHeight"]-7), leftcolumn.n + 10
  2378.       Height 5 Width 40
  2379.       PaintCanvas Fill Format("w36,ac","Use the Cursor \018 Keys to Scroll") +
  2380.                        Format("w36,ac","<Tab> to Buttons - <Enter> to Select")
  2381.                   Attribute SysColor(1036) 1, 1, 2, 36
  2382.       PushButton @ -1,13
  2383.          Width 12 "~C~ontinue"
  2384.          OK Default Value true Tag "OK"
  2385.       To button.l
  2386.    ENDDIALOG
  2387.    Return
  2388. ENDPROC
  2389. ; ============================================================================
  2390. ;       TITLE: msAlertDialog.l          (c) 1991 - 1993 DataStar International
  2391. ;     RETURNS: No Value
  2392. ; DESCRIPTION: Dialog PROC for IDLE events in Messages
  2393. ; ----------------------------------------------------------------------------
  2394. PROC msAlertDialog.l(            ; DBox EventHandler for non-icon messages
  2395.          type.a,                 ; EVENT or TRIGGER
  2396.          tag.a,                  ; Control element tag or null
  2397.          event.v,                ; DynArray of GetEvent, or control value
  2398.          element.a)              ; Checkbox label or null
  2399. Private  h, y
  2400. ;Global  alert.n                 ; Alert Value from dBox (0 - 5)
  2401. ;Global  onceflag.l              ; For non-continuous Alert (1, 2)
  2402.    IF NOT IsAssigned(onceflag.l) THEN
  2403.       onceflag.l = true
  2404.    ENDIF
  2405.    SWITCH
  2406.       CASE alert.n = 1 AND onceflag.l :
  2407.          Beep Sleep 50
  2408.          Beep Sleep 50
  2409.          Beep
  2410.          onceflag.l = false            ; Turns off subsequent Alerts
  2411.       CASE alert.n = 2 AND onceflag.l :
  2412.          Sound 770 150
  2413.          Sound 440 150
  2414.          Sound 770 150
  2415.          Sound 440 150
  2416.          Sound 770 150
  2417.          onceflag.l = false            ; Turns off subsequent Alerts
  2418.       CASE alert.n = 3  :
  2419.          Beep Sleep 50 Beep Sleep 300
  2420.       CASE alert.n = 4  :
  2421.          Sound 300 50 Sleep 100
  2422.          Sound 300 50 Sleep 100
  2423.          Sound 150 50 Sleep 100
  2424.          Sound 150 50 Sleep 100
  2425.          Sleep 200
  2426.       CASE alert.n = 5  :
  2427.          Sound 770 150
  2428.          Sound 440 150
  2429.       CASE alert.n = 86 and onceflag.l :
  2430.          FOR n1 From 4 To 0 Step -1
  2431.             FOR n2 From 11 To 0 Step -1
  2432.                Sound Int(Pow(2,n1+n2/12)*110) 5
  2433.             ENDFOR
  2434.          ENDFOR
  2435.          Sound 10 3000
  2436.          onceflag.l = false            ; Turns off subsequent Alerts
  2437.    ENDSWITCH
  2438.    Return true
  2439. ENDPROC
  2440. ; ============================================================================
  2441. ;       TITLE: msConfirm!.l             (c) 1991 - 1993 DataStar International
  2442. ;     RETURNS: Logical true/false if User Confirmed/Canceled
  2443. ; DESCRIPTION: Generic Continue-or-Cancel Message routine
  2444. ;                 Alert 0 = No sound
  2445. ;                 Alert 1 = Three beeps
  2446. ;                 Alert 2 = Siren, short (high-low-high-low-high)
  2447. ;                 Alert 3 = Two beeps, continuous
  2448. ;                 Alert 4 = Two high beeps, two low beeps, continuous
  2449. ;                 Alert 5 = Siren, continuous
  2450. ; ----------------------------------------------------------------------------
  2451. PROC msConfirm!.l(               ; Confirmation DialogBox
  2452.          title.a,                ; Title for Dialog Box, or "" for Default
  2453.          message.a,              ; Message to display (< 70 chars)
  2454.          msgcolor.n,             ; Color for message (not DialogBox!)
  2455.          dboxpalette.a,          ; Palette name for custom dBox window colors
  2456.          alert.n,                ; Sound level of Alert (0 - 4)
  2457.          oklabel.a,              ; Label of CONTINUE Pushbutton
  2458.          cxlabel.a,              ; Label of CANCEL Pushbutton
  2459.          confirm.l)              ; Should Confirm be default?
  2460. Private  width.n,                ; Width of Dialog Box
  2461.          a1, a2,                 ; Match variables
  2462.          n1, n2,                 ; Button length comparisons
  2463.          buttonlength.n,         ; Width of Pushbuttons
  2464.          button.l,               ; Value of selected Pushbutton
  2465.          onceflag.l,             ; True = Non-continuous Alert
  2466.          icon.a,
  2467.          framehigh.n,
  2468.          framelow.n
  2469. ;Global  g.appcolors.y           ; Global Application Colors
  2470. ;        g.sysinfo.y             ; Global System Information
  2471.  
  2472.    SetCanvas DEFAULT
  2473.    IF NOT IsAssigned(g.sysinfo.y) THEN
  2474.       SysInfo to g.sysinfo.y
  2475.    ENDIF
  2476.  
  2477.    IF Len(message.a) = 1 THEN
  2478.       icon.a = msIcon.a(message.a)
  2479.       message.a = msShortcuts.a(message.a)
  2480.    ELSE
  2481.       IF alert.n > 3 THEN
  2482.          icon.a = msIcon.a("!")
  2483.       ELSE
  2484.          icon.a = msIcon.a("?")
  2485.       ENDIF
  2486.    ENDIF
  2487.  
  2488.    framehigh.n = inAttributeConvert.n(SysColor(1036),true)
  2489.    framelow.n  = inAttributeConvert.n(SysColor(1036),false)
  2490.    onceflag.l  = alert.n < 3 OR alert.n > 50
  2491.    button.l    = false
  2492.    message.a   = msWrap.a(message.a)
  2493.    title.a     = IIF(title.a = "", "Press <Tab> to Highlight - <Enter> to Select",
  2494.                                     title.a)
  2495.  
  2496.    DynArray dboxprocs.y[]
  2497.       dboxprocs.y["IDLE"] = "dbAlert.l"
  2498.  
  2499.    toprow.n = 7
  2500.    leftcol.n = Int((g.sysinfo.y["ScreenWidth"]-60)/2)
  2501.  
  2502.    a1 = ""
  2503.    a2 = oklabel.a
  2504.    WHILE Match(a1+a2,"..~..",a1,a2)
  2505.    ENDWHILE
  2506.    n1 = Len(a1+a2)
  2507.  
  2508.    a1 = ""
  2509.    a2 = cxlabel.a
  2510.    WHILE Match(a1+a2,"..~..",a1,a2)
  2511.    ENDWHILE
  2512.    n2 = Len(a1+a2)
  2513.    buttonlength.n = Max(n1,n2)+4
  2514.  
  2515.    SHOWDIALOG title.a
  2516.       Proc "dbEventHandler.l"
  2517.          IDLE
  2518.          TRIGGER "Open"
  2519.       @ -200,-200
  2520.       Height 11 Width 60
  2521.  
  2522.       Frame From 0,1 To 6,11
  2523.          PaintCanvas Border Attribute framelow.n  0,1,6,11
  2524.          PaintCanvas Border Attribute framehigh.n 0,1,0,10
  2525.          PaintCanvas Border Attribute framehigh.n 0,1,6,1
  2526.          PaintCanvas Fill icon.a Attribute msgcolor.n 1,2,5,10
  2527.  
  2528.       Frame From 0,13 To 6,56
  2529.          PaintCanvas Border Attribute framehigh.n 0,13,6,56
  2530.          PaintCanvas Border Attribute framelow.n  0,13,0,55
  2531.          PaintCanvas Border Attribute framelow.n  0,13,6,13
  2532.          PaintCanvas Fill message.a Attribute msgcolor.n 1,15,5,54
  2533.  
  2534.       PushButton  @ 7,10
  2535.          Width buttonlength.n IIF(confirm.l,oklabel.a,cxlabel.a)
  2536.          OK Value dbButtonPress.v(confirm.l) Tag "BUTTON"
  2537.       To button.l
  2538.  
  2539.       PushButton  @ 7,48 - buttonlength.n
  2540.          Width buttonlength.n IIF(confirm.l,cxlabel.a,oklabel.a)
  2541.          OK Value dbButtonPress.v(NOT confirm.l) Tag "BUTTON"
  2542.       To button.l
  2543.    ENDDIALOG
  2544.    msWorkingClear.u()
  2545.    Return button.l
  2546. ENDPROC
  2547. ; ============================================================================
  2548. ;       TITLE: msContinue!.u            (c) 1991 - 1993 DataStar International
  2549. ;     RETURNS: No Value
  2550. ; DESCRIPTION: Generic Message and wait for a <Continue> keypress
  2551. ;                 Alert 0 = No sound
  2552. ;                 Alert 1 = Three beeps
  2553. ;                 Alert 2 = Siren, short (high-low-high-low-high)
  2554. ;                 Alert 3 = Two beeps, continuous
  2555. ;                 Alert 4 = Two high beeps, two low beeps, continuous
  2556. ;                 Alert 5 = Siren, continuous
  2557. ; ----------------------------------------------------------------------------
  2558. PROC msContinue!.u(              ; Generic Continue DialogBox
  2559.          title.a,                ; Title for dBox, "" for Default
  2560.          message.a,              ; Message to display
  2561.          msgcolor.n,             ; Color for Message (not DialogBox!)
  2562.          dboxpalette.a,          ; Dynarray of custom colors
  2563.          alert.n)                ; Sound level of Alert (0 - 5)
  2564. Private  icon.a,
  2565.          button.l,               ; Value of selected Pushbutton
  2566.          onceflag.l,             ; True = non-continuous alert
  2567.          framehigh.n,
  2568.          framelow.n
  2569. ;Global  g.appcolors.y           ; Global Application Colors
  2570. ;        g.sysinfo.y             ; Global System Information
  2571.  
  2572.    SetCanvas DEFAULT
  2573.    IF Len(message.a) = 1 THEN
  2574.       icon.a = msIcon.a(message.a)
  2575.       message.a = msShortcuts.a(message.a)
  2576.    ELSE
  2577.       IF alert.n > 3 THEN
  2578.          icon.a = msIcon.a("!")
  2579.       ELSE
  2580.          icon.a = msIcon.a("I")
  2581.       ENDIF
  2582.    ENDIF
  2583.  
  2584.    IF NOT IsAssigned(g.sysinfo.y) THEN
  2585.       SysInfo to g.sysinfo.y
  2586.    ENDIF
  2587.  
  2588.    DynArray dboxprocs.y[]
  2589.       dboxprocs.y["IDLE"] = "dbAlert.l"
  2590.  
  2591.    framehigh.n = inAttributeConvert.n(SysColor(1036),true)
  2592.    framelow.n  = inAttributeConvert.n(SysColor(1036),false)
  2593.    onceflag.l  = alert.n < 3 OR alert.n > 50
  2594.    message.a   = msWrap.a(message.a)
  2595.    button.l    = true
  2596.    toprow.n    = 7
  2597.    leftcol.n   = Int((g.sysinfo.y["ScreenWidth"]-60)/2)
  2598.    title.a     = IIF(title.a = "", "Press <Enter> to Continue", title.a)
  2599.  
  2600.    SHOWDIALOG title.a
  2601.       Proc "dbEventHandler.l"
  2602.          Idle Trigger "OPEN"    ; Wait for Key Alert
  2603.       @ -200,-200
  2604.       Height 11 Width 60
  2605.  
  2606.       Frame From 0,1 To 6,11
  2607.          PaintCanvas Border Attribute framelow.n  0,1,6,11
  2608.          PaintCanvas Border Attribute framehigh.n 0,1,0,10
  2609.          PaintCanvas Border Attribute framehigh.n 0,1,6,1
  2610.          PaintCanvas Fill icon.a
  2611.                      Attribute msgcolor.n 1,2,5,10
  2612.  
  2613.       Frame From 0,13 To 6,56
  2614.          PaintCanvas Border Attribute framehigh.n 0,13,6,56
  2615.          PaintCanvas Border Attribute framelow.n  0,13,0,55
  2616.          PaintCanvas Border Attribute framelow.n  0,13,6,13
  2617.          PaintCanvas Fill message.a
  2618.                      Attribute msgcolor.n 1,15,5,54
  2619.  
  2620.       PushButton @ 7,23
  2621.          Width 12 "~C~ontinue"
  2622.          OK Default Value dbButtonPress.v(true) Tag "OK"
  2623.       To button.l
  2624.    ENDDIALOG
  2625.    msWorkingClear.u()
  2626.    Return
  2627. ENDPROC
  2628. ; ============================================================================
  2629. ;       TITLE: msIcon.a                 (c) 1991 - 1993 DataStar International
  2630. ;     RETURNS: String containing message box icon
  2631. ; DESCRIPTION: Assigns Icon based upon icon code
  2632. ; ----------------------------------------------------------------------------
  2633. PROC msIcon.a(                   ; Create icon for message dBoxes
  2634.          icon.a)
  2635.    icon.a = Upper(icon.a)
  2636.    SWITCH
  2637.       CASE Search(icon.a,"IWM") <> 0 :
  2638.          icon.a = "    ▀    " +
  2639.                   "   ██    " +
  2640.                   "    █    " +
  2641.                   "    █    " +
  2642.                   "   ███   "
  2643.       CASE Search(icon.a,"DKA?") <> 0 :
  2644.          icon.a = " █▀▀▀▀█  " +
  2645.                   "      █  " +
  2646.                   "    █▀▀  " +
  2647.                   "    █    " +
  2648.                   "    ▄    "
  2649.       CASE Search(icon.a,"!U") <> 0 :
  2650.          icon.a = "   ▐█▌   " +
  2651.                   "   ███   " +
  2652.                   "   ▐█▌   " +
  2653.                   "    █    " +
  2654.                   "    ▄    "
  2655.       CASE Search(icon.a,"PN") <> 0 :
  2656.          icon.a = " █████ " +
  2657.                   " █████ " +
  2658.                   " █████ " +
  2659.                   "┌─┬─┬─┬─┐" +
  2660.                   "▀███████▀"
  2661.       CASE Search(icon.a,"CR") <> 0 :
  2662.          icon.a = " ▄     ▄ " +
  2663.                   "  ▀▄ ▄▀  " +
  2664.                   "   ▄▀▄   " +
  2665.                   " ▄▀   ▀▄ " +
  2666.                   "         "
  2667.       OTHERWISE :
  2668.          icon.a = "    █    " +
  2669.                   "  ▄█▀█▄  " +
  2670.                   "▀▀█▄▀▄█▀▀" +
  2671.                   "   ▀█▀   " +
  2672.                   "    ▀    "
  2673.    ENDSWITCH
  2674.    Return icon.a
  2675. ENDPROC
  2676. ; ============================================================================
  2677. ;       TITLE: msPauser.u               (c) 1991 - 1993 DataStar International
  2678. ;     RETURNS: No Value
  2679. ; DESCRIPTION: Pauses for specified time, but continues with keypress
  2680. ; ----------------------------------------------------------------------------
  2681. PROC msPauser.u(                 ; Generic Wait for Event, with timeout
  2682.          seconds.n)              ; Maximum number of seconds to wait
  2683. Private  count.n,                ; Loop counter
  2684.          y                       ; Event Dynarray
  2685.    WHILE CharWaiting()                    ; Clear keyboard buffer
  2686.       retval = GetChar()
  2687.    ENDWHILE
  2688.    Message "Please MouseClick or Press Any Key to Continue..."
  2689.    count.n = 0
  2690.    WHILE count.n < (40 * seconds.n)
  2691.       GetEvent ALL To y
  2692.       IF (y["Type"] = "MOUSE" AND y["Action"] = "DOWN") OR
  2693.          y["Type"] = "KEY" OR y["Type"] = "MESSAGE" THEN
  2694.          QUITLOOP
  2695.       ENDIF
  2696.       Sleep 20
  2697.       count.n = count.n + 1
  2698.    ENDWHILE
  2699.    Message ""
  2700.    Return
  2701. ENDPROC
  2702. ; ============================================================================
  2703. ;       TITLE: msProgressBar.u()        (c) 1991 - 1993 DataStar International
  2704. ;     RETURNS: No Value
  2705. ; DESCRIPTION: Displays progress bar on screen indicating to user
  2706. ;              processing messages and percent complete.
  2707. ; ----------------------------------------------------------------------------
  2708. PROC msProgressBar.u(            ; Creates Progress Bar thermometer
  2709.          toprow.n,               ; Top row for Window
  2710.          leftcol.n,              ; Left column for Window
  2711.          title.a,                ; Title for bar
  2712.          message.a,              ; Message, below title
  2713.          wincolor.n,             ; Color of Window, includes Title
  2714.          barcolor.n,             ; Color of Bar
  2715.          msgcolor.n,             ; Color of Message
  2716.          percentdone.n)          ; 0 = SetUpWindow and MoveIntoPosition
  2717. Private  y,                      ; Throwaway Window DynArray
  2718.          oldcanvas.h,            ; Current Canvas
  2719.          oldwindow.h             ; Current Window
  2720. ;Global  g.sysinfo.y             ; SysInfo
  2721. ;        g.handles.y             ; Window Handles
  2722.  
  2723.    oldwindow.h = GetWindow()
  2724.    oldcanvas.h = GetCanvas()
  2725.    IF percentdone.n = -1 THEN
  2726.       Window Select g.handles.y["PROGRESS"]
  2727.       SetCanvas g.handles.y["PROGRESS"]
  2728.       WinClose
  2729.    ELSE
  2730.       IF NOT IsAssigned(g.sysinfo.y) THEN
  2731.          SysInfo To g.sysinfo.y
  2732.       ENDIF
  2733.  
  2734.       Dynarray y[]
  2735.          y["hasframe"] = false
  2736.          y["Style"]    = wincolor.n
  2737.          y["height"]   = 8
  2738.          y["width"]    = 64
  2739.  
  2740.       IF NOT IsAssigned(g.handles.y) Then
  2741.          DynArray g.handles.y[]
  2742.       ENDIF
  2743.  
  2744.       IF NOT IsAssigned(g.handles.y["PROGRESS"]) OR
  2745.          NOT IsWindow(g.handles.y["PROGRESS"])  THEN
  2746.          Window Create Floating @ -200, -200
  2747.                Attributes y To g.handles.y["PROGRESS"]
  2748.       ENDIF
  2749.  
  2750.       Window Select g.handles.y["PROGRESS"]
  2751.       SetCanvas g.handles.y["PROGRESS"]
  2752.       Canvas Off
  2753.  
  2754.       IF toprow.n = 999 THEN
  2755.          toprow.n = 7
  2756.       ENDIF
  2757.  
  2758.       IF leftcol.n = 999 THEN
  2759.          leftcol.n = Int((g.sysinfo.y["ScreenWidth"]-64)/2)
  2760.       ENDIF
  2761.  
  2762.       IF percentdone.n = 0 THEN     ; 0 = 1st time through Setup
  2763.          Window Move g.handles.y["PROGRESS"] To toprow.n,leftcol.n
  2764.  
  2765.          @ 0,0  ??"┌──────────────────────────────────────────────────────────────┐"
  2766.          @ 1,0  ??"│                                                              │"
  2767.          @ 2,0  ??"│                                                              │"
  2768.          @ 3,0  ??"│                                                              │"
  2769.          @ 4,0  ??"│     ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░     │"
  2770.          @ 5,0  ??"│      0           25         50          75          100      │"
  2771.          @ 6,0  ??"│                      Percent Complete                        │"
  2772.          @ 7,0  ??"└──────────────────────────────────────────────────────────────┘"
  2773.  
  2774.          @ 1,2 ?? Format("ac,w60",Title.a)
  2775.          PaintCanvas Attribute wincolor.n 0,0,6,63
  2776.          PaintCanvas Attribute barcolor.n 4,6,4,57
  2777.  
  2778.          PaintCanvas Border Attribute 112 0,0,7,63
  2779.          PaintCanvas Attribute 127 0,0,7,0
  2780.          PaintCanvas Attribute 127 7,0,7,62
  2781.       ENDIF
  2782.  
  2783.       Style Attribute msgcolor.n
  2784.          @ 2,2 ?? Format("ac,w60",message.a)
  2785.       Style Attribute barcolor.n
  2786.          @ 4,7 ?? Fill("\219",Min(Int(percentdone.n/2),50))
  2787.       Style
  2788.  
  2789.       Canvas On
  2790.    ENDIF
  2791.    IF IsWindow(oldcanvas.h) THEN
  2792.       SetCanvas oldcanvas.h
  2793.    ELSE
  2794.       SetCanvas Default
  2795.    ENDIF
  2796.    IF IsWindow(oldwindow.h) THEN
  2797.       Window Select oldwindow.h
  2798.    ENDIF
  2799.    Return
  2800. ENDPROC
  2801. ; ============================================================================
  2802. ;       TITLE: msScreenBlanker.u        (c) 1991 - 1993 DataStar International
  2803. ;     RETURNS: No Value
  2804. ; DESCRIPTION: Snaking worm screen blanker
  2805. ; ----------------------------------------------------------------------------
  2806. PROC msScreenBlanker.u()         ; Screen blanking routine
  2807. Private  row.r,                  ; Row location array
  2808.          column.r,               ; Column location array
  2809.          n1, n2,                 ; Loop counters
  2810.          fill.a,                 ; Message fill string
  2811.          worm.r,                 ; Worm segment array
  2812.          direction.n,            ; Current direction
  2813.          olddirection.n,         ; Last direction
  2814.          y,                      ; Getevent dynarray
  2815.          oldcanvas.h,            ; Previous Canvas
  2816.          oldwindow.h,            ; Previous Window
  2817.          height.n,
  2818.          width.n
  2819. ;Global  g.sysinfo.y             ; SysInfo
  2820. ;        g.handles.y             ; Window Handles
  2821.  
  2822.    oldwindow.h = GetWindow()
  2823.    oldcanvas.h = GetCanvas()
  2824.    IF NOT IsAssigned(g.sysinfo.y) THEN
  2825.       SysInfo To g.sysinfo.y
  2826.    ENDIF
  2827.    height.n = g.sysinfo.y["ScreenHeight"]
  2828.    width.n = g.sysinfo.y["ScreenWidth"]
  2829.  
  2830.    DynArray w.y[]
  2831.       w.y["HasFrame"] = false
  2832.       w.y["HasShadow"] = false
  2833.       w.y["Style"]    = 15
  2834.       w.y["Height"]   = g.sysinfo.y["ScreenHeight"]
  2835.       w.y["Width"]    = g.sysinfo.y["ScreenWidth"]
  2836.    Window Create Floating @ 0,0 Attributes w.y to blank.h
  2837.  
  2838.    Array worm.r[4]                        ; Set up worm using ASCII
  2839.       worm.r[1] = "\10\10"
  2840.       worm.r[2] = "▓▓"
  2841.       worm.r[3] = "▒▒"
  2842.       worm.r[4] = "░░"
  2843.    Array row.r[4]                         ; Initialize starting rows
  2844.       row.r[1] = 12
  2845.       row.r[2] = 12
  2846.       row.r[3] = 12
  2847.       row.r[4] = 12
  2848.    Array column.r[4]                      ; Initialize starting columns
  2849.       column.r[1] = 40
  2850.       column.r[2] = 42
  2851.       column.r[3] = 44
  2852.       column.r[4] = 46
  2853.    Style ATTRIBUTE 9
  2854.    fill.a = "  P R E S S   A N Y   K E Y   T O   R E T U R N  "
  2855.    olddirection.n = 0                     ; Initialize
  2856.    WHILE NOT IsAssigned(g.debug.l) OR NOT g.debug.l
  2857.       direction.n = Int(Rand()*8)         ; Randomize next direction
  2858.       IF Mod(direction.n,4) = Mod(olddirection.n,4) THEN
  2859.                                           ; Prevent same direct or reverse
  2860.          IF direction.n = 7 THEN
  2861.             direction.n = 0
  2862.          ELSE
  2863.             direction.n = direction.n + 1
  2864.          ENDIF
  2865.       ENDIF
  2866.       FOR n2 From 1 To 3
  2867.          Canvas OFF
  2868.          PaintCanvas Fill " " ATTRIBUTE 0 0,0,24,79   ; Black screen
  2869.          SWITCH                           ; Randomize and display message
  2870.             CASE Mod(direction.n,4) = 0 :
  2871.                PaintCanvas FILL Format("w80,ac",fill.a) ATTRIBUTE 79 0,0,0,79
  2872.             CASE Mod(direction.n,4) = 1 :
  2873.                PaintCanvas FILL fill.a+" " ATTRIBUTE 95 0,0,24,1
  2874.             CASE Mod(direction.n,4) = 2 :
  2875.                PaintCanvas FILL Format("w80,ac",fill.a) ATTRIBUTE 31 24,0,24,79
  2876.             CASE Mod(direction.n,4) = 3 :
  2877.                PaintCanvas FILL " "+fill.a ATTRIBUTE 47 0,78,24,79
  2878.          ENDSWITCH
  2879.          FOR n1 From 4 To 1 Step -1       ; Countdown loop places worm
  2880.             @ row.r[n1], column.r[n1] ?? worm.r[n1]
  2881.          ENDFOR
  2882.          Canvas ON                        ; Increment worm segment locations
  2883.          row.r[4] = row.r[3]
  2884.          row.r[3] = row.r[2]
  2885.          row.r[2] = row.r[1]
  2886.          column.r[4] = column.r[3]
  2887.          column.r[3] = column.r[2]
  2888.          column.r[2] = column.r[1]
  2889.          SWITCH                           ; Check for Out-of-bounds movement
  2890.             CASE direction.n = 0 :        ;  and then assign head position
  2891.                SWITCH
  2892.                   CASE row.r[1] > 1  : row.r[1] = row.r[1] - 1
  2893.                   CASE column.r[1] = width.n - 4 :
  2894.                      column.r[1] = width.n - 6
  2895.                   OTHERWISE          : column.r[1] = column.r[1] + 2
  2896.                ENDSWITCH
  2897.             CASE direction.n = 1 :
  2898.                SWITCH
  2899.                   CASE row.r[1] < 2
  2900.                    AND column.r[1] > width.n - 5 :
  2901.                      row.r[1] = 2
  2902.                      column.r[1] = width.n - 6
  2903.                   CASE row.r[1] < 2  :
  2904.                      column.r[1] = column.r[1] + 2
  2905.                   CASE column.r[1] > width.n - 5 :
  2906.                      row.r[1] = row.r[1] - 1
  2907.                   OTHERWISE          :
  2908.                      row.r[1] = row.r[1] - 1
  2909.                      column.r[1] = column.r[1] + 2
  2910.                ENDSWITCH
  2911.             CASE direction.n = 2 :
  2912.                SWITCH
  2913.                   CASE column.r[1] < width.n - 5 :
  2914.                      column.r[1] = column.r[1] + 2
  2915.                   CASE row.r[1] < 2  : row.r[1] = 2
  2916.                   OTHERWISE          : row.r[1] = row.r[1] - 1
  2917.                ENDSWITCH
  2918.             CASE direction.n = 3 :
  2919.                SWITCH
  2920.                   CASE row.r[1] > height.n - 3
  2921.                    AND column.r[1] > width.n - 5 :
  2922.                      row.r[1] = height.n - 3
  2923.                      column.r[1] = height.n - 6
  2924.                   CASE row.r[1] > height.n - 3 :
  2925.                      column.r[1] = column.r[1] + 2
  2926.                   CASE column.r[1] > width.n - 5 :
  2927.                      row.r[1] = row.r[1] + 1
  2928.                   OTHERWISE          :
  2929.                      row.r[1] = row.r[1] + 1
  2930.                      column.r[1] = column.r[1] + 2
  2931.                ENDSWITCH
  2932.             CASE direction.n = 4 :
  2933.                SWITCH
  2934.                   CASE row.r[1] < height.n - 2 : row.r[1] = row.r[1] + 1
  2935.                   CASE column.r[1] > width.n - 5 : column.r[1] = width.n - 6
  2936.                   OTHERWISE          : column.r[1] = column.r[1] + 2
  2937.                ENDSWITCH
  2938.             CASE direction.n = 5 :
  2939.                SWITCH
  2940.                   CASE row.r[1] > height.n - 3
  2941.                    AND column.r[1] < 3 :
  2942.                      row.r[1] = height.n - 3
  2943.                      column.r[1] = 4
  2944.                   CASE row.r[1] > height.n - 3 :
  2945.                      column.r[1] = column.r[1] - 2
  2946.                   CASE column.r[1] < 3  :
  2947.                      row.r[1] = row.r[1] + 1
  2948.                   OTHERWISE          :
  2949.                      row.r[1] = row.r[1] + 1
  2950.                      column.r[1] = column.r[1] - 2
  2951.                ENDSWITCH
  2952.             CASE direction.n = 6 :
  2953.                SWITCH
  2954.                   CASE column.r[1] > 3 : column.r[1] = column.r[1] - 2
  2955.                   CASE row.r[1] < 2 : row.r[1] = 2
  2956.                   OTHERWISE         : row.r[1] = row.r[1] - 1
  2957.                ENDSWITCH
  2958.             CASE direction.n = 7 :
  2959.                SWITCH
  2960.                   CASE row.r[1] < 2
  2961.                    AND column.r[1] < 3 :
  2962.                      row.r[1] = 2
  2963.                      column.r[1] = 4
  2964.                   CASE row.r[1] < 2 :
  2965.                      column.r[1] = column.r[1] - 2
  2966.                   CASE column.r[1] < 3 :
  2967.                      row.r[1] = row.r[1] - 1
  2968.                   OTHERWISE         :
  2969.                      row.r[1] = row.r[1] - 1
  2970.                      column.r[1] = column.r[1] - 2
  2971.                ENDSWITCH
  2972.          ENDSWITCH
  2973.          Sleep 500                        ; Pause 1/2 second (adjustable)
  2974.       ENDFOR
  2975.       olddirection.n = direction.n                    ; Store previous direction
  2976.       GetEvent ALL To y
  2977.       IF (y["Type"] = "MOUSE" AND y["Action"] = "DOWN") OR
  2978.          y["Type"] = "KEY" THEN
  2979.          QUITLOOP
  2980.       ENDIF
  2981.    ENDWHILE
  2982.    IF IsWindow(oldcanvas.h) THEN
  2983.       SetCanvas oldcanvas.h
  2984.    ELSE
  2985.       SetCanvas Default
  2986.    ENDIF
  2987.    IF IsWindow(oldwindow.h) THEN
  2988.       Window Select oldwindow.h
  2989.    ENDIF
  2990.    Return
  2991. ENDPROC
  2992. ; ============================================================================
  2993. ;       TITLE: msScreenTimeOut.l        (c) 1991 - 1993 DataStar International
  2994. ;     RETURNS: No Value
  2995. ; DESCRIPTION: Warning - the end is near!  Message
  2996. ; ----------------------------------------------------------------------------
  2997. PROC msScreenTimeOut.l(          ; Generic Inactivity Warning
  2998.          time.a)                 ; Current time
  2999. Private  y,                      ; Getevent dynarray
  3000.          oldcanvas.n,            ; Previous Canvas
  3001.          oldwindow.n             ; Previous Window
  3002.  
  3003.    oldcanvas.n = GetCanvas()
  3004.    oldwindow.n = GetWindow()
  3005.    SetCanvas DEFAULT
  3006.    Style ATTRIBUTE SysColor(3)
  3007.    @ 0,0 ?? Format("w80,ac","Inactivity Warning!!!  " +
  3008.                      "Logout will occur in less than One Minute!")
  3009.    Style ATTRIBUTE status.n
  3010.    retval.l = false
  3011.    WHILE true
  3012.       IF time.a = SubStr(Time(),1,5) THEN
  3013.          Beep Sleep 50 Beep Sleep 50 Beep Sleep 350
  3014.          ?? " P r e s s   a   K e y !  "
  3015.       ELSE
  3016.          QUITLOOP
  3017.       ENDIF
  3018.       GetEvent ALL To y
  3019.       IF (y["Type"] = "MOUSE" AND y["Action"] = "DOWN") OR
  3020.          y["Type"] = "KEY" OR y["Type"] = "MESSAGE" THEN
  3021.          retval.l = true
  3022.          QUITLOOP
  3023.       ENDIF
  3024.    ENDWHILE
  3025.    Return retval.l
  3026. ENDPROC
  3027. ; ============================================================================
  3028. ;       TITLE: msShortcuts.a            (c) 1991 - 1993 DataStar International
  3029. ;     RETURNS: Expanded Message Value
  3030. ; DESCRIPTION: Shortcuts for Generic Information Messages
  3031. ; ----------------------------------------------------------------------------
  3032. PROC msShortcuts.a(              ; Shortcuts for Messages
  3033.          message.a)              ; Message Code
  3034.    SWITCH                                 ; shortcuts
  3035.       CASE message.a = "C" : message.a = "Operation Canceled - Returning"
  3036.       CASE message.a = "M" : message.a = "One Moment - Returning to MENU"
  3037.       CASE message.a = "P" : message.a = "P R I N T I N G  -  This will take a few moments"
  3038.       CASE message.a = "Q" : message.a = "Q U E R Y I N G  -  This will take a few moments"
  3039.       CASE message.a = "R" : message.a = "Report NOT Printed - Returning"
  3040.       CASE message.a = "W" : message.a = "W O R K I N G  -  One Moment"
  3041.       CASE message.a = "K" : message.a = "Key Violation!  Do You Want to Overwrite the Existing Record?"
  3042.       CASE message.a = "A" : message.a = "A R E   Y O U   S U R E ?"
  3043.       CASE message.a = "U" : message.a = "Unable to Lock Necessary Tables, Please Try Later"
  3044.       CASE message.a = "N" : message.a = "The Printer is NOT Responding!  Please fix Printer, or Cancel Report"
  3045.       CASE message.a = "D" : message.a = "Do You Want to DELETE This Record?"
  3046.       OTHERWISE            : message.a = "DataStar International"
  3047.    ENDSWITCH
  3048.    Return message.a
  3049. ENDPROC
  3050. ; ============================================================================
  3051. ;       TITLE: msSignBoard.u            (c) 1991 - 1993 DataStar International
  3052. ;     RETURNS: No Value
  3053. ; DESCRIPTION: Generic Message and wait for a <Continue> keypress
  3054. ; ----------------------------------------------------------------------------
  3055. PROC msSignBoard.u(              ; Generic Continue DialogBox
  3056.          title.a,                ; Title for dBox, "" for Default
  3057.          message.a,              ; Message to display
  3058.          msgcolor.n,             ; Color for Message (not DialogBox!)
  3059.          dboxpalette.a)          ; Dynarray of custom colors
  3060. Private  icon.a,
  3061.          button.l,               ; Value of selected Pushbutton
  3062.          onceflag.l,             ; True = non-continuous alert
  3063.          framehigh.n,
  3064.          framelow.n,
  3065.          display.a,
  3066.          counter.n
  3067. ;Global  g.appcolors.y           ; Global Application Colors
  3068. ;        g.sysinfo.y             ; Global System Information
  3069.  
  3070.    SetCanvas DEFAULT
  3071.    IF Len(message.a) = 1 THEN
  3072.       icon.a = msIcon.a(message.a)
  3073.       message.a = msShortcuts.a(message.a)
  3074.    ELSE
  3075.       IF alert.n > 3 THEN
  3076.          icon.a = msIcon.a("!")
  3077.       ELSE
  3078.          icon.a = msIcon.a("I")
  3079.       ENDIF
  3080.    ENDIF
  3081.  
  3082.    IF NOT IsAssigned(g.sysinfo.y) THEN
  3083.       SysInfo to g.sysinfo.y
  3084.    ENDIF
  3085.  
  3086.    DynArray dboxprocs.y[]
  3087.       dboxprocs.y["IDLE"] = "msSignBoardIdle.l"
  3088.  
  3089.    framehigh.n = 76 ; inAttributeConvert.n(SysColor(1036),true)
  3090.    framelow.n  = 64 ; inAttributeConvert.n(SysColor(1036),false)
  3091.    button.l    = true
  3092.    toprow.n    = 7
  3093.    leftcol.n   = Int((g.sysinfo.y["ScreenWidth"]-60)/2)
  3094.    title.a     = IIF(title.a = "", "Press <Enter> to Continue", title.a)
  3095.    message.a   = Spaces(54) + message.a
  3096.    display.a   = Spaces(54)
  3097.  
  3098.    SHOWDIALOG title.a
  3099.       Proc "dbEventHandler.l"
  3100.          Idle Trigger "OPEN"    ; Wait for Key Alert
  3101.       @ -200,-200
  3102.       Height 7 Width 60
  3103.  
  3104.       Frame From 0,1 To 2,56
  3105.          PaintCanvas Border Attribute framelow.n  0,1,2,56
  3106.          PaintCanvas Border Attribute framehigh.n 0,1,0,55
  3107.          PaintCanvas Border Attribute framehigh.n 0,1,2,1
  3108.  
  3109.       PaintCanvas Fill display.a Attribute msgcolor.n 1,2,1,55
  3110.  
  3111.       PushButton @ 3,23
  3112.          Width 12 "~C~ontinue"
  3113.          OK Default Value dbButtonPress.v(true) Tag "OK"
  3114.       To button.l
  3115.    ENDDIALOG
  3116.    msWorkingClear.u()
  3117.    Return
  3118. ENDPROC
  3119. ; ============================================================================
  3120. ;       TITLE: msSignBoardIdle.l        (c) 1991 - 1993 DataStar International
  3121. ;     RETURNS: No Value
  3122. ; DESCRIPTION: Generic Message and wait for a <Continue> keypress
  3123. ; ----------------------------------------------------------------------------
  3124. PROC msSignBoardIdle.l()         ; SignBoard IDLE routine
  3125. ;Global  message.a               ; Original message
  3126. ;        display.a               ; Portion to display
  3127. ;        counter.n               ; Tracking counter for message
  3128.    display.a = SubStr(message.a,1,54)
  3129.    message.a = SubStr(message.a,2,255) + SubStr(message.a,1,1)
  3130.    IF NOT IsAssigned(counter.n) THEN
  3131.       counter.n = 0
  3132.    ENDIF
  3133.    IF counter.n = 8 THEN
  3134.       counter.n = 1
  3135.       Sound 440 100
  3136.    ELSE
  3137.       counter.n = counter.n + 1
  3138.       Sound 9 2
  3139.       Sleep 100
  3140.    ENDIF
  3141.    Return true
  3142. ENDPROC
  3143. ; ============================================================================
  3144. ;       TITLE: msTeleType.u             (c) 1991 - 1993 DataStar International
  3145. ;     RETURNS: No value
  3146. ; DESCRIPTION: Writes string to screen at passed coordinates. Clicks with
  3147. ;              each letter written. Speed controlled by speed.n variable.
  3148. ; ----------------------------------------------------------------------------
  3149. PROC msTeleType.u(               ; Scrolls text onto canvas
  3150.          row.n,                  ; Relative Row position
  3151.          column.n,               ; Relative Column position
  3152.          string.a,               ; Message to write to Canvas
  3153.          speed.n)                ; Speed to write (0=fastest, 10=slowest)
  3154. Private  n                       ; Transient Loop Counter
  3155.    FOR n from 1 To Len(String.a)
  3156.       @ row.n,column.n + n - 1
  3157.       ?? SubStr(string.a,n,1)
  3158.       Sound 9 2
  3159.       Sleep Max(1,Min(speed.n,10))*10
  3160.    ENDFOR
  3161.    Return
  3162. ENDPROC
  3163. ; ============================================================================
  3164. ;       TITLE: msTickerTape.u           (c) 1991 - 1993 DataStar International
  3165. ;     RETURNS: No value
  3166. ; DESCRIPTION: Writes string to screen backwards at passed coordinates.
  3167. ;              Clicks with each letter. Speed controlled by speed.n variable.
  3168. ; ----------------------------------------------------------------------------
  3169. PROC msTickerTape.u(             ; Scrolls text onto canvas
  3170.          row.n,                  ; Relative Row position
  3171.          column.n,               ; Relative Column position
  3172.          string.a,               ; Message to write to Canvas
  3173.          speed.n)                ; Speed to write (0=fastest, 10=slowest)
  3174. Private  n,                      ; Transient Loop Counter
  3175.          length.n                ; Length of string
  3176.    length.n = Len(string.a)
  3177.    FOR n from 1 To length.n
  3178.       @ row.n,column.n + length.n - n
  3179.       ?? SubStr(string.a,1,n)
  3180.       Sound 9 2
  3181.       Sleep Max(1,Min(speed.n,10))*10
  3182.    ENDFOR
  3183.    Return
  3184. ENDPROC
  3185. ; ============================================================================
  3186. ;       TITLE: msWorking.u              (c) 1991 - 1993 DataStar International
  3187. ;     RETURNS: No value
  3188. ; DESCRIPTION: Generic Information Message Window, Cleared as follows:
  3189. ;                 0 Seconds      - must be manually cleared
  3190. ;                 1 - 5 Seconds  - self-clears
  3191. ;                -1 Seconds      - pauses while event = IDLE, then clears
  3192. ; ----------------------------------------------------------------------------
  3193. PROC msWorking.u(                ; Generic information message window
  3194.          message.a,              ; Message to display (<ScreenWidth
  3195.          color.n,                ; Color for message window
  3196.          beep.n,                 ; Number of beeps
  3197.          sleep.n)                ; # of Seconds to pause (-1 to 5)
  3198. Private  y, n,
  3199.          width.n,
  3200.          oldcanvas.h,
  3201.          oldwindow.h,
  3202.          offset.n
  3203. ;Global  g.message.h
  3204. ;        g.sysinfo.y
  3205.  
  3206.    IF Len(message.a) = 1 THEN
  3207.       message.a = msShortcuts.a(message.a)
  3208.    ENDIF
  3209.    message.a = message.a + "..."
  3210.  
  3211.    IF NOT IsAssigned(g.sysinfo.y) THEN
  3212.       SysInfo To g.sysinfo.y             ; Determine Screen Size
  3213.    ENDIF
  3214.  
  3215.    msWorkingClear.u()
  3216.  
  3217.    DynArray y[]
  3218.       y["CanClose"] = False
  3219.       y["CanMaximize"] = False
  3220.       y["CanMove"] = False
  3221.       y["CanResize"] = False
  3222.       y["HasFrame"] = False    ; If Framed, window is *5* rows!!!
  3223.       y["Style"] = color.n
  3224.  
  3225.  
  3226.    width.n = Max(50,Min(Len(message.a)+4,g.sysinfo.y["ScreenWidth"]-4))
  3227.    offset.n = Max(5,Int((width.n-Len(message.a)+1)/2)+3)
  3228.    oldcanvas.h = GetCanvas()
  3229.    oldwindow.h = GetWindow()
  3230.  
  3231.  
  3232.    Window Create  Floating @ -200,-200
  3233.                   Height 1 Width width.n
  3234.                   Attributes y To g.message.h
  3235.  
  3236.    Style Attribute color.n
  3237.    PaintCanvas Fill Format("w"+StrVal(width.n)+",ac",message.a) Attribute color.n  0,0,0,width.n-1
  3238.    PaintCanvas Attribute color.n + 128  0,width.n - offset.n,0,width.n-offset.n+2
  3239.  
  3240.    Window Move g.message.h To 1, Int((g.sysinfo.y["ScreenWidth"]-width.n)/2)
  3241.  
  3242.    FOR n from 1 to Min(5,beep.n)
  3243.       Beep Sleep 100                   ; Beep for desired # of Beeps
  3244.    ENDFOR
  3245.  
  3246.    SWITCH
  3247.       CASE sleep.n > 0  :
  3248.          Sleep Min(sleep.n,5) * 1000   ; Sleep for desired # of seconds
  3249.          Window Select g.message.h
  3250.          Window Close
  3251.       CASE sleep.n < 0  :
  3252.          Message "Mouseclick or Press Any Key to Continue..."
  3253.          WHILE true
  3254.             GetEvent ALL To y
  3255.             IF (y["Type"] = "MOUSE" AND y["Action"] = "DOWN") OR
  3256.                y["Type"] = "KEY" THEN
  3257.                QUITLOOP
  3258.             ENDIF
  3259.          ENDWHILE
  3260.          Window Select g.message.h
  3261.          Window Close
  3262.    ENDSWITCH
  3263.  
  3264.    IF IsWindow(oldcanvas.h) THEN
  3265.       SetCanvas oldcanvas.h
  3266.    ELSE
  3267.       SetCanvas Default
  3268.    ENDIF
  3269.    IF IsWindow(oldwindow.h) THEN
  3270.       Window Select oldwindow.h
  3271.    ENDIF
  3272.    Return
  3273. ENDPROC
  3274. ; ============================================================================
  3275. ;       TITLE: msWorkingClear.u         (c) 1991 - 1993 DataStar International
  3276. ;     RETURNS: No value
  3277. ; DESCRIPTION: Generic Information Message Window Clearer
  3278. ; ----------------------------------------------------------------------------
  3279. PROC msWorkingClear.u()          ; Clears msWorking message
  3280. Private  oldwindow.h,
  3281.          oldcanvas.h
  3282. ;Global  g.message.h
  3283.    oldwindow.h = GetWindow()
  3284.    oldcanvas.h = GetCanvas()
  3285.    IF IsAssigned(g.message.h) AND IsWindow(g.message.h) THEN
  3286.       Window Select g.message.h
  3287.       Window Close
  3288.    ENDIF
  3289.    IF IsWindow(oldcanvas.h) THEN
  3290.       SetCanvas oldcanvas.h
  3291.    ELSE
  3292.       SetCanvas Default
  3293.    ENDIF
  3294.    IF IsWindow(oldwindow.h) THEN
  3295.       Window Select oldwindow.h
  3296.    ENDIF
  3297.    Return
  3298. ENDPROC
  3299. ; ============================================================================
  3300. ;       TITLE: msWrap.a                 (c) 1991 - 1993 DataStar International
  3301. ;     RETURNS: Formatted 200 char message
  3302. ; DESCRIPTION: Formats message for dBox message routines
  3303. ; ----------------------------------------------------------------------------
  3304. PROC msWrap.a(                   ; Formats message for dBox
  3305.          message.a)              ; Message to format
  3306. Private  n1,
  3307.          n2,
  3308.          n3
  3309.    IF Len(message.a) < 41 THEN
  3310.       message.a = Spaces(80) + Format("w40,ac",message.a) + Spaces(80)
  3311.    ELSE
  3312.       IF Len(message.a) < 121 THEN
  3313.          message.a = Spaces(40) + message.a
  3314.       ENDIF
  3315.       FOR n1 From 40 To 160 Step 40
  3316.          n2 = n1 + 1
  3317.          WHILE SubStr(message.a, n2, 1) <> " "
  3318.             n2 = n2 - 1
  3319.          ENDWHILE
  3320.          n3 = n2 + 1
  3321.          WHILE SubStr(message.a, n3, 1) = " "
  3322.             n3 = n3 + 1
  3323.          ENDWHILE
  3324.          message.a = Format("w"+StrVal(n1),SubStr(message.a,1,n2-1)) +
  3325.                      Format("w"+StrVal(200-n1),SubStr(message.a,n3,200))
  3326.       ENDFOR
  3327.    ENDIF
  3328.    Return message.a
  3329. ENDPROC
  3330. ; ============================================================================
  3331. ;       TITLE: quExecute.l              (c) 1991 - 1993 DataStar International
  3332. ;     RETURNS: Logical true/false IF Query successful
  3333. ; DESCRIPTION: Generic Query processor
  3334. ; ----------------------------------------------------------------------------
  3335. PROC quExecute.l(                ; Generic Query Processor
  3336.          clear.l)                ; Should resultant table be cleared?
  3337. Private  error.l,                ; Error routine flag
  3338.          proc.a,                 ; Name of current procedure
  3339.          retval.l                ; Value to return
  3340.    proc.a = "quExecute.l"
  3341.    error.l = false
  3342.    Do_It!                        ; Main Errorproc checks IF Query Completes
  3343.    IF error.l OR Window() <> "" THEN
  3344.       msContinue!.u("","Query Error - " + Window(),79,"RED",4)
  3345.       retval.l = false
  3346.       IF IsAssigned(g.debug.l) AND g.debug.l THEN
  3347.          DEBUG
  3348.       ENDIF
  3349.    ELSE
  3350.       IF clear.l THEN
  3351.          ClearImage
  3352.       ENDIF
  3353.       WHILE NImages() > 0
  3354.          MoveTo 1
  3355.          IF ImageType() = "Query" THEN
  3356.             ClearImage
  3357.          ELSE
  3358.             QUITLOOP
  3359.          ENDIF
  3360.       ENDWHILE
  3361.       retval.l = true
  3362.    ENDIF
  3363.    Return retval.l
  3364. ENDPROC
  3365. ; ============================================================================
  3366. ;       TITLE: quPAL.u()                (c) 1991 - 1993 DataStar International
  3367. ;     RETURNS: No value
  3368. ; DESCRIPTION: Dialog box user interface to present utility options
  3369. ;              and control execution.  Requires the following procedures:
  3370. ;                 dbAlert.l               Alert procedure for dialog boxes
  3371. ;                 dbButtonPress.v         Pauses depressed dbox button
  3372. ;                 dbEventHandler.l        Generic dbox event handler
  3373. ;                 msContinue!.u           Generic message dialog box
  3374. ;                 inAllFieldsChecked.l    Determines if every field is checked
  3375. ;                 inBackSlashDouble.a     Doubles backslashes in a string
  3376. ;                 inBackslashQuotes.a     Adds backslashes to quotes
  3377. ;                 ioAcceptDialog.v        Accepts procedure name
  3378. ;                 ioAcceptDialogValue.v   Generic Accept sub-routine
  3379. ; ----------------------------------------------------------------------------
  3380. PROC quPAL.u()                   ; Turns Query Image into PAL code
  3381. Private  pushbutton.l,           ; Button variable
  3382.          justification.n,        ; Output justification type
  3383.          outputfile.a,           ; Output file name
  3384.          proceduralize.n,        ; Proceduralize flag
  3385.          frametag.a,             ; Current tag for framing
  3386.          framehigh.n,            ; Highlight color for framing
  3387.          framelow.n,             ; lowlight color for framing
  3388.          dboxpalette.a           ; Color palette for dialog box
  3389.    framehigh.n     = 127
  3390.    framelow.n      = 112
  3391.    pushbutton.l    = false
  3392.    outputfile.a    = "INSTANT"
  3393.    justification.n = 1
  3394.    proceduralize.n = 1
  3395.    dboxpalette.a   = "GRAY"
  3396.  
  3397.    IF NImages() > 0 THEN
  3398.       SHOWDIALOG "Paladin Query Converter"
  3399.          Proc "dbEventHandler.n"
  3400.             Trigger "ARRIVE"
  3401.          @4,14 Height 15 Width 53
  3402.  
  3403.          Frame Single From 2,1 To 4,49
  3404.             PaintCanvas Attribute IIF(frametag.a = "FILE",framehigh.n,framelow.n)
  3405.                         2,1,4,49
  3406.             PaintCanvas Attribute IIF(frametag.a = "FILE",framelow.n,framehigh.n)
  3407.                         2,49,4,49
  3408.             PaintCanvas Attribute IIF(frametag.a = "FILE",framelow.n,framehigh.n)
  3409.                         4,2,4,49
  3410.  
  3411.          Frame Single From 5,1 To 8,49
  3412.             PaintCanvas Attribute IIF(Search("JUST",frametag.a) = 1,
  3413.                                       framehigh.n,framelow.n)
  3414.                         5,1,8,49
  3415.             PaintCanvas Attribute IIF(Search("JUST",frametag.a) = 1,
  3416.                                       framelow.n,framehigh.n)
  3417.                         5,49,8,49
  3418.             PaintCanvas Attribute IIF(Search("JUST",frametag.a) = 1,
  3419.                                       framelow.n,framehigh.n)
  3420.                         8,2,8,49
  3421.  
  3422.          Frame Single From 9,1 To 12,49
  3423.             PaintCanvas Attribute IIF(Search("PUSH",frametag.a) = 1,
  3424.                                       framehigh.n,framelow.n)
  3425.                         9,1,12,49
  3426.             PaintCanvas Attribute IIF(Search("PUSH",frametag.a) = 1,
  3427.                                       framelow.n,framehigh.n)
  3428.                         9,49,12,49
  3429.             PaintCanvas Attribute IIF(Search("PUSH",frametag.a) = 1,
  3430.                                       framelow.n,framehigh.n)
  3431.                         12,2,12,49
  3432.  
  3433.          PaintCanvas Fill "Output File Name:"
  3434.                      Attribute 112 3,3,3,19
  3435.          PaintCanvas Fill "Justification:"
  3436.                      Attribute 112 6,3,6,16
  3437.          PaintCanvas Fill "Proceduralize:"
  3438.                      Attribute 112 7,3,7,16
  3439.          PaintCanvas Fill " Paladin Query-To-PAL Converter "
  3440.                      Attribute 94 0,9,0,40
  3441.          PaintCanvas Fill Fill("▀",32)
  3442.                      Attribute 112 1,10,1,41
  3443.          PaintCanvas Fill "▄"
  3444.                      Attribute 112 0,41,0,41
  3445.  
  3446.          Accept @3,20 Width 28
  3447.             "A8" Picture "*!" Tag "FILE"
  3448.          To outputfile.a
  3449.  
  3450.          RadioButtons @6,17 Height 1 Width 32
  3451.             "Flush",
  3452.             "Right",
  3453.             "Left"
  3454.             Tag "JUST1"
  3455.          To justification.n
  3456.  
  3457.          RadioButtons @7,17 Height 1 Width 18
  3458.             "No",
  3459.             "Yes"
  3460.             Tag "JUST2"
  3461.          To proceduralize.n
  3462.  
  3463.          PushButton @10,8 Width 15 "~D~o_It!"
  3464.             Default Value quPALCreate.l(outputfile.a) Tag "PUSH1"
  3465.          To pushbutton.l
  3466.  
  3467.          PushButton @10,28 Width 15 "~C~ancel"
  3468.             Cancel Value dbButtonPress.v(false) Tag "PUSH2"
  3469.          To pushbutton.l
  3470.       ENDDIALOG
  3471.    ELSE
  3472.       msContinue!.u("","Sorry, there are no images present",31,"BLUE",1)
  3473.    ENDIF
  3474.    Return
  3475. ENDPROC
  3476. ; ============================================================================
  3477. ;       TITLE: quPALCreate.u()          (c) 1991 - 1993 DataStar International
  3478. ;     RETURNS: No value
  3479. ; DESCRIPTION: Converts interactive query images to PAL code
  3480. ; ----------------------------------------------------------------------------
  3481. PROC quPALCreate.l(              ; Converts Query images to PAL code
  3482.          outputfile.a)           ; Name of output file
  3483. Private  columns.n,              ; Number of columns in query image
  3484.          firstimage.a,           ; Query image 1
  3485.          blankrow.l,             ; True if entire row is blank
  3486.          row.n,                  ; Image row numbers
  3487.          fieldvalues.y,          ; Contents of fields
  3488.          checkstatus.y,          ; Check mark status of fields
  3489.          fieldorder.r,           ; Sequential order of fields
  3490.          allchecks.l,            ; True if checkmark status same in all fields
  3491.          maxlength.n,            ; Maximum length of field for output format
  3492.          retval.l,               ; Return variable
  3493.          outputproc.a,           ; Output procedure name
  3494.          n, n1, n2               ; Transient loop counters
  3495.    WHILE true
  3496.       retval.l = false
  3497.       IF NImages() = 0 THEN                  ; Check for no images
  3498.          msContinue!.u("","Sorry, there are no images present",31,"BLUE",1)
  3499.          QUITLOOP
  3500.       ENDIF
  3501.  
  3502.       IF Search(".",outputfile.a) > 0 THEN   ; Check for file extensions
  3503.          msContinue!.u("","Sorry, the Filename cannot have an extension",31,"BLUE",1)
  3504.          SelectControl "FILE"
  3505.          QUITLOOP
  3506.       ENDIF
  3507.  
  3508.       MoveTo 1                               ; If any query images, they start
  3509.       IF ImageType() <> "Query" THEN         ;  at Image #1
  3510.          msContinue!.u("","Sorry, there are no Query images present",31,"BLUE",1)
  3511.          QUITLOOP
  3512.       ENDIF
  3513.  
  3514.       outputfile.a = outputfile.a + ".SC"
  3515.       IF IsFile(outputfile.a) THEN           ; Check for file name
  3516.          Beep Sleep 50 Beep Sleep 50 Beep
  3517.          SHOWPOPUP Upper(outputfile.a) + " Already Exists" CENTERED
  3518.             "~A~ppend"     : "Append Current File Name"     : "APPEND",
  3519.             "~O~verwrite"  : "Overwrite Current File Name"  : "OVER",
  3520.             "~R~ename"     : "Rename Current File Name"     : "RENAME"
  3521.          ENDMENU
  3522.          TO menuchoice.a
  3523.  
  3524.          IF NOT retval then
  3525.             QUITLOOP
  3526.          ENDIF
  3527.  
  3528.          SWITCH
  3529.             CASE menuchoice.a = "OVERWRITE"  :
  3530.                Editor New outputfile.a
  3531.                {Cancel} {Yes}
  3532.             CASE menuchoice.a =  "RENAME"    :
  3533.                SelectControl "FILE"
  3534.                QUITLOOP
  3535.          ENDSWITCH
  3536.       ENDIF
  3537.  
  3538.       IF proceduralize.n = 2 THEN    ;proceduralize output
  3539.          outputproc.a = ioAcceptDialog.v(3, 15, "Query Procedure Name",
  3540.                                         "Enter Proc Name", "A40", "", "",
  3541.                                          false, "")
  3542.          IF outputproc.a = false THEN
  3543.             QUITLOOP
  3544.          ENDIF
  3545.       ENDIF
  3546.  
  3547.       Print File outputfile.a "\n",
  3548.                               ";         quPAL: Begin Query \n",
  3549.                               ";     Generated: " +
  3550.                                Format("d2",Today()) + " - " + Time() + "\n",
  3551.                               ";   Description:\n\n"
  3552.       IF proceduralize.n = 2 THEN    ;proceduralize output
  3553.          Print File outputfile.a "PROC " + outputproc.a + "\n\n",
  3554.                                  "Private  retval.v\n\n\n"
  3555.       ENDIF
  3556.  
  3557.       MoveTo 1
  3558.       FOR n2 FROM 1 TO Nimages()
  3559.          IF ImageType() = "Query" THEN       ; Process query images only
  3560.             firstimage.a = Table()
  3561.             columns.n = Nfields(Table())+1
  3562.             blankrow.l = true
  3563.             row.n = 1
  3564.  
  3565.             Print File outputfile.a "\n {Ask} SELECT \"" +
  3566.                                     inBackSlashDouble.a(Table()) + "\"\n"
  3567.             Home
  3568.             WHILE true
  3569.                CtrlHome
  3570.                DynArray fieldvalues.y[]
  3571.                DynArray checkstatus.y[]
  3572.                Array fieldorder.r[columns.n]
  3573.                maxlength.n = 0
  3574.                FOR n From 1 To columns.n
  3575.                   Message "Reading - Row: "+StrVal(row.n)+", Column: "+Strval(n)
  3576.                   fieldvalues.y[Field()] = []
  3577.                   checkstatus.y[Field()] = CheckMarkStatus()
  3578.                   fieldorder.r[n] = Field()
  3579.                   IF NOT IsBlank([] + CheckMarkStatus()) THEN
  3580.                      maxlength.n = Max(Len(Field()),maxlength.n)
  3581.                      blankrow.l = false
  3582.                   ENDIF
  3583.                   Right
  3584.                ENDFOR
  3585.                IF blankrow.l THEN
  3586.                   QUITLOOP
  3587.                ELSE
  3588.                   IF row.n > 1 THEN
  3589.                      Print File outputfile.a "  DOWN\n"
  3590.                   ENDIF
  3591.                ENDIF
  3592.  
  3593.                allchecks.l = inAllFieldsChecked.l(fieldorder.r,
  3594.                                                    checkstatus.y,
  3595.                                                    columns.n)
  3596.                IF allchecks.l THEN
  3597.                   Print File outputfile.a
  3598.                               "  CTRLHOME " +
  3599.                               Upper(checkstatus.y[fieldorder.r[2]]) +"\n"
  3600.                ENDIF
  3601.  
  3602.                IF NOT IsBlank(fieldvalues.y[fieldorder.r[1]]) THEN
  3603.                   Print File outputfile.a
  3604.                               "  \"" +
  3605.                               inBackslashQuotes.a(Upper(fieldvalues.y[fieldorder.r[1]]))+"\"\n"
  3606.                ENDIF
  3607.  
  3608.                FOR n1 FROM 2 To columns.n
  3609.                   Message "Writing Row: " + StrVal(row.n) +
  3610.                            ", Column: " + Strval(n)
  3611.                   IF NOT allchecks.l AND
  3612.                      NOT IsBlank(checkstatus.y[fieldorder.r[n1]]) THEN
  3613.                      SWITCH
  3614.                         CASE justification.n = 1 : ; Full justification
  3615.                            Print File outputfile.a
  3616.                                        "  MoveTo" +
  3617.                                        Spaces((maxlength.n)-(len(fieldorder.r[n1]))+1) +
  3618.                                        "[" + fieldorder.r[n1] + "]   " +
  3619.                                        Upper(checkstatus.y[fieldorder.r[n1]]) + "\n"
  3620.  
  3621.                         CASE justification.n = 2 :  ;Right justification
  3622.                            Print File outputfile.a
  3623.                                        Spaces((maxlength.n)-(len(fieldorder.r[n1]))+3) +
  3624.                                        "MoveTo [" + fieldorder.r[n1] + "]   " +
  3625.                                        Upper(checkstatus.y[fieldorder.r[n1]]) + "\n"
  3626.  
  3627.                         CASE justification.n = 3 :   ;left justification
  3628.                            Print File outputfile.a
  3629.                                        "MoveTo [" + fieldorder.r[n1] + "]   " +
  3630.                                        Upper(checkstatus.y[fieldorder.r[n1]]) + "\n"
  3631.                      ENDSWITCH
  3632.                   ENDIF
  3633.  
  3634.                   IF NOT IsBlank(fieldvalues.y[fieldorder.r[n1]]) THEN
  3635.                      SWITCH
  3636.                         CASE justification.n = 1 : ; Full justification
  3637.                            Print File outputfile.a
  3638.                                        Spaces((maxlength.n+7)-(len(fieldorder.r[n1]))+2) +
  3639.                                        "[" + fieldorder.r[n1] + "] = \"" +
  3640.                                        inBackslashQuotes.a(fieldvalues.y[fieldorder.r[n1]]) +
  3641.                                        "\"\n"
  3642.  
  3643.                         CASE justification.n = 2 : ; Right justification
  3644.                            Print File outputfile.a
  3645.                                        Spaces((maxlength.n+7)-(len(fieldorder.r[n1]))+3) +
  3646.                                        "[" + fieldorder.r[n1] + "] = \"" +
  3647.                                        inBackslashQuotes.a(fieldvalues.y[fieldorder.r[n1]]) +
  3648.                                        "\"\n"
  3649.  
  3650.                         CASE justification.n = 3 : ; Left justification
  3651.                            Print File outputfile.a
  3652.                                        "[" + fieldorder.r[n1] + "] = \"" +
  3653.                                        inBackslashQuotes.a(fieldvalues.y[fieldorder.r[n1]]) +
  3654.                                        "\"\n"
  3655.                      ENDSWITCH
  3656.                   ENDIF
  3657.                ENDFOR
  3658.                row.n = row.n + 1
  3659.                blankrow.l = true
  3660.             ENDWHILE
  3661.             Home CtrlHome
  3662.          ENDIF
  3663.          DownImage
  3664.       ENDFOR
  3665.       CtrlHome
  3666.       Print File outputfile.a "\n",
  3667.                               "; Do_It! \n",
  3668.                               "; quExecute.l(True)\n",
  3669.                               "; IF NOT retval THEN\n",
  3670.                               ";    DEBUG\n",
  3671.                               "; ENDIF\n",
  3672.                               ";\n",
  3673.                               ";== End Query ==\n"
  3674.  
  3675.       IF proceduralize.n = 2 THEN  ;proceduralize output
  3676.          Print File outputfile.a "\n",
  3677.                                  "ENDPROC\n",
  3678.                                  ";??\"\\004\"\n",
  3679.                                  ";WRITELIB libname.a ",
  3680.                                  IIF(Search("(",outputproc.a) = 0,
  3681.                                      outputproc.a + "\n",
  3682.                                      SubStr(outputproc.a,1,(Search("(",outputproc.a)-1)) +
  3683.                                      "\n")
  3684.       ENDIF
  3685.  
  3686.       SelectControl "PUSH2"
  3687.       Message "Conversion Complete"
  3688.       retval.l = true
  3689.       QUITLOOP
  3690.    ENDWHILE
  3691.    Return retval.l
  3692. ENDPROC
  3693. ; ===========================================================================
  3694. ;       TITLE: utSpeedButtonsEnable.u
  3695. ;     RETURNS: No value
  3696. ; DESCRIPTION: Places SpeedButtons at desired location; creates Window if it
  3697. ;              does not exist.
  3698. ; ---------------------------------------------------------------------------
  3699. PROC utSpeedButtonsEnable.u(     ; Restores or establishes SpeedButtons
  3700.          row.n,                  ; Row to establish SpeedButtons window
  3701.          column.n,               ; Column to establish SpeedButtons window
  3702.          colors.v)               ; DynArray of custom colors, or ""
  3703. ;Global  g.handles.y             ; Stores application window handles
  3704.    IF NOT IsAssigned(g.handles.y) THEN
  3705.       DynArray g.handles.y[]
  3706.    ENDIF
  3707.  
  3708.    IF NOT IsAssigned(g.handles.y["SpeedButtons"]) OR
  3709.       NOT IsWindow(g.handles.y["SpeedButtons"]) THEN
  3710.       utSpeedButtonsSetup.u(colors.v)        ; Establish a new window
  3711.    ENDIF
  3712.  
  3713.    Window MOVE g.handles.y["SpeedButtons"]
  3714.           To row.n, column.n                 ; Bring it to desired location
  3715.    Return
  3716. ENDPROC
  3717. ; ===========================================================================
  3718. ;       TITLE: utSpeedButtonsSetup.u
  3719. ;     RETURNS: No Value
  3720. ; DESCRIPTION: Sets up mouse SpeedButtons
  3721. ; ---------------------------------------------------------------------------
  3722. PROC utSpeedButtonsSetup.u(      ; Generic Mouse SpeedButtons Setup
  3723.          colors.v)               ; DynArray of Colors, or ""
  3724. Private  current.w,              ; Current Window Handle
  3725.          canvas.w,               ; Current Canvas Window Handle
  3726.          speedbuttons.y,         ; SpeedButtons window dynarray
  3727.          iconcolor.n,            ; Color of SpeedButton icons
  3728.          barcolor.n,             ; Color of SpeedButton divider bars
  3729.          n,                      ; Loop incrementer
  3730.          y                       ; Transient window attributes dynarray
  3731. ;Global  g.handles.y             ; Global window handle dynarray
  3732.  
  3733.    IF NOT IsAssigned(g.handles.y) THEN
  3734.       DynArray g.handles.y[]     ; Create window-tracking dynarray
  3735.    ENDIF
  3736.  
  3737.    iconcolor.n = IIF(IsBlank(colors.v),SysColor(1003),colors.v["1003"])
  3738.    barcolor.n  = IIF(IsBlank(colors.v),SysColor(1001),colors.v["1001"])
  3739.    Window HANDLE CURRENT To current.w        ; Save current window handle
  3740.    canvas.w = GetCanvas()                    ; Save current window handle
  3741.  
  3742.    DynArray speedbuttons.y[]                 ; Create a dynamic array for specs
  3743.       speedbuttons.y["CanClose"] = False
  3744.       speedbuttons.y["CanMaximize"] = False
  3745.       speedbuttons.y["CanMove"] = False
  3746.       speedbuttons.y["CanResize"] = False
  3747.       speedbuttons.y["Echo"] = False
  3748.       speedbuttons.y["HasShadow"] = False
  3749.       speedbuttons.y["HasFrame"] = False     ; IF Framed, window is *5* rows!!!
  3750.       speedbuttons.y["Style"] = iconcolor.n
  3751.    Window CREATE  FLOATING @ -200,-200
  3752.                   HEIGHT 1 WIDTH 37
  3753.                   ATTRIBUTES speedbuttons.y To g.handles.y["SpeedButtons"]
  3754.  
  3755.    SetCanvas g.handles.y["SpeedButtons"]     ; Set Canvas to SpeedButtons Window
  3756.    @ 0,0 ?? "│ \30 │ \174 │ \27 │Pg\24│ ? │Pg\25│ \26 │ \175 │ \31 │"
  3757.    FOR n From 0 To 9                         ; Color divider bars
  3758.       PaintCanvas ATTRIBUTE barcolor.n  0,0+(n*4),0,0+(n*4)
  3759.    ENDFOR
  3760.  
  3761.    IF IsWindow(canvas.w) THEN                ; Restore focus
  3762.       SetCanvas canvas.w
  3763.    ELSE
  3764.       SetCanvas Default
  3765.    ENDIF
  3766.  
  3767.    IF IsWindow(current.w) THEN
  3768.       Window SELECT current.w                ; Restore original Window
  3769.    ENDIF
  3770.    Return
  3771. ENDPROC
  3772. ; ===========================================================================
  3773. ;       TITLE: utSpeedButtonsPressed.u
  3774. ;     RETURNS: No value
  3775. ; DESCRIPTION: Determines which button was selected, colors it to appear
  3776. ;              depressed, and calls the SpeedBar dispatch procedure
  3777. ; ---------------------------------------------------------------------------
  3778. PROC utSpeedButtonsPressed.u(    ; Handles Mouse Events on Buttons window
  3779.          event.y,                ; Wait Proc Event DynArray
  3780.          pushcolor.n)            ; Color for "depressed" button (11 is good)
  3781. Private  canvas.w,               ; Current canvas
  3782.          current.w,              ; Current window
  3783.          button.n,               ; Which button was "pressed"
  3784.          y                       ; DynArray of Window attributes
  3785.    IF NImages() = 0 OR IsEmpty(Table()) THEN
  3786.       msWorking.u("Table is Empty",79,3,2)
  3787.    ELSE
  3788.       ; You may need code here to block activity if editing/adding a record,
  3789.       ;  if you do not control how this proc is called from within your wait
  3790.       ;  handler.
  3791.       canvas.w = GetCanvas()                 ; Current canvas focus
  3792.       LocalizeEvent event.y                  ; Set Row/Column position
  3793.       SetCanvas g.handles.y["SpeedButtons"]  ;  relative to current window
  3794.                                              ; Determines current Style attrib
  3795.       Window GetAttributes g.handles.y["SpeedButtons"] To y
  3796.  
  3797.       IF Mod(event.y["Col"],4) <> 0 THEN     ; 0 = Clicked on a divider bar
  3798.          button.n = Int(event.y["Col"]/4)+1  ; Buttons are evenly spaced
  3799.          PaintCanvas Attribute pushcolor.n 0,(button.n*4)-3,0,(button.n*4)-1
  3800.          utSpeedButtonsDispatch.u(button.n,pushcolor.n)
  3801.          Sleep 300                           ; Pause for "depressed" effect
  3802.          PaintCanvas Attribute y["Style"]  0,(button.n*4)-3,0,(button.n*4)-1
  3803.       ELSE
  3804.          Beep
  3805.       ENDIF
  3806.  
  3807.       IF IsWindow(canvas.w) THEN             ; Restore focus
  3808.          SetCanvas canvas.w
  3809.       ELSE
  3810.          SetCanvas Default
  3811.       ENDIF
  3812.    ENDIF
  3813.    Return
  3814. ENDPROC
  3815. ; ===========================================================================
  3816. ;       TITLE: utSpeedButtonsDispatch.u
  3817. ;     RETURNS: No value
  3818. ; DESCRIPTION: Dispatches actions based upon which button was pressed
  3819. ; ---------------------------------------------------------------------------
  3820. PROC utSpeedButtonsDispatch.u(   ; Calls action appropriate to button
  3821.          button.n,color.n)               ; Button number
  3822. Private  y                       ; Transient GetEvent DynArray
  3823. ;Global  g.scrollrate.n          ; Scroll rate in milliseconds
  3824.    IF NOT IsAssigned(g.scrollrate.n) THEN    ; Initialize scroll variable
  3825.       g.scrollrate.n = 300
  3826.    ENDIF
  3827.  
  3828.    SWITCH
  3829.       CASE button.n = 1 :                    ; Home
  3830.          Home
  3831.          Message "Beginning of Table..."
  3832.       CASE button.n = 2 :                    ; Reverse Scroll
  3833.          IF NOT AtFirst() THEN
  3834.             WHILE NOT AtFirst()
  3835.                Skip -1
  3836.                Echo NORMAL Echo OFF
  3837.                Message "Reverse Scroll, Record ",RecNo()," - MouseClick or Press Any Key to Stop..."
  3838.                Sleep g.scrollrate.n
  3839.                GetEvent ALL To y
  3840.                IF (y["Type"] = "MOUSE" AND y["Action"] = "UP") OR
  3841.                   y["Type"] = "KEY" THEN
  3842.                   QUITLOOP
  3843.                ENDIF
  3844.             ENDWHILE
  3845.             Message "You are on Record " + StrVal(RecNo()) + "..."
  3846.          ELSE
  3847.             Beep
  3848.             Message "You are at the First Record in this Image..."
  3849.          ENDIF
  3850.       CASE button.n = 3 :                    ; Skip -1
  3851.          IF NOT AtFirst() THEN
  3852.             Skip -1
  3853.             Message "Record " +Strval([#])+ "..."
  3854.          ELSE
  3855.             Beep
  3856.             Message "You are at the First Record in this Image..."
  3857.          ENDIF
  3858.       CASE button.n = 4 :                    ; PgUp
  3859.          IF IsFormView() THEN
  3860.             IF AtFirst() AND PageNo() = 1 THEN
  3861.                Beep
  3862.                IF NPages() = 1 THEN
  3863.                   Message "You are at the First Record in this Image..."
  3864.                ELSE
  3865.                   Message "You are at the First Record's First Page in this Image..."
  3866.                ENDIF
  3867.             ELSE
  3868.                PgUp
  3869.                IF NPages() = 1 THEN
  3870.                   Message "Record " +StrVal([#])+ "..."
  3871.                ELSE
  3872.                   Message "Page " +StrVal(PageNo())+ " of Record "+Strval([#])+ "..."
  3873.                ENDIF
  3874.             ENDIF
  3875.          ELSE
  3876.             PgUp
  3877.             Message "Record " +StrVal([#])+ "..."
  3878.          ENDIF
  3879.       CASE button.n = 5 :                    ; Help
  3880.          utSpeedButtonsHelp.u()
  3881.       CASE button.n = 6 :                    ; PgDn
  3882.          IF IsFormView() THEN
  3883.             IF AtLast() AND PageNo() = NPages() THEN
  3884.                Beep
  3885.                IF NPages() = 1 THEN
  3886.                   Message "You are at the Last Record in this Image..."
  3887.                ELSE
  3888.                   Message "You are at the Last Record's Last Page in this Image..."
  3889.                ENDIF
  3890.             ELSE
  3891.                PgDn
  3892.                IF NPages() = 1 THEN
  3893.                   Message "Record " +StrVal([#])+ "..."
  3894.                ELSE
  3895.                   Message "Page " +StrVal(PageNo())+ " of Record "+Strval([#])+ "..."
  3896.                ENDIF
  3897.             ENDIF
  3898.          ELSE
  3899.             PgDn
  3900.             Message "Record " +StrVal([#])+ "..."
  3901.          ENDIF
  3902.       CASE button.n = 7 :                    ; Skip 1
  3903.          IF NOT AtLast() THEN
  3904.             Skip 1
  3905.             Message "Record " +Strval([#])+ "..."
  3906.          ELSE
  3907.             Beep
  3908.          ENDIF
  3909.       CASE button.n = 8 :                    ; Forward Scroll
  3910.          IF NOT AtLast() THEN
  3911.             WHILE NOT AtLast()
  3912.                Skip 1
  3913.                Echo NORMAL Echo OFF
  3914.                Message "Forward Scroll, Record ",RecNo()," - MouseClick or Press Any Key to Stop..."
  3915.                Sleep g.scrollrate.n
  3916.                GetEvent ALL To y
  3917.                IF (y["Type"] = "MOUSE" AND y["Action"] = "UP") OR
  3918.                   y["Type"] = "KEY" THEN
  3919.                   QUITLOOP
  3920.                ENDIF
  3921.             ENDWHILE
  3922.             Message "You are on Record " + StrVal(RecNo()) + "..."
  3923.          ELSE
  3924.             Beep
  3925.             Message "You are at the Last Record in this Image..."
  3926.          ENDIF
  3927.       CASE button.n = 9 :                    ; End
  3928.          End
  3929.          Message "End of Table..."
  3930.       OTHERWISE   : Beep                     ; Clicked a divider bar
  3931.    ENDSWITCH
  3932.    Return
  3933. ENDPROC
  3934. ; ===========================================================================
  3935. ;       TITLE: utSpeedButtonsHelp.u
  3936. ;     RETURNS: No value
  3937. ; DESCRIPTION: Popup Dialog with descriptions of SpeedButton icons, and
  3938. ;              embedded Dialog Box to set scroll rate in milliseconds
  3939. ; ---------------------------------------------------------------------------
  3940. PROC utSpeedButtonsHelp.u()      ; Description of SpeedButton icons
  3941. Private  button.l                ; Pushbutton variable
  3942.    SHOWDIALOG "Help on Using Speed Buttons"
  3943.       Proc "utSpeedButtonsHelpDB.l" Trigger "UPDATE"
  3944.       @ 1,0
  3945.       Height 18 Width 37
  3946.  
  3947.       @ 1,1 ?? "┌───────────────────────────────┐"
  3948.       @ 2,1 ?? "│                               │"
  3949.       @ 3,1 ?? "│  \030  Home: 1st record in table │"
  3950.       @ 4,1 ?? "│  \174  Reverse continuous scroll │"
  3951.       @ 5,1 ?? "│  \027  Back/Up one record        │"
  3952.       @ 6,1 ?? "│ Pg\024 Page up                   │"
  3953.       @ 7,1 ?? "│ Pg\025 Page down                 │"
  3954.       @ 8,1 ?? "│  \026  Next/Down one record      │"
  3955.       @ 9,1 ?? "│  \175  Forward continuous scroll │"
  3956.       @10,1 ?? "│  \031  End: Last record in table │"
  3957.       @11,1 ?? "│                               │"
  3958.       @12,1 ?? "└───────────────────────────────┘"
  3959.       PaintCanvas Attribute 48 1,1,12,33
  3960.       PaintCanvas Attribute 59 1,33,12,33
  3961.       PaintCanvas Attribute 59 12,2,12,33
  3962.       PaintCanvas Attribute 59 3,3,10,5
  3963.  
  3964.       PushButton @ 14,3
  3965.          Width 14 "~C~ontinue"
  3966.          OK Default Value true Tag "OK"
  3967.       To button.l
  3968.  
  3969.       PushButton @ 14,19
  3970.          Width 14 "~S~crollRate"
  3971.          Value false Tag "RATE"
  3972.       To button.l
  3973.    ENDDIALOG
  3974.    Return
  3975. ENDPROC
  3976. ; ===========================================================================
  3977. ;       TITLE: utSpeedButtonsHelpDB.l
  3978. ;     RETURNS: No value
  3979. ; DESCRIPTION: Embedded Dialog Box to set scroll rate for Scrolling icons
  3980. ; ---------------------------------------------------------------------------
  3981. PROC utSpeedButtonsHelpDB.l(     ; Set scroll rate for SpeedButtons
  3982.          type.a,                 ; EVENT or TRIGGER
  3983.          tag.a,                  ; Control element tag or null
  3984.          event.v,                ; DynArray of GetEvent, or control value
  3985.          element.a)              ; Checkbox label or null
  3986. Private  button.l
  3987.    IF type.a = "UPDATE" AND tag.a = "RATE" THEN
  3988.       SHOWDIALOG "In Tenth Seconds"
  3989.          @ 17,15
  3990.          Height 6 Width 26
  3991.  
  3992.          PaintCanvas Fill "1   5   9  13  17 20"
  3993.                      Attribute SysColor(1003) 1,2,1,21
  3994.  
  3995.          Slider @ 0,1
  3996.             Horizontal Length 22 Min 100 Max 2000
  3997.             ArrowStep 100 PageStep 500 Tag "SLIDER"
  3998.          To g.scrollrate.n
  3999.  
  4000.          PushButton @ 2,7
  4001.             Width 10 "~S~elect"
  4002.             OK Default Value true Tag "OK"
  4003.          To button.l
  4004.       ENDDIALOG
  4005.    ENDIF
  4006.    Return true
  4007. ENDPROC
  4008. ; *******************************************************************
  4009. ; THE FOLLOWING IS AN EXAMPLE OF HOW TO SEE THE MOUSE TOOLS IN ACTION
  4010. ; *******************************************************************
  4011. ;View SomeTableHere               ; SUBSTITUTE A NON-EMPTY TABLE NAME
  4012. ;utSpeedButtonsEnable.u(0,0,"")
  4013. ;Message "Press <Esc> to Cancel Demonstration..."
  4014. ;WHILE true
  4015. ;   Echo Normal Echo Off
  4016. ;   GetEvent Mouse "UP" Key 27 To test.y
  4017. ;   IF test.y["Type"] = "KEY" THEN
  4018. ;      QUITLOOP
  4019. ;   ENDIF
  4020. ;   utSpeedButtonsPressed.u(test.y,11)
  4021. ;ENDWHILE
  4022.