home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / database / cismsg15.zip / CISLIBSC.SC < prev    next >
Text File  |  1993-06-04  |  136KB  |  3,358 lines

  1. ;*************************************************************************
  2. ;*************************************************************************
  3. ; Formatted Source Listing
  4. ; Date : 05/26/93
  5. ; Time : 15:42:15
  6. ;
  7. ; System : CISMSG  The PARADOX-CIS Message Program
  8. ; File Name : C:\CIS\BATSYS.SC
  9. ; By : James Cap Walker and Mark Hout with HELP from Freinds!
  10. ; Last modified 05/16/93  11:29:08 am
  11. ; Copyright (c) 1992-1993  BAT-Systems Consulting
  12. ; This program is represents a collection of code by:
  13. ; Tony Goodman
  14. ; Dan Erhmann
  15. ; Angelo Laudon
  16. ; Dan Paolini
  17. ; Desmond Nolan
  18. ; John Nelson
  19. ; Michael Hyatt
  20. ; James Cap Walker
  21. ; Micael J. Hyatt
  22. ;*************************************************************************
  23. ;*************************************************************************
  24.  
  25.  
  26.  
  27. CREATELIB "Paradox" SIZE 150
  28. LIBNAME= "Paradox"
  29.  
  30. PROCSTEP.N = 0
  31. PROCTOTAL.N = 39
  32.  
  33.  
  34. MESSAGE "Writing lib " + LIBNAME
  35. PROC FIXMSGBOX(DT)
  36.     ECHO OFF
  37.     if dt = 2 then
  38.     MaxWindow(FormWindow)
  39.     endif
  40.     IF UPPER(TABLE()) = "IDL" OR UPPER(TABLE()) = "LASTDL" THEN
  41.         MOVETO [description]
  42.     ELSE
  43.         MOVETO [message]
  44.     ENDIF
  45.     FIELDVIEW
  46.     DYNARRAY MEMOWINATTS[]
  47.     MEMOWINDOW=GETWINDOW()
  48.     ;    MemoWinAtts["CANMAXIMIZE"] = False
  49.     MEMOWINATTS["CANRESIZE"] = FALSE
  50.     MEMOWINATTS["HASFRAME"] = TRUE
  51.     WINDOW RESIZE GETWINDOW() TO 11, 80
  52.     WINDOW MOVE GETWINDOW() TO 11, 0
  53.     SETWINDOW(GETWINDOW(),1)
  54.     WINDOW SETATTRIBUTES MEMOWINDOW FROM MEMOWINATTS
  55.     WINNEXT
  56.     FORMKEY
  57.     SETWINDOW(FormWindow,2)
  58.     Moveto [FORUM]
  59.     ARRANGED = TRUE
  60.     ECHO NORMAL
  61. ENDPROC
  62. WRITELIB LIBNAME FIXMSGBOX
  63. RELEASE PROCS FIXMSGBOX
  64. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "FixMsgBox" )
  65.  
  66.  
  67.  
  68.  
  69.  
  70. PROC SPLASHSCR(NBR)
  71.     MESSAGE.U("CIS ACTIVITY CENTER", "Moose & Squirrel Software//CompuServ Message Handler Program//(C) 1992-93" ,TRUE,FALSE)
  72.     CLEARALL
  73.     IF NBR = 1 THEN
  74.         BEEPEM.U("Alert")
  75.         SLEEP 1000
  76.     ENDIF
  77. ENDPROC
  78. WRITELIB LIBNAME SPLASHSCR
  79. RELEASE PROCS SPLASHSCR
  80. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "SplashScr" )
  81.  
  82.  
  83. PROC GETMSGCOUNT()
  84.     PRIVATE  ANTBLWIN
  85.  
  86.     ECHO OFF
  87.     MESSAGE.U("QUERY", "Processing Message Crosstab Query//Please Wait..." ,TRUE,FALSE)
  88.     {Ask} SELECT "Icistat"
  89.     [Msg Number] = "Calc Count"
  90.     MOVETO [Date] CHECK
  91.     MOVETO [From Name] CHECK
  92.  
  93.     DO_IT!
  94.     CLEARALL
  95.     VIEW "Answer"
  96.     ANTBLWIN=GETWINDOW()
  97.     WINDOW MOVE ANTBLWIN TO 10,-300
  98.     MOVETO [date]
  99.     MENU {Image} {Move} {Date}
  100.     RIGHT
  101.     ENTER
  102.     LEFT
  103.     MENU {Image} {Graph} {CrossTab} {1) Sum}
  104.     ENTER
  105.     RIGHT
  106.     ENTER
  107.     RIGHT
  108.     ENTER
  109.     MENU {Tools} {ExportImport} {Export} {Quattro} {2) Quattro Pro}
  110.     {Crosstab} {msgcnt}
  111.     CLEARALL
  112.     CLEARMESSAGE.U()
  113.     WBSFILLSCREEN()
  114. ENDPROC
  115. WRITELIB LIBNAME GETMSGCOUNT
  116. RELEASE PROCS GETMSGCOUNT
  117. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "GetMsgCount" )
  118.  
  119.  
  120.  
  121. ; ════════════════════════════════════════════════════════════════════════════
  122.  
  123. ; Script:         MSGTOOLS.SC, Version 0.90 Beta
  124.  
  125. ; Author:         Michael S. Hyatt, CIS ID: 72611,2226
  126.  
  127. ; Description:    One of the most basic kinds of tools that most developers
  128. ;                 need is "message tools," a collection of utilities for
  129. ;                 keeping the user informed of what's going on and soliciting
  130. ;                 decisions from him when necessary.  Some of the ideas for
  131. ;                 these procedures were inspired by GUITools for Paradox 3.5,
  132. ;                 (published by Ensemble Corporation and a "must-have" for
  133. ;                 anyone doing serious Paradox development), but these
  134. ;                 routines were re-written to take advantage of the dialog
  135. ;                 box and window commands found in Paradox 4.0.
  136.  
  137. ; Includes:       BeepEm.u()           Send an audio "signal" to the user.
  138.  
  139. ;                 ClearMessage.u()     Clears message previously created with
  140. ;                                      Message.u.
  141.  
  142. ;                 Continue.u()         Displays a message and requires the
  143. ;                                      user to press a "Continue" button to
  144. ;                                      continue the process.
  145.  
  146. ;                 ContinueCancel.l()   Same as Continue.u but gives the user
  147. ;                                      the opportunity to cancel out of the
  148. ;                                      process.
  149.  
  150. ;                 Message.u()          Displays a message on the screen in
  151. ;                                      a window to let the user know what is
  152. ;                                      happening.
  153.  
  154. ;                 Ok.u()               Same as Continue.u, but the pushbutton
  155. ;                                      is labeled "Ok."
  156.  
  157. ;                 YesNo.u()            Displays a question on the screen in
  158. ;                                      a window and requires the user to
  159. ;                                      answer "Yes" or "No."
  160.  
  161. ; Notice:         These procedures are released as FreeWare in gratitude for
  162. ;                 all the *tremendous* help I have received from others in
  163. ;                 CompuServe's PDoxDos forum.  Enjoy!
  164.  
  165. ; Created:        10-01-92 07:03pm
  166.  
  167. ; Modified:       10-11-92 12:33pm
  168.  
  169. ; ════════════════════════════════════════════════════════════════════════════
  170.  
  171.  
  172.  
  173.  
  174. ; ────────────────────────────────────────────────────────────────────────────
  175.  
  176. ; Procedure:      BeepEm.u()
  177.  
  178. ; Description:    Sends a specific audio signal to the user based on the
  179. ;                 parameter specified when calling the procedure.
  180.  
  181. ; Syntax:         BeepEm.u(BeepType.a)
  182.  
  183. ; Arguments:      BeepType.a is one of three different types of audio
  184. ;                 signals: (1) "Alert", (2) "Error", or (3) "Illegal".
  185.  
  186. ; Return Value:   BeepEm.u returns no value.
  187.  
  188. ; Usage:          BeepEm.u is used whenever you want to send an audio signal
  189. ;                 to the user.  It is automatically called by many of the
  190. ;                 procedures in the MsgTools collection, but it may also
  191. ;                 be called on its own.
  192.  
  193. ; Example:        BeepEm.u("Alert")
  194.  
  195. ; ────────────────────────────────────────────────────────────────────────────
  196.  
  197. PROC BEEPEM.U(BEEPTYPE.A)
  198.  
  199.     PROCNAME.A = "BeepEm.u"
  200.  
  201.     SWITCH
  202.         CASE UPPER(BEEPTYPE.A) = "ALERT" :
  203.             SOUND 200 50 SOUND 200 50 SOUND 200 50 SOUND 400 50 SOUND 800 50
  204.         CASE UPPER(BEEPTYPE.A) = "ERROR" :
  205.             SOUND 400 100 SOUND 380 100 SOUND 400 100 SOUND 100 200
  206.         CASE UPPER(BEEPTYPE.A) = "ILLEGAL" :
  207.             SOUND 800 100 SOUND 400 50
  208.     ENDSWITCH
  209.  
  210. ENDPROC
  211. WRITELIB LIBNAME BEEPEM.U
  212. RELEASE PROCS BEEPEM.U
  213. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "Beeper.u" )
  214.  
  215.  
  216. ; ────────────────────────────────────────────────────────────────────────────
  217.  
  218. ; Procedure:      ClearMessage.u()
  219.  
  220. ; Description:    Clears a message previously created by Message.u().
  221.  
  222. ; Syntax:         ClearMessage.u()
  223.  
  224. ; Arguments:      ClearMessage.u takes no arguments.
  225.  
  226. ; Return Value:   ClearMessage.u returns no value.
  227.  
  228. ; Usage:          Because Message.u utilizes a window, it must be explicitly
  229. ;                 closed with a Window Close command.
  230.  
  231. ; Example:        Message.u("Alert", "Sending report to printer./" +
  232. ;                 "Please wait...", True, True)
  233. ;                 ... do some other commands ...
  234. ;                 ClearMessage.u()
  235.  
  236. ; ────────────────────────────────────────────────────────────────────────────
  237.  
  238. PROC CLEARMESSAGE.U()
  239.  
  240.     PROCNAME.A = "ClearMessage.u"
  241.  
  242.     WINDOW SELECT MSG.H
  243.     WINDOW
  244.     CLOSE
  245.  
  246. ENDPROC
  247.  
  248. WRITELIB LIBNAME CLEARMESSAGE.U
  249. RELEASE PROCS CLEARMESSAGE.U
  250. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "ClearMessage.u" )
  251.  
  252.  
  253. ; ────────────────────────────────────────────────────────────────────────────
  254.  
  255. ; Procedure:      Continue.u()
  256.  
  257. ; Description:    Displays a dialog box with a user-defined message and a
  258. ;                 single pushbutton labeled "Continue."  The message can be
  259. ;                 one or several lines long. The procedure stops whatever
  260. ;                 process is underway and waits for the user to push the
  261. ;                 button before continuing.
  262.  
  263. ; Syntax:         Continue.u(Title.a, Message.a, Frame.l, Beep.l)
  264.  
  265. ; Arguments:      Title.a: Title.a is a character string containing the
  266. ;                 title of the dialog box, which Paradox centers on the
  267. ;                 top of the window frame.
  268.  
  269. ;                 Message.a: Message.a is a character string expression
  270. ;                 which is displayed as a message above the pushbutton.  It
  271. ;                 can be more than one line.  Each line is separated by the
  272. ;                 "/" character.  (See examples below.)
  273.  
  274. ;                 Frame.l: Frame.l is a logical (True/False) expression which
  275. ;                 indicates that the message is displayed within an inter-
  276. ;                 ior GUI frame.  "True" indicates that the proc should use
  277. ;                 a frame; "false" indicates that it should not.
  278.  
  279. ;                 Beep.l: Beep.l is a logical (True/False) expression which
  280. ;                 indicates that a "beep" should accompany the display of
  281. ;                 the dialog box.  "True" indicates yes; "False," no.
  282.  
  283. ; Return Value:   Continue.u returns no value.
  284.  
  285. ; Usage:          Continue.u is used whenever you want to interrupt a process
  286. ;                 and display a message to the user before continuing.  For
  287. ;                 example, it could be called before printing a long report.
  288.  
  289. ; Example:        Continue.u("Alert", "This process will take a while./" +
  290. ;                 "You might want to take a coffee break.", True, True)
  291.  
  292. ;────────────────────────────────────────────────────────────────────────────
  293.  
  294. PROC CONTINUE.U(TITLE.A, MESSAGE.A, FRAME.L, BEEP.L)
  295.     PRIVATE  MSGSEG.A, ; Unparsed message segment
  296.     LENGTH.N, ; length of longest line
  297.     NLINES.N, ; number of message lines
  298.     MSG.A, ; Placeholder for Match()
  299.     SROW.N, ; Starting row
  300.     SCOL.N, ; Starting column
  301.     CTRFORMAT.A ; Format for centering text
  302.  
  303.     PROCNAME.A = "Continue.u" ; Note the proc name in case we
  304.     ; encounter an error.
  305.  
  306.     ECHO OFF ; "Turn out the lights."
  307.  
  308.     MSGSEG.A = MESSAGE.A ; Initialize variables
  309.     LENGTH.N = 0
  310.     NLINES.N = 1
  311.  
  312.     WHILE MATCH(MSGSEG.A, "../.." , ; Determine how many lines there
  313.         MSG.A, MSGSEG.A) ; are and how long the longest
  314.         LENGTH.N = MAX(LENGTH.N, LEN(MSG.A)) ; one is.
  315.         NLINES.N = NLINES.N + 1
  316.     ENDWHILE
  317.  
  318.     LENGTH.N = MAX(LENGTH.N, LEN(MSGSEG.A)) ; The last line won't run through
  319.     ; the above loop, so we have to
  320.     ; compare its length against the
  321.     ; longest line so far.
  322.  
  323.     LENGTH.N = MAX(LENGTH.N, 12) ; Make sure the box is big enough
  324.     ; to accomodate the buttons.
  325.  
  326.     LENGTH.N = MIN(LENGTH.N, 72) ; Make sure the longest line is
  327.     ; not longer than 72 characters.
  328.  
  329.     IF FRAME.L THEN ; Add padding to line length to
  330.         LENGTH.N = LENGTH.N + 8 ; allow for dialog box frame,
  331.         NLINES.N = NLINES.N + 7 ; interior frame, and button.
  332.  
  333.     ELSE
  334.         LENGTH.N = LENGTH.N + 6 ; If there's no interior frame,
  335.         NLINES.N = NLINES.N + 6 ; then we can reduce the overall
  336.         ; size of the dialog box.
  337.     ENDIF
  338.  
  339.     SROW.N= 12 - INT(NLINES.N / 2) ; Determine starting row.
  340.     SCOL.N = 40 - INT(LENGTH.N / 2) ; Determine starting col.
  341.     CTRFORMAT.A = "W" + ; Set up format variable that
  342.     STRVAL(LENGTH.N - 6) + ", ac" ; centers screen in width.
  343.  
  344.  
  345.     SHOWDIALOG
  346.         TITLE.A ; Display the dialog box.
  347.         PROC "ContinueWaitProc.u" ; Specify the WaitProc to call
  348.         TRIGGER "Open" ; the "Open" trigger is generated.
  349.  
  350.         @SROW.N, SCOL.N
  351.         HEIGHT NLINES.N WIDTH LENGTH.N ; Dialog box coordinates.
  352.  
  353.  
  354.         PUSHBUTTON @NLINES.N - 4, ; [Continue] Pushbutton
  355.             INT((LENGTH.N / 2) - 8)
  356.             WIDTH 14
  357.             "~C~ontinue"
  358.             OK
  359.             DEFAULT ; The default button (duh)
  360.             VALUE "Continue"
  361.             TAG "ContinueTag"
  362.             TO BUTTONVALUE.A
  363.     ENDDIALOG
  364.  
  365. ENDPROC
  366. WRITELIB LIBNAME CONTINUE.U
  367. RELEASE PROCS CONTINUE.U
  368. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "Continue.u" )
  369.  
  370.  
  371. ; ────────────────────────────────────────────────────────────────────────────
  372. ; This proc is called by the ShowDialog command in Continue.u().  It follows
  373. ; the standard WaitProc format.
  374. ; ────────────────────────────────────────────────────────────────────────────
  375.  
  376. PROC CONTINUEWAITPROC.U(TRIGGERTYPE.A, TAGVALUE.A, EVENTRECORD.Y, CYCLE.N)
  377.     PRIVATE  LASTLINE.A, ; Lastline of message.
  378.     ELLIPSES.N ; Placeholder for ellipses search
  379.  
  380.     PROCNAME.A = "ContinueWaitProc.u" ; Note the proc name in case we
  381.     ; encounter an error.
  382.  
  383.     WINDOW HANDLE DIALOG TO CONTINUE.H ; Give this dialog box a handle.
  384.     SETCANVAS CONTINUE.H ; Set the canvas to the dialog
  385.     ; box, so that we can write to it.
  386.  
  387.     CANVAS OFF ; Turn the canvas off while we
  388.     ; draw the message and frame.
  389.  
  390.     STYLE ATTRIBUTE SYSCOLOR(1036) ; Use the default background text
  391.     ; for Dialog boxes.
  392.  
  393.     IF FRAME.L THEN ; See if the user wants an inter-
  394.         FRAME SINGLE ; ior frame; if so, draw it.
  395.         FROM 0, 1 TO NLINES.N - 6,
  396.         LENGTH.N - 4
  397.         ; Now paint the frame--GUI-style.
  398.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Top line of frame box.
  399.         0, 1, 0, LENGTH.N - 5
  400.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Left line of frame box.
  401.         0, 1, NLINES.N - 6, 1
  402.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1036) ; Right line of frame box.
  403.         0, LENGTH.N - 4,
  404.         NLINES.N - 6, LENGTH.N - 4
  405.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1036) ; Bottom line of frame box.
  406.         NLINES.N - 6, 2,
  407.         NLINES.N - 6, LENGTH.N - 5
  408.  
  409.     ENDIF
  410.  
  411.     MSGSEG.A = MESSAGE.A ; Re-initialize variables.
  412.     SROW.N= 1
  413.     SCOL.N = 2
  414.  
  415.     WHILE MATCH(MSGSEG.A, "../.." , ; Parse the message, and paint
  416.         MSG.A, MSGSEG.A) ; the canvas, one line at a time.
  417.         @ SROW.N, SCOL.N
  418.         ?? FORMAT(CTRFORMAT.A, MSG.A)
  419.         SROW.N= SROW.N + 1 ; Move down one row.
  420.     ENDWHILE
  421.  
  422.     LASTLINE.A = FORMAT(CTRFORMAT.A, ; Format the last line.
  423.     MSGSEG.A)
  424.     @ SROW.N, SCOL.N ?? LASTLINE.A ; Put it on the canvas.
  425.     ELLIPSES.N = SEARCH("...", LASTLINE.A) ; Check for ellipses.
  426.     IF ELLIPSES.N > 0 THEN ; If there's an ellipses, then
  427.         STYLE ATTRIBUTE SYSCOLOR(1036) + 128 ; paint it with the blinking
  428.         @ SROW.N, ; attribute.
  429.         SCOL.N + ELLIPSES.N - 1 ?? "..."
  430.     ENDIF
  431.  
  432.     CANVAS ON ; Display the completely-drawn
  433.     ; message.
  434.  
  435.     IF BEEP.L THEN ; Check to see if the user wants
  436.         BEEPEM.U("Alert") ; a beep. If so, call the proc.
  437.     ENDIF
  438.  
  439. ENDPROC
  440. WRITELIB LIBNAME CONTINUEWAITPROC.U
  441. RELEASE PROCS CONTINUEWAITPROC.U
  442. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "ContinueWait.u" )
  443.  
  444.  
  445. ; ────────────────────────────────────────────────────────────────────────────
  446.  
  447. ; Procedure:      ContinueCancel.l()
  448.  
  449. ; Description:    Displays a dialog box with a user-defined message (usually
  450. ;                 a question) and two pushbuttons labeled "Yes" and "No."
  451. ;                 The message can be one or several lines long. The procedure
  452. ;                 stops whatever process is underway and waits for the user
  453. ;                 make a decision.
  454.  
  455. ; Syntax:         ContinueCancel.l(Title.a, Message.a, Frame.l, Beep.l)
  456.  
  457. ; Arguments:      Title.a: Title.a is a character string containing the
  458. ;                 title of the dialog box, which Paradox centers on the
  459. ;                 top of the window frame.
  460.  
  461. ;                 Message.a: Message.a is a character string expression
  462. ;                 which is displayed as a message above the pushbutton.  It
  463. ;                 can be more than one line.  Each line is separated by the
  464. ;                 "/" character.  (See examples below.)
  465.  
  466. ;                 Frame.l: Frame.l is a logical (True/False) expression which
  467. ;                 indicates that the message is displayed within an inter-
  468. ;                 ior GUI frame.  "True" indicates that the proc should use
  469. ;                 a frame; "false" indicates that it should not.
  470.  
  471. ;                 Beep.l: Beep.l is a logical (True/False) expression which
  472. ;                 indicates that a "beep" should accompany the display of
  473. ;                 the dialog box.  "True" indicates yes; "False," no.
  474.  
  475. ; Return Value:   ContinueCancel.l returns logical True of the user pressed
  476. ;                 [Continue] and logical False is the user pressed [Cancel].
  477.  
  478. ; Usage:          ContinueCancel.l is used whenever you need to get a
  479. ;                 decision from the the user before continuing.  For example, it could
  480. ;                 be called before backing up a table.
  481.  
  482. ; Example:        ContinueCancel.l("Alert", "Ready to backup up database
  483. ;                 files?", True, True)
  484.  
  485. ;────────────────────────────────────────────────────────────────────────────
  486.  
  487. PROC CONTINUECANCEL.L(TITLE.A, MESSAGE.A, FRAME.L, BEEP.L)
  488.     PRIVATE  MSGSEG.A, ; Unparsed message segment
  489.     LENGTH.N, ; length of longest line
  490.     NLINES.N, ; number of message lines
  491.     MSG.A, ; Placeholder for Match()
  492.     SROW.N, ; Starting row
  493.     SCOL.N, ; Starting column
  494.     CTRFORMAT.A ; Format for centering text
  495.  
  496.     PROCNAME.A = "ContinueCancel.l" ; Note the proc name in case we
  497.     ; encounter an error.
  498.  
  499.     ECHO OFF ; "Turn out the lights."
  500.  
  501.     MSGSEG.A = MESSAGE.A ; Initialize variables
  502.     LENGTH.N = 0
  503.     NLINES.N = 1
  504.  
  505.     WHILE MATCH(MSGSEG.A, "../.." , ; Determine how many lines there
  506.         MSG.A, MSGSEG.A) ; are and how long the longest
  507.         LENGTH.N = MAX(LENGTH.N, LEN(MSG.A)) ; one is.
  508.         NLINES.N = NLINES.N + 1
  509.     ENDWHILE
  510.  
  511.     LENGTH.N = MAX(LENGTH.N, LEN(MSGSEG.A)) ; The last line won't run through
  512.     ; the above loop, so we have to
  513.     ; compare its length against the
  514.     ; longest line so far.
  515.  
  516.     LENGTH.N = MAX(LENGTH.N, 26) ; Make sure the box is big enough
  517.     ; to accomodate the buttons.
  518.  
  519.     LENGTH.N = MIN(LENGTH.N, 72) ; Make sure the longest line is
  520.     ; not longer than 72 characters.
  521.  
  522.     IF FRAME.L THEN ; Add padding to line length to
  523.         LENGTH.N = LENGTH.N + 8 ; allow for dialog box frame,
  524.         NLINES.N = NLINES.N + 7 ; interior frame, and button.
  525.  
  526.     ELSE
  527.         LENGTH.N = LENGTH.N + 6 ; If there's no interior frame,
  528.         NLINES.N = NLINES.N + 6 ; then we can reduce the overall
  529.         ; size of the dialog box.
  530.     ENDIF
  531.  
  532.     SROW.N= 12 - INT(NLINES.N / 2) ; Determine starting row.
  533.     SCOL.N = 40 - INT(LENGTH.N / 2) ; Determine starting col.
  534.     CTRFORMAT.A = "W" + ; Set up format variable that
  535.     STRVAL(LENGTH.N - 6) + ", ac" ; centers screen in width.
  536.  
  537.  
  538.     SHOWDIALOG
  539.         TITLE.A ; Display the dialog box.
  540.         PROC "ContinueCancelWaitProc.u" ; Specify the WaitProc to call
  541.         TRIGGER "Open" ; the "Open" trigger is generated.
  542.  
  543.         @SROW.N, SCOL.N
  544.         HEIGHT NLINES.N WIDTH LENGTH.N ; Dialog box coordinates.
  545.  
  546.         PUSHBUTTON @NLINES.N - 4, ; [Continue] Pushbutton
  547.             INT((LENGTH.N / 2) - 15)
  548.             WIDTH 14
  549.             "C~o~ntinue"
  550.             OK
  551.             DEFAULT ; The default button (duh!)
  552.             VALUE "Continue"
  553.             TAG "ContinueTag"
  554.             TO BUTTONVALUE.A
  555.  
  556.         PUSHBUTTON @NLINES.N - 4, ; [Cancel] Pushbutton
  557.             INT((LENGTH.N / 2) - 1)
  558.             WIDTH 14
  559.             "~C~ancel"
  560.             CANCEL
  561.             VALUE "Cancel"
  562.             TAG "CancelTAG"
  563.             TO BUTTONVALUE.A
  564.  
  565.     ENDDIALOG
  566.  
  567.     RETURN RETVAL
  568.  
  569. ENDPROC
  570. WRITELIB LIBNAME CONTINUECANCEL.L
  571. RELEASE PROCS CONTINUECANCEL.L
  572. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "ContinueCancel.u" )
  573.  
  574.  
  575. ; ────────────────────────────────────────────────────────────────────────────
  576. ; This proc is called by the ShowDialog command in ContinueCancel.l().  It follows the
  577. ; standard WaitProc format.
  578. ; ────────────────────────────────────────────────────────────────────────────
  579.  
  580. PROC CONTINUECANCELWAITPROC.U(TRIGGERTYPE.A, TAGVALUE.A, EVENTRECORD.Y, CYCLE.N)
  581.     PRIVATE  LASTLINE.A, ; Lastline of message.
  582.     ELLIPSES.N ; Placeholder for ellipses search
  583.  
  584.     PROCNAME.A = "ContinueCancelWaitProc.u" ; Note the proc name in case we
  585.     ; encounter an error.
  586.  
  587.     WINDOW HANDLE DIALOG TO CONTINUECANCEL.H ; Give this dialog box a handle.
  588.     SETCANVAS CONTINUECANCEL.H ; Set the canvas to the dialog
  589.     ; box, so that we can write to it.
  590.  
  591.     CANVAS OFF ; Turn the canvas off while we
  592.     ; draw the message and frame.
  593.  
  594.     STYLE ATTRIBUTE SYSCOLOR(1036) ; Use the default background text
  595.     ; for Dialog boxes.
  596.  
  597.     IF FRAME.L THEN ; See if the user wants an inter-
  598.         FRAME SINGLE ; ior frame; if so, draw it.
  599.         FROM 0, 1 TO NLINES.N - 6,
  600.         LENGTH.N - 4
  601.         ; Now paint the frame--GUI-style.
  602.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Top line of frame box.
  603.         0, 1, 0, LENGTH.N - 5
  604.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Left line of frame box.
  605.         0, 1, NLINES.N - 6, 1
  606.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1036) ; Right line of frame box.
  607.         0, LENGTH.N - 4,
  608.         NLINES.N - 6, LENGTH.N - 4
  609.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1036) ; Bottom line of frame box.
  610.         NLINES.N - 6, 2,
  611.         NLINES.N - 6, LENGTH.N - 5
  612.  
  613.     ENDIF
  614.  
  615.     MSGSEG.A = MESSAGE.A ; Re-initialize variables.
  616.     SROW.N= 1
  617.     SCOL.N = 2
  618.  
  619.     WHILE MATCH(MSGSEG.A, "../.." , ; Parse the message, and paint
  620.         MSG.A, MSGSEG.A) ; the canvas, one line at a time.
  621.         @ SROW.N, SCOL.N
  622.         ?? FORMAT(CTRFORMAT.A, MSG.A)
  623.         SROW.N= SROW.N + 1 ; Move down one row.
  624.     ENDWHILE
  625.  
  626.     LASTLINE.A = FORMAT(CTRFORMAT.A, ; Format the last line.
  627.     MSGSEG.A)
  628.     @ SROW.N, SCOL.N ?? LASTLINE.A ; Put it on the canvas.
  629.     ELLIPSES.N = SEARCH("...", LASTLINE.A) ; Check for ellipses.
  630.     IF ELLIPSES.N > 0 THEN ; If there's an ellipses, then
  631.         STYLE ATTRIBUTE SYSCOLOR(1036) + 128 ; paint it with the blinking
  632.         @ SROW.N, ; attribute.
  633.         SCOL.N + ELLIPSES.N - 1 ?? "..."
  634.     ENDIF
  635.  
  636.     CANVAS ON ; Display the completely-drawn
  637.     ; message.
  638.  
  639.     IF BEEP.L THEN ; Check to see if the user wants
  640.         BEEPEM.U("Alert") ; a beep. If so, call the proc.
  641.     ENDIF
  642.  
  643. ENDPROC
  644. WRITELIB LIBNAME CONTINUECANCELWAITPROC.U
  645. RELEASE PROCS CONTINUECANCELWAITPROC.U
  646. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "ContinueCancelWait.u" )
  647.  
  648.  
  649. ; ────────────────────────────────────────────────────────────────────────────
  650.  
  651. ; Procedure:      Message.u()
  652.  
  653. ; Description:    Displays a floating window with a user-defined message
  654. ;                 painted on it.  The "floating" attribute assures that the
  655. ;                 window is always above other objects on the workspace (e.g.,
  656. ;                 dialog boxes).  The message can be one or several lines
  657. ;
  658. ; Syntax:         Message.u(Title.a, Message.a, Frame.l, Beep.l)
  659.  
  660. ; Arguments:      Title.a: Title.a is a character string containing the
  661. ;                 title of the window, which Paradox centers on the top
  662. ;                 of the window frame.
  663.  
  664. ;                 Message.a: Message.a is a character string expression
  665. ;                 which is displayed as a message within the window.  It
  666. ;                 can be more than one line.  Each line is separated by the
  667. ;                 "/" character.  (See examples below.)
  668.  
  669. ;                 Frame.l: Frame.l is a logical (True/False) expression which
  670. ;                 indicates that the message is displayed within an inter-
  671. ;                 ior GUI frame.  "True" indicates that the proc should use
  672. ;                 a frame; "false" indicates that it should not.
  673.  
  674. ;                 Beep.l: Beep.l is a logical (True/False) expression which
  675. ;                 indicates that a "beep" should accompany the display of
  676. ;                 the window.  "True" indicates yes; "False," no.
  677.  
  678. ; Return Value:   Message.u returns no value.
  679.  
  680. ; Usage:          Message.u is used whenever you let the user know what's
  681. ;                 happening.  This is especially important during long proce-
  682. ;                 dures or delays when the user might assume something is
  683. ;                 wrong.  The message is displayed with Message.u(), and it
  684. ;                 is explicitly removed with ClearMessage.u().
  685.  
  686. ; Example:        Message.u("Alert", "Sending report to printer./" +
  687. ;                 "Please wait...", True, True)
  688.  
  689. ;────────────────────────────────────────────────────────────────────────────
  690.  
  691. PROC MESSAGE.U(TITLE.A, MESSAGE.A, FRAME.L, BEEP.L)
  692.     PRIVATE  MSGSEG.A, ; Unparsed message segment
  693.     LENGTH.N, ; length of longest line
  694.     NLINES.N, ; number of message lines
  695.     MSG.A, ; Placeholder for Match()
  696.     SROW.N, ; Starting row
  697.     SCOL.N, ; Starting column
  698.     CTRFORMAT.A, ; Format for centering text
  699.     MSGWATTR.Y ; Attributes for message window
  700.  
  701.     PROCNAME.A = "Message.u" ; Note the proc name in case we
  702.     ; encounter an error.
  703.  
  704.     SETCANVAS DEFAULT ; Set the default canvas.
  705.     CANVAS OFF
  706.     ECHO NORMAL
  707.     ECHO OFF ; "Turn out the lights."
  708.     CURSOR OFF
  709.  
  710.     MSGSEG.A = MESSAGE.A ; Initialize variables
  711.     LENGTH.N = 0
  712.     NLINES.N = 1
  713.     DYNARRAY MSGWATTR.Y[]
  714.     MSGWATTR.Y["HasFrame"] = FALSE
  715.  
  716.     WHILE MATCH(MSGSEG.A, "../.." , ; Determine how many lines there
  717.         MSG.A, MSGSEG.A) ; are and how long the longest
  718.         LENGTH.N = MAX(LENGTH.N, LEN(MSG.A)) ; one is.
  719.         NLINES.N = NLINES.N + 1
  720.     ENDWHILE
  721.  
  722.     LENGTH.N = MAX(LENGTH.N, LEN(MSGSEG.A)) ; The last line won't run through
  723.     ; the above loop, so we have to
  724.     ; compare its length against the
  725.     ; longest line so far.
  726.  
  727.     LENGTH.N = MAX(LENGTH.N, 12) ; Make sure the box is big enough.
  728.  
  729.     LENGTH.N = MIN(LENGTH.N, 72) ; Make sure the longest line is
  730.     ; not longer than 72 characters.
  731.  
  732.     IF FRAME.L THEN ; Add padding to line length to
  733.         LENGTH.N = LENGTH.N + 10 ; allow for window frame, and
  734.         NLINES.N = NLINES.N + 6 ; interior frame.
  735.  
  736.     ELSE
  737.         LENGTH.N = LENGTH.N + 6 ; If there's no interior frame,
  738.         NLINES.N = NLINES.N + 4 ; then we can reduce the overall
  739.         ; size of the dialog box.
  740.     ENDIF
  741.  
  742.     SROW.N= 12 - INT(NLINES.N / 2) ; Determine starting row.
  743.     SCOL.N = 40 - INT(LENGTH.N / 2) ; Determine starting col.
  744.  
  745.     IF FRAME.L THEN
  746.         CTRFORMAT.A = "W" + ; Set up format variable that
  747.         STRVAL(LENGTH.N - 8) + ", ac" ; centers screen in width.
  748.     ELSE
  749.         CTRFORMAT.A = "W" + ; Set up format variable that
  750.         STRVAL(LENGTH.N - 6) + ", ac" ; centers screen in width.
  751.     ENDIF
  752.  
  753.     MSGWATTR.Y["OriginRow"] = SROW.N
  754.     MSGWATTR.Y["OriginCol"] = SCOL.N
  755.  
  756.     WINDOW
  757.     CREATE FLOATING ; Create floating window.
  758.     @SROW.N + 1000, SCOL.N + 1000 ; Window coordinates.
  759.     HEIGHT NLINES.N WIDTH LENGTH.N ; Window size.
  760.     TO MSG.H ; Window handle.
  761.  
  762.  
  763.     WINDOW SETATTRIBUTES MSG.H ; Set the window's attributes
  764.     FROM MSGWATTR.Y ; (i.e., the "title")
  765.  
  766.     SETCANVAS MSG.H ; Set the canvas to the window
  767.     ; box, so that we can write to it.
  768.  
  769.     CANVAS OFF ; Turn the canvas off while we
  770.     ; draw the message and frame.
  771.  
  772.     FRAME DOUBLE FROM ; Draw the double frame around the
  773.     0, 0 TO NLINES.N - 3, ; window. We don't want to use the
  774.     LENGTH.N - 3 ; normal window frame, because we
  775.     ; we don't want the scroll bars.
  776.     PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Paint the double frame.
  777.     0, 0, NLINES.N - 3, LENGTH.N - 3
  778.  
  779.     IF TITLE.A <> "" THEN
  780.         STYLE ATTRIBUTE SYSCOLOR(1032) ; Place the title in the middle of
  781.         @0, INT((LENGTH.N - 3) / 2 - ; the frame.
  782.         (LEN(TITLE.A) / 2)) ?? " " + ; Allow for a space before and
  783.         TITLE.A + " " ; after title.
  784.     ENDIF
  785.  
  786.     IF FRAME.L THEN ; See if the user wants an inter-
  787.         FRAME SINGLE ; ior frame; if so, draw it.
  788.         FROM 1, 2 TO NLINES.N - 4,
  789.         LENGTH.N - 5
  790.         ; Now paint the frame--GUI-style.
  791.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Top line of frame box.
  792.         1, 2, 1, LENGTH.N - 5
  793.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Left line of frame box.
  794.         1, 1, NLINES.N - 4, 1
  795.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1036) ; Right line of frame box.
  796.         1, LENGTH.N - 5,
  797.         NLINES.N - 4, LENGTH.N - 5
  798.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1036) ; Bottom line of frame box.
  799.         NLINES.N - 4, 3,
  800.         NLINES.N - 4, LENGTH.N - 5
  801.     ENDIF
  802.  
  803.     MSGSEG.A = MESSAGE.A ; Re-initialize variables.
  804.     IF FRAME.L THEN
  805.         SROW.N= 2
  806.         SCOL.N = 3
  807.     ELSE
  808.         SROW.N= 1
  809.         SCOL.N = 2
  810.     ENDIF
  811.  
  812.     STYLE ATTRIBUTE SYSCOLOR(1036) ; Use the default background text
  813.     ; for window text.
  814.  
  815.     WHILE MATCH(MSGSEG.A, "../.." , ; Parse the message, and paint
  816.         MSG.A, MSGSEG.A) ; the canvas, one line at a time.
  817.         @ SROW.N, SCOL.N
  818.         ?? FORMAT(CTRFORMAT.A, MSG.A)
  819.         SROW.N= SROW.N + 1 ; Move down one row.
  820.     ENDWHILE
  821.  
  822.     LASTLINE.A = FORMAT(CTRFORMAT.A, ; Format the last line.
  823.     MSGSEG.A)
  824.     @ SROW.N, SCOL.N ?? LASTLINE.A ; Put it on the canvas.
  825.     ELLIPSES.N = SEARCH("...", LASTLINE.A) ; Check for ellipses.
  826.     IF ELLIPSES.N > 0 THEN ; If there's an ellipses, then
  827.         STYLE ATTRIBUTE SYSCOLOR(1036) + 128 ; paint it with the blinking
  828.         @ SROW.N, ; attribute.
  829.         SCOL.N + ELLIPSES.N - 1 ?? "..."
  830.     ENDIF
  831.  
  832.     CANVAS ON ; Display the completely-drawn
  833.     ; message.
  834.  
  835.     IF BEEP.L THEN ; Check to see if the user wants
  836.         BEEPEM.U("Alert") ; a beep. If so, call the proc.
  837.     ENDIF
  838.  
  839. ENDPROC
  840. WRITELIB LIBNAME MESSAGE.U
  841. RELEASE PROCS MESSAGE.U
  842. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "Message.u" )
  843.  
  844.  
  845. ; ────────────────────────────────────────────────────────────────────────────
  846.  
  847. ; Procedure:      Ok.u()
  848.  
  849. ; Description:    Displays a dialog box with a user-defined message and a
  850. ;                 single pushbutton labeled "Ok."  The message can be
  851. ;                 one or several lines long. The procedure stops whatever
  852. ;                 process is underway and waits for the user to push the
  853. ;                 button before continuing.
  854.  
  855. ; Syntax:         Ok.u(Title.a, Message.a, Frame.l, Beep.l)
  856.  
  857. ; Arguments:      Title.a: Title.a is a character string containing the
  858. ;                 title of the dialog box, which Paradox centers on the
  859. ;                 top of the window frame.
  860.  
  861. ;                 Message.a: Message.a is a character string expression
  862. ;                 which is displayed as a message above the pushbutton.  It
  863. ;                 can be more than one line.  Each line is separated by the
  864. ;                 "/" character.  (See examples below.)
  865.  
  866. ;                 Frame.l: Frame.l is a logical (True/False) expression which
  867. ;                 indicates that the message is displayed within an inter-
  868. ;                 ior GUI frame.  "True" indicates that the proc should use
  869. ;                 a frame; "false" indicates that it should not.
  870.  
  871. ;                 Beep.l: Beep.l is a logical (True/False) expression which
  872. ;                 indicates that a "beep" should accompany the display of
  873. ;                 the dialog box.  "True" indicates yes; "False," no.
  874.  
  875. ; Return Value:   Ok.u returns no value.
  876.  
  877. ; Usage:          Ok.u is used whenever you want to interrupt a process
  878. ;                 and display a message to the user before continuing.  For
  879. ;                 example, it could be called before printing a long report.
  880.  
  881. ; Example:        Ok.u("Alert", "You have to specify a beginning value./" +
  882. ;                 "Please try again.", True, True)
  883.  
  884. ;────────────────────────────────────────────────────────────────────────────
  885.  
  886. PROC OK.U(TITLE.A, MESSAGE.A, FRAME.L, BEEP.L)
  887.     PRIVATE  MSGSEG.A, ; Unparsed message segment
  888.     LENGTH.N, ; length of longest line
  889.     NLINES.N, ; number of message lines
  890.     MSG.A, ; Placeholder for Match()
  891.     SROW.N, ; Starting row
  892.     SCOL.N, ; Starting column
  893.     CTRFORMAT.A ; Format for centering text
  894.  
  895.     PROCNAME.A = "Ok.u" ; Note the proc name in case we
  896.     ; encounter an error.
  897.  
  898.     ECHO OFF ; "Turn out the lights."
  899.  
  900.     MSGSEG.A = MESSAGE.A ; Initialize variables
  901.     LENGTH.N = 0
  902.     NLINES.N = 1
  903.  
  904.     WHILE MATCH(MSGSEG.A, "../.." , ; Determine how many lines there
  905.         MSG.A, MSGSEG.A) ; are and how long the longest
  906.         LENGTH.N = MAX(LENGTH.N, LEN(MSG.A)) ; one is.
  907.         NLINES.N = NLINES.N + 1
  908.     ENDWHILE
  909.  
  910.     LENGTH.N = MAX(LENGTH.N, LEN(MSGSEG.A)) ; The last line won't run through
  911.     ; the above loop, so we have to
  912.     ; compare its length against the
  913.     ; longest line so far.
  914.  
  915.     LENGTH.N = MAX(LENGTH.N, 12) ; Make sure the box is big enough
  916.     ; to accomodate button.
  917.  
  918.     LENGTH.N = MIN(LENGTH.N, 72) ; Make sure the longest line is
  919.     ; not longer than 72 characters.
  920.  
  921.     IF FRAME.L THEN ; Add padding to line length to
  922.         LENGTH.N = LENGTH.N + 8 ; allow for dialog box frame,
  923.         NLINES.N = NLINES.N + 7 ; interior frame, and button.
  924.  
  925.     ELSE
  926.         LENGTH.N = LENGTH.N + 6 ; If there's no interior frame,
  927.         NLINES.N = NLINES.N + 6 ; then we can reduce the overall
  928.         ; size of the dialog box.
  929.     ENDIF
  930.  
  931.     SROW.N= 12 - INT(NLINES.N / 2) ; Determine starting row.
  932.     SCOL.N = 40 - INT(LENGTH.N / 2) ; Determine starting col.
  933.     CTRFORMAT.A = "W" + ; Set up format variable that
  934.     STRVAL(LENGTH.N - 6) + ", ac" ; centers screen in width.
  935.  
  936.  
  937.     SHOWDIALOG
  938.         TITLE.A ; Display the dialog box.
  939.         PROC "OkWaitProc.u" ; Specify the WaitProc to call
  940.         TRIGGER "Open" ; the "Open" trigger is generated.
  941.  
  942.         @SROW.N, SCOL.N
  943.         HEIGHT NLINES.N WIDTH LENGTH.N ; Dialog box coordinates.
  944.  
  945.         PUSHBUTTON @NLINES.N - 4, ; [Ok] Pushbutton
  946.             INT((LENGTH.N / 2) - 6)
  947.             WIDTH 10
  948.             "~O~k"
  949.             OK
  950.             DEFAULT ; The default button (duh)
  951.             VALUE "Ok"
  952.             TAG "OkTag"
  953.             TO BUTTONVALUE.A
  954.     ENDDIALOG
  955.  
  956. ENDPROC
  957. WRITELIB LIBNAME OK.U
  958. RELEASE PROCS OK.U
  959. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "Ok.u" )
  960.  
  961.  
  962. ; ────────────────────────────────────────────────────────────────────────────
  963. ; This proc is called by the ShowDialog command in Ok.u().  It follows the
  964. ; standard WaitProc format.
  965. ; ────────────────────────────────────────────────────────────────────────────
  966.  
  967. PROC OKWAITPROC.U(TRIGGERTYPE.A, TAGVALUE.A, EVENTRECORD.Y, CYCLE.N)
  968.     PRIVATE  LASTLINE.A, ; Lastline of message.
  969.     ELLIPSES.N ; Placeholder for ellipses search
  970.  
  971.     PROCNAME.A = "OkWaitProc.u" ; Note the proc name in case we
  972.     ; encounter an error.
  973.  
  974.     WINDOW HANDLE DIALOG TO OK.H ; Give this dialog box a handle.
  975.     SETCANVAS OK.H ; Set the canvas to the dialog
  976.     ; box, so that we can write to it.
  977.  
  978.     CANVAS OFF ; Turn the canvas off while we
  979.     ; draw the message and frame.
  980.  
  981.     STYLE ATTRIBUTE SYSCOLOR(1036) ; Use the default background text
  982.     ; for Dialog boxes.
  983.  
  984.     IF FRAME.L THEN ; See if the user wants an inter-
  985.         FRAME SINGLE ; ior frame; if so, draw it.
  986.         FROM 0, 1 TO NLINES.N - 6,
  987.         LENGTH.N - 4
  988.         ; Now paint the frame--GUI-style.
  989.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Top line of frame box.
  990.         0, 1, 0, LENGTH.N - 5
  991.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Left line of frame box.
  992.         0, 1, NLINES.N - 6, 1
  993.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1036) ; Right line of frame box.
  994.         0, LENGTH.N - 4,
  995.         NLINES.N - 6, LENGTH.N - 4
  996.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1036) ; Bottom line of frame box.
  997.         NLINES.N - 6, 2,
  998.         NLINES.N - 6, LENGTH.N - 5
  999.  
  1000.     ENDIF
  1001.  
  1002.     MSGSEG.A = MESSAGE.A ; Re-initialize variables.
  1003.     SROW.N= 1
  1004.     SCOL.N = 2
  1005.  
  1006.     WHILE MATCH(MSGSEG.A, "../.." , ; Parse the message, and paint
  1007.         MSG.A, MSGSEG.A) ; the canvas, one line at a time.
  1008.         @ SROW.N, SCOL.N
  1009.         ?? FORMAT(CTRFORMAT.A, MSG.A)
  1010.         SROW.N= SROW.N + 1 ; Move down one row.
  1011.     ENDWHILE
  1012.  
  1013.     LASTLINE.A = FORMAT(CTRFORMAT.A, ; Format the last line.
  1014.     MSGSEG.A)
  1015.     @ SROW.N, SCOL.N ?? LASTLINE.A ; Put it on the canvas.
  1016.     ELLIPSES.N = SEARCH("...", LASTLINE.A) ; Check for ellipses.
  1017.     IF ELLIPSES.N > 0 THEN ; If there's an ellipses, then
  1018.         STYLE ATTRIBUTE SYSCOLOR(1036) + 128 ; paint it with the blinking
  1019.         @ SROW.N, ; attribute.
  1020.         SCOL.N + ELLIPSES.N - 1 ?? "..."
  1021.     ENDIF
  1022.  
  1023.     CANVAS ON ; Display the completely-drawn
  1024.     ; message.
  1025.  
  1026.     IF BEEP.L THEN ; Check to see if the user wants
  1027.         BEEPEM.U("Alert") ; a beep. If so, call the proc.
  1028.     ENDIF
  1029.  
  1030. ENDPROC
  1031. WRITELIB LIBNAME OKWAITPROC.U
  1032. RELEASE PROCS OKWAITPROC.U
  1033. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "OkWaitProc.u" )
  1034.  
  1035.  
  1036. ; ────────────────────────────────────────────────────────────────────────────
  1037.  
  1038. ; Procedure:      YesNo.l()
  1039.  
  1040. ; Description:    Displays a dialog box with a user-defined message (usually
  1041. ;                 a question) and two pushbuttons labeled "Yes" and "No."  The
  1042. ;                 message can be one or several lines long. The procedure
  1043. ;                 stops whatever process is underway and waits for the user
  1044. ;                 make a decision.
  1045.  
  1046. ; Syntax:         YesNo.l(Title.a, Message.a, Frame.l, Beep.l)
  1047.  
  1048. ; Arguments:      Title.a: Title.a is a character string containing the
  1049. ;                 title of the dialog box, which Paradox centers on the
  1050. ;                 top of the window frame.
  1051.  
  1052. ;                 Message.a: Message.a is a character string expression
  1053. ;                 which is displayed as a message above the pushbutton.  It
  1054. ;                 can be more than one line.  Each line is separated by the
  1055. ;                 "/" character.  (See examples below.)
  1056.  
  1057. ;                 Frame.l: Frame.l is a logical (True/False) expression which
  1058. ;                 indicates that the message is displayed within an inter-
  1059. ;                 ior GUI frame.  "True" indicates that the proc should use
  1060. ;                 a frame; "false" indicates that it should not.
  1061.  
  1062. ;                 Beep.l: Beep.l is a logical (True/False) expression which
  1063. ;                 indicates that a "beep" should accompany the display of
  1064. ;                 the dialog box.  "True" indicates yes; "False," no.
  1065.  
  1066. ; Return Value:   YesNo.l returns logical True of the user pressed [Yes] and
  1067. ;                 logical False is the user pressed [No].
  1068.  
  1069. ; Usage:          YesNo.l is used whenever you need to get a decision from the
  1070. ;                 the user before continuing.  For example, it could be
  1071. ;                 called before backing up a table.
  1072.  
  1073. ; Example:        YesNo.l("Alert", "Ready to backup up database files?",
  1074. ;                 True, True)
  1075.  
  1076. ;────────────────────────────────────────────────────────────────────────────
  1077.  
  1078. PROC YESNO.L(TITLE.A, MESSAGE.A, FRAME.L, BEEP.L)
  1079.     PRIVATE  MSGSEG.A, ; Unparsed message segment
  1080.     LENGTH.N, ; length of longest line
  1081.     NLINES.N, ; number of message lines
  1082.     MSG.A, ; Placeholder for Match()
  1083.     SROW.N, ; Starting row
  1084.     SCOL.N, ; Starting column
  1085.     CTRFORMAT.A ; Format for centering text
  1086.  
  1087.     PROCNAME.A = "YesNo.l" ; Note the proc name in case we
  1088.     ; encounter an error.
  1089.  
  1090.     ECHO OFF ; "Turn out the lights."
  1091.  
  1092.     MSGSEG.A = MESSAGE.A ; Initialize variables
  1093.     LENGTH.N = 0
  1094.     NLINES.N = 1
  1095.  
  1096.     WHILE MATCH(MSGSEG.A, "../.." , ; Determine how many lines there
  1097.         MSG.A, MSGSEG.A) ; are and how long the longest
  1098.         LENGTH.N = MAX(LENGTH.N, LEN(MSG.A)) ; one is.
  1099.         NLINES.N = NLINES.N + 1
  1100.     ENDWHILE
  1101.  
  1102.     LENGTH.N = MAX(LENGTH.N, LEN(MSGSEG.A)) ; The last line won't run through
  1103.     ; the above loop, so we have to
  1104.     ; compare its length against the
  1105.     ; longest line so far.
  1106.  
  1107.     LENGTH.N = MAX(LENGTH.N, 17) ; Make sure the box is big enough
  1108.     ; to accomodate buttons.
  1109.  
  1110.     LENGTH.N = MIN(LENGTH.N, 72) ; Make sure the longest line is
  1111.     ; not longer than 72 characters.
  1112.  
  1113.     IF FRAME.L THEN ; Add padding to line length to
  1114.         LENGTH.N = LENGTH.N + 8 ; allow for dialog box frame,
  1115.         NLINES.N = NLINES.N + 7 ; interior frame, and button.
  1116.  
  1117.     ELSE
  1118.         LENGTH.N = LENGTH.N + 6 ; If there's no interior frame,
  1119.         NLINES.N = NLINES.N + 6 ; then we can reduce the overall
  1120.         ; size of the dialog box.
  1121.     ENDIF
  1122.  
  1123.     SROW.N= 12 - INT(NLINES.N / 2) ; Determine starting row.
  1124.     SCOL.N = 40 - INT(LENGTH.N / 2) ; Determine starting col.
  1125.     CTRFORMAT.A = "W" + ; Set up format variable that
  1126.     STRVAL(LENGTH.N - 6) + ", ac" ; centers screen in width.
  1127.  
  1128.  
  1129.     SHOWDIALOG
  1130.         TITLE.A ; Display the dialog box.
  1131.         PROC "YesNoWaitProc.u" ; Specify the WaitProc to call
  1132.         TRIGGER "Open" ; the "Open" trigger is generated.
  1133.  
  1134.         @SROW.N, SCOL.N
  1135.         HEIGHT NLINES.N WIDTH LENGTH.N ; Dialog box coordinates.
  1136.  
  1137.         PUSHBUTTON @NLINES.N - 4, ; [Yes] Pushbutton
  1138.             INT((LENGTH.N / 2) - 10)
  1139.             WIDTH 9
  1140.             "~Y~es"
  1141.             OK
  1142.             DEFAULT ; The default button (duh!)
  1143.             VALUE "Yes"
  1144.             TAG "YesTag"
  1145.             TO BUTTONVALUE.A
  1146.  
  1147.         PUSHBUTTON @NLINES.N - 4, ; [No] Pushbutton
  1148.             INT(LENGTH.N / 2)
  1149.             WIDTH 9
  1150.             "~N~o"
  1151.             CANCEL
  1152.             VALUE "No"
  1153.             TAG "NoTAG"
  1154.             TO BUTTONVALUE.A
  1155.  
  1156.     ENDDIALOG
  1157.  
  1158.     RETURN RETVAL
  1159.  
  1160. ENDPROC
  1161. WRITELIB LIBNAME YESNO.L
  1162. RELEASE PROCS YESNO.L
  1163. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "YesNo.u" )
  1164.  
  1165.  
  1166. ; ────────────────────────────────────────────────────────────────────────────
  1167. ; This proc is called by the ShowDialog command in YesNo.l().  It follows the
  1168. ; standard WaitProc format.
  1169. ; ────────────────────────────────────────────────────────────────────────────
  1170.  
  1171. PROC YESNOWAITPROC.U(TRIGGERTYPE.A, TAGVALUE.A, EVENTRECORD.Y, CYCLE.N)
  1172.     PRIVATE  LASTLINE.A, ; Lastline of message.
  1173.     ELLIPSES.N ; Placeholder for ellipses search
  1174.  
  1175.     PROCNAME.A = "YesNoWaitProc.u" ; Note the proc name in case we
  1176.     ; encounter an error.
  1177.  
  1178.     WINDOW HANDLE DIALOG TO YESNO.H ; Give this dialog box a handle.
  1179.     SETCANVAS YESNO.H ; Set the canvas to the dialog
  1180.     ; box, so that we can write to it.
  1181.  
  1182.     CANVAS OFF ; Turn the canvas off while we
  1183.     ; draw the message and frame.
  1184.  
  1185.     STYLE ATTRIBUTE SYSCOLOR(1036) ; Use the default background text
  1186.     ; for Dialog boxes.
  1187.  
  1188.     IF FRAME.L THEN ; See if the user wants an inter-
  1189.         FRAME SINGLE ; ior frame; if so, draw it.
  1190.         FROM 0, 1 TO NLINES.N - 6,
  1191.         LENGTH.N - 4
  1192.         ; Now paint the frame--GUI-style.
  1193.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Top line of frame box.
  1194.         0, 1, 0, LENGTH.N - 5
  1195.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1032) ; Left line of frame box.
  1196.         0, 1, NLINES.N - 6, 1
  1197.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1036) ; Right line of frame box.
  1198.         0, LENGTH.N - 4,
  1199.         NLINES.N - 6, LENGTH.N - 4
  1200.         PAINTCANVAS ATTRIBUTE SYSCOLOR(1036) ; Bottom line of frame box.
  1201.         NLINES.N - 6, 2,
  1202.         NLINES.N - 6, LENGTH.N - 5
  1203.  
  1204.     ENDIF
  1205.  
  1206.     MSGSEG.A = MESSAGE.A ; Re-initialize variables.
  1207.     SROW.N= 1
  1208.     SCOL.N = 2
  1209.  
  1210.     WHILE MATCH(MSGSEG.A, "../.." , ; Parse the message, and paint
  1211.         MSG.A, MSGSEG.A) ; the canvas, one line at a time.
  1212.         @ SROW.N, SCOL.N
  1213.         ?? FORMAT(CTRFORMAT.A, MSG.A)
  1214.         SROW.N= SROW.N + 1 ; Move down one row.
  1215.     ENDWHILE
  1216.  
  1217.     LASTLINE.A = FORMAT(CTRFORMAT.A, ; Format the last line.
  1218.     MSGSEG.A)
  1219.     @ SROW.N, SCOL.N ?? LASTLINE.A ; Put it on the canvas.
  1220.     ELLIPSES.N = SEARCH("...", LASTLINE.A) ; Check for ellipses.
  1221.     IF ELLIPSES.N > 0 THEN ; If there's an ellipses, then
  1222.         STYLE ATTRIBUTE SYSCOLOR(1036) + 128 ; paint it with the blinking
  1223.         @ SROW.N, ; attribute.
  1224.         SCOL.N + ELLIPSES.N - 1 ?? "..."
  1225.     ENDIF
  1226.  
  1227.     CANVAS ON ; Display the completely-drawn
  1228.     ; message.
  1229.  
  1230.     IF BEEP.L THEN ; Check to see if the user wants
  1231.         BEEPEM.U("Alert") ; a beep. If so, call the proc.
  1232.     ENDIF
  1233.  
  1234. ENDPROC
  1235. WRITELIB LIBNAME YESNOWAITPROC.U
  1236. RELEASE PROCS YESNOWAITPROC.U
  1237. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "YesNoWaitProc.u" )
  1238.  
  1239.  
  1240. ; Taken from Paradoc 4.0 Developer's Guide
  1241.  
  1242. ; ---------------------------------------------------------------------------
  1243. ; Proc name  : ShowAboutBox()
  1244. ; Purpose    : Produces an "about" dialog box on demand
  1245. ; Returns    : *None*
  1246. ; Comments   : Uses global dynarray "SystemInfo" for window dimensions
  1247. ; Adapted from Greaves and Lindsay Paradox 4 Developers Guide
  1248. ; ---------------------------------------------------------------------------
  1249. PROC SHOWABOUTBOX()
  1250.     SYSINFO TO INFOBAG
  1251.  
  1252.     SHOWDIALOG
  1253.         "About"
  1254.         PROC "RepaintProc"
  1255.         IDLE
  1256.         @4,17 HEIGHT 17 WIDTH 45
  1257.  
  1258.         STYLE ATTRIBUTE 15+16
  1259.         @1,0 ?? FORMAT("W43,AC", "Moose and Squirrel Software" )
  1260.         STYLE ATTRIBUTE 112
  1261.         @3,0 ?? FORMAT("W43,AC", "CopyRight 1992-93  James Cap'n Walker" )
  1262.         @4,0 ?? FORMAT("W43,AC", "Portions Copyrighted by Kallista, Inc." )
  1263.         @5,0 ?? FORMAT("W43,AC", "and Weston Brother Software 1991-92" )
  1264.         FRAME FROM 6,1 TO 6,41
  1265.         @7,0 ?? FORMAT("W43,AC", FORMAT("D2", TODAY()) + "   " + TIME())
  1266.         @8,0 ?? FORMAT("W43,AC", "Mouse is" + IIF(INFOBAG["MOUSE"], " " , " not " ) + "Installed" )
  1267.         @10,4 ?? "Available Expanded Memeory : " + STRVAL(INFOBAG["EXPANDED"])
  1268.         @11,4 ?? "Available Extended Memeory : " + STRVAL(INFOBAG["EXTENDED"])
  1269.  
  1270.         PUSHBUTTON @13,16 WIDTH 10
  1271.             "OK"
  1272.             OK
  1273.             VALUE "OK"
  1274.             TAG "OKTag"
  1275.             TO PBUTTONVAL
  1276.     ENDDIALOG
  1277. ENDPROC
  1278.  
  1279. WRITELIB LIBNAME SHOWABOUTBOX
  1280. RELEASE PROCS SHOWABOUTBOX
  1281. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "ShowAboutBox" )
  1282.  
  1283.  
  1284. PROC REPAINTPROC(EVENTTYPE, TAGVALUE, EVENTVALUE, ELEMENTVALUE)
  1285.     REPAINTDIALOG
  1286.     RETURN TRUE
  1287. ENDPROC
  1288.  
  1289. WRITELIB LIBNAME REPAINTPROC
  1290. RELEASE PROCS REPAINTPROC
  1291. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "RepaintProc" )
  1292.  
  1293.  
  1294. ;This file is copyright (c) 1992, Informant Communications Group and the
  1295. ;article author. The material here may be used in an application provided
  1296. ;that this copyright/disclaimer information is kept in the original source
  1297. ;file. The material presented here is provided "as is" and with no guarantee.
  1298. ;Informant Communications Group/Paradox Informant assumes no responsibility
  1299. ;for the use or misuse of the material contained within.
  1300. ;
  1301. ;Contents        : Source file GUIBUTON.SC
  1302. ;Author          : Tony Goodman - Ensemble Corporation
  1303. ;Informant Issue : August 1992
  1304. ;Description     : Buttons in a Wait Proc by ENSEMBLE CORPORATION
  1305. ;
  1306. ; Paradox Informant
  1307. ; 10519 E. Stockton Blvd.
  1308. ; Suite 142
  1309. ; Elk Grove, CA  95624-9743
  1310. ; Phone: (916) 686-6610
  1311. ; Fax  : (916) 686-8497
  1312. ; BBS  : (916) 686-4740
  1313. ;-----------------------------------------------------------------------------
  1314.  
  1315. ; Buttons in a Wait Proc by ENSEMBLE CORPORATION
  1316.  
  1317. ;Createlib "ENSEMBLE"
  1318.  
  1319. PROC BUTTON_OBJECTS(BUTTONDYN)
  1320.     PRIVATE I,WINATTRIB,SYSTEMINFO,WINHANDLE
  1321.  
  1322.     SYSINFO TO SYSTEMINFO        ;We will want to know the Screen Height
  1323.  
  1324.     DYNARRAY WINATTRIB[]           ;Initalize Button Window Attributes
  1325.     WINATTRIB["HasFrame"]=FALSE    ;Remove the frame
  1326.     WINATTRIB["HasShadow"]=FALSE   ;3D GUI Buttons Look best with no shadow
  1327.     WINATTRIB["Style"]=127         ;Canvas Color for button Text
  1328.     WINATTRIB["Height"]=3          ;Button Height
  1329.     WINATTRIB["CanvasHeight"]=3    ;Ditto
  1330.     WINATTRIB["Width"]=8           ;Button Width (Up to 10 buttons will fit)
  1331.     WINATTRIB["CanvasWidth"]=8     ;Ditto
  1332.     WINATTRIB["OriginCol"]=(80 - DYNARRAYSIZE(BUTTONDYN)*WINATTRIB["Width"])/2
  1333.     ;Left Column Button Panel
  1334.     WINATTRIB["OriginRow"]=SYSTEMINFO["ScreenHeight"]-3
  1335.     ;Place buttons near bottom of screen
  1336.  
  1337.     FOREACH I IN BUTTONDYN
  1338.  
  1339.         ;Attach Button Method to Button via the Title Attribute;
  1340.         ;The title actually becomes a miniscript to be executed.
  1341.         WINATTRIB["Title"]=BUTTONDYN[i]+" ;METHOD"  ;Method Identifier
  1342.  
  1343.         WINDOW CREATE  FLOATING
  1344.         ATTRIBUTES WINATTRIB
  1345.         TO WINHANDLE
  1346.  
  1347.         GUIFRAME(WINHANDLE,"Out")       ;Make a button look like a button
  1348.         ;Button Lable Text
  1349.         @ 1,1 ?? FORMAT("W"+STRVAL(WINATTRIB["Width"]-2)+",AC",I)
  1350.  
  1351.         ;Increment Origin Column for the next button
  1352.         WINATTRIB["OriginCol"]=WINATTRIB["OriginCol"]+WINATTRIB["Width"]
  1353.  
  1354.     ENDFOREACH
  1355.  
  1356. ENDPROC
  1357.  
  1358. WRITELIB LIBNAME BUTTON_OBJECTS
  1359. RELEASE PROCS BUTTON_OBJECTS
  1360. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "Buttom_Objects" )
  1361.  
  1362.  
  1363.  
  1364. PROC GUIFRAME(WINHANDLE,IN_OUT)
  1365.     PRIVATE COLOR1,COLOR2,WINATTRIB,H,W
  1366.  
  1367.     IF IN_OUT="Out" THEN
  1368.         COLOR1=112   COLOR2=127
  1369.     ELSE
  1370.         COLOR1=127   COLOR2=112
  1371.     ENDIF
  1372.  
  1373.     WINDOW GETATTRIBUTES WINHANDLE TO WINATTRIB
  1374.     H=WINATTRIB["CanvasHeight"]
  1375.     W=WINATTRIB["CanvasWidth"]
  1376.  
  1377.     ;Draw The GUI Frame
  1378.     SETCANVAS WINHANDLE
  1379.     FRAME SINGLE FROM 0,0  TO H-1, W-1
  1380.     PAINTCANVAS ATTRIBUTE COLOR2  0, 0, H-1, W-1
  1381.     PAINTCANVAS ATTRIBUTE COLOR1  H-1, 1, H-1, W-2
  1382.     PAINTCANVAS ATTRIBUTE COLOR1  0, W-1, H-1, W-1
  1383.  
  1384. ENDPROC
  1385. WRITELIB LIBNAME GUIFRAME
  1386. RELEASE PROCS GUIFRAME
  1387. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "GUIFrame" )
  1388.  
  1389.  
  1390.  
  1391. PROC BUTTON_METHODS(TRIGGERTYPE,EVENTRECORD,CYCLENUMBER)
  1392.     PRIVATE WINHANDLE,WINATTRIB
  1393.  
  1394.     ;Check to see if the mouse is clicking on a button Window
  1395.     WINHANDLE=WINDOWAT(EVENTRECORD["Row"],EVENTRECORD["Col"])
  1396.     IF WINHANDLE >0 THEN
  1397.         WINDOW GETATTRIBUTES WINHANDLE TO WINATTRIB
  1398.  
  1399.         IF MATCH(WINATTRIB["Title"],"..;METHOD") THEN
  1400.             GUIFRAME(WINHANDLE,"In")
  1401.             IF EVENTRECORD["Action"]="DOWN" THEN
  1402.                 SLEEP 100
  1403.             ENDIF
  1404.             GUIFRAME(WINHANDLE,"Out")
  1405.  
  1406.             EXECUTE WINATTRIB["Title"]   ;Execute Button Method
  1407.             IF ISASSIGNED(RETVAL) AND
  1408.                 (RETVAL=1 OR RETVAL=2 OR RETVAL=0) THEN
  1409.                 RETURN RETVAL                ;Return a 0 or 1 or 2
  1410.             ELSE
  1411.                 RETURN 1                     ;Return to Wait
  1412.             ENDIF
  1413.         ENDIF
  1414.     ENDIF
  1415.     RETURN 0                           ;Process the Mouse event normally
  1416. ENDPROC
  1417.  
  1418. WRITELIB LIBNAME BUTTON_METHODS
  1419. RELEASE PROCS BUTTON_METHODS
  1420. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "Button_Methods")
  1421.  
  1422.  
  1423. PROC BACKUPMANAGER();---------------------------------------------------
  1424.     ;This procedure is Copyrighted (c) 1993 JRN Enterprises, but may be distributed
  1425.     ;freely as SHAREWARE.  No fees or royalties are required by the author.
  1426.     ;
  1427.     ;This procedure was developed to provide an easy way to incorporate a
  1428.     ;backup  function into any application.  This is a common request among many
  1429.     ;users, and this utility will fill that need.
  1430.     ;
  1431.     ;The procedure has been soley developed and created by JRN Enteprises.
  1432.     ;This procedure may be copied and improved.  This procedure
  1433.     ;may also be distributed with applications all long as this statement is
  1434.     ;included.
  1435.     ;
  1436.     ;Please pass any improvements to the author.  Merely changing such code herein
  1437.     ;does not entitle one to the rights of this code.
  1438.     ;
  1439.     ;02/04/93  JRN ENTERPRISES
  1440.     ;          John R. Nelson
  1441.     ;          110 W. Marley Lane
  1442.     ;          Simpsonville, SC  29681
  1443.     ;          COMPUSERVE ID: 70641,3562
  1444.     ;          PRODIGY ID: RPJH51A
  1445.  
  1446.  
  1447.     ;VARIABLES
  1448.  
  1449.     PRIVATE
  1450.     BACKUPSTRING,    ;what will be used to perform the backup
  1451.     PATH,            ;the path to backup to
  1452.     NOCURPATH,       ;dummy variable testing for the current path
  1453.     BUTTONVALUE,     ;used in all of the dialog boxes
  1454.     DRVSIZE,         ;what size disk will be formatted
  1455.     MSG,             ;dialog messages of any length
  1456.     F,               ;length of generic messages
  1457.     TIME.A,          ;the time to use for backing up with the /t switch
  1458.     RETVAL,          ;system variable
  1459.     DATE1.D,         ;the date to use for backing up with the /d switch
  1460.     DRV,             ;the drive to back up to
  1461.     CURPATH,         ;the path to backup from
  1462.     BACKUPOPTS,      ;the array for the backup switches
  1463.     CHECKBOX,        ;the array for the checkboxes for backupopts
  1464.     A,               ;length of generic dialog message
  1465.     BACKUPPATH       ;the path to backup to
  1466.  
  1467.  
  1468.  
  1469.     CURPATH=DIRECTORY()                     ;get the current path
  1470.     BUTTONVALUE="Cancel"                    ;initialize
  1471.  
  1472.     ;set up an array for the radio buttons.  These are the options that are
  1473.     ;shown in any DOS book.
  1474.     ARRAY BACKUPOPTS[7]
  1475.     BACKUPOPTS[1]="/s Include subdirectories"
  1476.     BACKUPOPTS[2]="/m files changed since last BU"
  1477.     BACKUPOPTS[3]="/a Add files to those on BU disk"
  1478.     BACKUPOPTS[4]="/f Format target disk"
  1479.     BACKUPOPTS[5]="/d Only files modified after date"
  1480.     BACKUPOPTS[6]="/t Only files modified after time"
  1481.  
  1482.     ;BEWARE!!  An error seemed to occur every time that I tried to make a log
  1483.     ;file.  That is why it is not included.
  1484.     ;       BackupOpts[7]="/L Make log entry in specified file"   ;left this out
  1485.     ;for ease
  1486.     ;Array for the checkboxes themselves.  Checkbox 1 and 4 will already
  1487.     ;be marked when the user arrives
  1488.     ARRAY CHECKBOX[7]
  1489.     CHECKBOX[1]=TRUE
  1490.     CHECKBOX[4]=TRUE
  1491.  
  1492.  
  1493.     ;lets show the dialog box that the user will see
  1494.     SHOWDIALOG "Backup Manager"              ;box title
  1495.         @3,3 HEIGHT 18 WIDTH 76          ;position and size
  1496.  
  1497.         @2,2 ??"Current Path: "          ;information about where we are when
  1498.         ACCEPT @3,4 WIDTH 25             ;starting
  1499.             "A23"
  1500.             TAG "curpathtag"
  1501.             TO CURPATH
  1502.  
  1503.         @8,2 ?? "Backup Drive: "        ;description of radio buttons
  1504.         RADIOBUTTONS @9,5 HEIGHT 3 WIDTH 10
  1505.             "A",
  1506.             "B",
  1507.             "C"
  1508.             TAG "DrvTag"
  1509.             TO DRV
  1510.  
  1511.  
  1512.         STYLE ATTRIBUTE  126            ;yellow on gray description to show the
  1513.         @1,44 ?? "Backup Options"       ;checkboxes
  1514.  
  1515.         CHECKBOXES @2,33 HEIGHT 7 WIDTH 40
  1516.             TAG "Check"
  1517.             BACKUPOPTS[1] TO CHECKBOX[1],
  1518.             BACKUPOPTS[2] TO CHECKBOX[2],
  1519.             BACKUPOPTS[3] TO CHECKBOX[3],
  1520.             BACKUPOPTS[4] TO CHECKBOX[4],
  1521.             BACKUPOPTS[5] TO CHECKBOX[5],
  1522.             BACKUPOPTS[6] TO CHECKBOX[6]
  1523.         ;               BackupOpts[7] TO Checkbox[7]    ;commented out because it
  1524.         ;is not included
  1525.         PUSHBUTTON @14,15 WIDTH 10
  1526.             "OK"
  1527.             OK
  1528.             DEFAULT
  1529.             VALUE "Accept"
  1530.             TAG "AcceptTag"
  1531.             TO BUTTONVALUE
  1532.  
  1533.         PUSHBUTTON @14,40 WIDTH 10
  1534.             "Cancel"
  1535.             CANCEL
  1536.             VALUE "Cancel"
  1537.             TAG "CancelTag"
  1538.             TO BUTTONVALUE
  1539.     ENDDIALOG
  1540.  
  1541.     IF BUTTONVALUE="Accept" THEN            ;the user chose to continue!!
  1542.         NOCURPATH=TRUE                  ;dummy var. to see if the surrent path
  1543.         ;exists
  1544.         IF DIREXISTS(CURPATH)=0 THEN    ;does it exist?
  1545.             ;NO!!
  1546.             MSG="Directory "+CURPATH+" does not exist"
  1547.             A=LEN(MSG)+10           ;get the length of the message and
  1548.             ;add 5 spaces to it
  1549.             F=A                     ;set f
  1550.             IF F<30 THEN            ;make sure we have a big enough box
  1551.                 F=30
  1552.             ENDIF
  1553.  
  1554.             ;a dialog box to give the user a chance to know that the current path does
  1555.             ;not exist
  1556.             SHOWDIALOG "Directory Message"  ;Initiate a SHOWDIALOG box
  1557.                 @8,INT(41-F/2) HEIGHT 7 WIDTH F
  1558.                 ;on length of message
  1559.                 @1,4 ?? MSG                     ;print the message
  1560.  
  1561.                 PUSHBUTTON @3,INT(F/2)-6 WIDTH 10;Acknowledgment pushbutton
  1562.                     "OK"
  1563.                     OK
  1564.                     DEFAULT
  1565.                     VALUE "Yes"
  1566.                     TAG "ACCEPT"
  1567.                     TO BUTTONVALUE
  1568.             ENDDIALOG
  1569.             NOCURPATH=FALSE                         ;the current path did not
  1570.             ;exist set the value to FALSE
  1571.         ENDIF
  1572.         IF NOCURPATH THEN                       ;if the current path does exist
  1573.             ;then keep going
  1574.             SWITCH                                  ;change the radio buttons
  1575.                 CASE DRV=1:                     ;to drive letters that are
  1576.                     DRV="A:"                ;usable as switches
  1577.                 CASE DRV=2:
  1578.                     DRV="B:"
  1579.                 CASE DRV=3:
  1580.                     DRV="C:"
  1581.             ENDSWITCH
  1582.  
  1583.             BUTTONVALUE="Accept"                    ;initialize
  1584.             WHILE TRUE                              ;set up a loop to check the
  1585.                 ;backup drive
  1586.                 IF DRIVESTATUS(SUBSTR(DRV,1,1))=FALSE THEN      ;is the drive ready?
  1587.                     BUTTONVALUE="Cancel"            ;NO!!!
  1588.                     MSG="Drive "+DRV+" is not ready, please correct the error."
  1589.                     A=LEN(MSG)+10           ;get the length of the message and
  1590.                     ;add 5 spaces to it
  1591.                     F=A                     ;set f
  1592.                     IF F<30 THEN            ;Make the boz big enough
  1593.                         F=30
  1594.                     ENDIF
  1595.                     SHOWDIALOG "Drive Message"  ;Initiate a SHOWDIALOG box to give the
  1596.                         ;user a chance to reset the drive
  1597.                         @8,INT(41-F/2) HEIGHT 7 WIDTH F
  1598.                         ;on length of message
  1599.                         @1,4 ?? MSG                     ;print the message
  1600.  
  1601.                         PUSHBUTTON @3,INT(F/2)-16 WIDTH 10;Acknowledgment pushbutton
  1602.                             "Retry"
  1603.                             OK
  1604.                             DEFAULT
  1605.                             VALUE "Retry"
  1606.                             TAG "ACCEPT"
  1607.                             TO BUTTONVALUE
  1608.                         PUSHBUTTON @3,INT(F/2)+6 WIDTH 10;Cancel pushbutton
  1609.                             "Cancel"
  1610.                             CANCEL
  1611.                             VALUE "Cancel"
  1612.                             TAG "CANCEL"
  1613.                             TO BUTTONVALUE
  1614.                     ENDDIALOG
  1615.                     IF BUTTONVALUE="Cancel" THEN    ;the user decided not to go on
  1616.                         QUITLOOP
  1617.                     ENDIF
  1618.                 ELSE                                    ;the drive was ready to start with
  1619.                     QUITLOOP
  1620.                 ENDIF
  1621.             ENDWHILE
  1622.             IF BUTTONVALUE<>"Cancel" THEN           ;OK, we are still going.  the user made
  1623.                 ;it through the drive test.
  1624.                 BACKUPPATH=DRV                  ;set up the backup path
  1625.                 IF BUTTONVALUE<>"Cancel" THEN            ;OK, the path exists
  1626.                     BACKUPSTRING="BACKUP "+CURPATH+" "+BACKUPPATH   ;we will now set the backup string
  1627.                     IF CHECKBOX[1]=TRUE THEN                        ;did the user select the 's' switch?
  1628.                         BACKUPSTRING=BACKUPSTRING+" /s"         ;add it to the backup string
  1629.                     ENDIF
  1630.                     IF CHECKBOX[2]=TRUE THEN                        ;did the user select the 'm' switch
  1631.                         BACKUPSTRING=BACKUPSTRING+" /m"         ;add it to the backup string
  1632.                     ENDIF
  1633.                     IF CHECKBOX[3]=TRUE THEN                        ;did the user select the 'a' switch
  1634.                         BACKUPSTRING=BACKUPSTRING+" /a"         ;add it to the backup string
  1635.                     ENDIF
  1636.                     IF CHECKBOX[4]=TRUE THEN                        ;did the user select the 'f' switch
  1637.                         BUTTONVALUE="Cancel"                    ;we will initialize like Cancel
  1638.                         SHOWDIALOG "Backup Manager Disk Size"              ;box title
  1639.                             @3,15 HEIGHT 16 WIDTH 50   ;position and size
  1640.                             @1,10 ?? "Specify the backup disk type:"
  1641.  
  1642.                             RADIOBUTTONS @3,5 HEIGHT 7 WIDTH 40
  1643.                                 "160K single-sided 5.25 inch disk",
  1644.                                 "180K single-sided 5.25 inch disk",
  1645.                                 "320K double-sided 5.25 inch disk",
  1646.                                 "360K double-sided 5.25 inch disk",
  1647.                                 "1.2M double-sided 5.25 inch disk",
  1648.                                 " 720K  double-sided 3.5 inch disk",
  1649.                                 " 1.44M double-sided 3.5 inch disk"
  1650.                                 TAG "Drvsize"
  1651.                                 TO DRVSIZE
  1652.  
  1653.                             PUSHBUTTON @12,10 WIDTH 10
  1654.                                 "OK"
  1655.                                 OK
  1656.                                 DEFAULT
  1657.                                 VALUE "Accept"
  1658.                                 TAG "AcceptTag"
  1659.                                 TO BUTTONVALUE
  1660.  
  1661.                             PUSHBUTTON @12,30 WIDTH 10
  1662.                                 "Cancel"
  1663.                                 CANCEL
  1664.                                 VALUE "Cancel"
  1665.                                 TAG "CancelTag"
  1666.                                 TO BUTTONVALUE
  1667.                         ENDDIALOG
  1668.                         IF BUTTONVALUE<>"Cancel" THEN                   ;did they choose cancel?
  1669.                             SWITCH                                  ;no, so convert the radiobuttons
  1670.                                 CASE DRVSIZE=1:                 ;to something meaningful.
  1671.                                     DRVSIZE=160
  1672.                                 CASE DRVSIZE=2:
  1673.                                     DRVSIZE=180
  1674.                                 CASE DRVSIZE=3:
  1675.                                     DRVSIZE=320
  1676.                                 CASE DRVSIZE=4:
  1677.                                     DRVSIZE=360
  1678.                                 CASE DRVSIZE=5:
  1679.                                     DRVSIZE=720
  1680.                                 CASE DRVSIZE=6:
  1681.                                     DRVSIZE=1200
  1682.                                 CASE DRVSIZE=7:
  1683.                                     DRVSIZE=1440
  1684.                             ENDSWITCH
  1685.                             BACKUPSTRING=BACKUPSTRING+" /f:"+STRVAL(DRVSIZE)        ;add this to the backupstring
  1686.  
  1687.                         ENDIF
  1688.                     ENDIF
  1689.                     IF BUTTONVALUE<>"Cancel" THEN                   ;ensure that cancel has not been chosen
  1690.                         IF CHECKBOX[5]=TRUE THEN                ;do they want to backup since a date?
  1691.                             DATE1.D=1/1/90                  ;set default variable values
  1692.                             BUTTONVALUE="Cancel"
  1693.  
  1694.                             ;show a dialog box that will allow the user to enter the dates in an
  1695.                             ;easy manner
  1696.                             SHOWDIALOG "Date entry"
  1697.                                 @5,15 HEIGHT 8 WIDTH 53
  1698.  
  1699.                                 @2,2 ?? "Enter the date to backup from: "
  1700.                                 ACCEPT @2,33
  1701.                                     WIDTH 10 "D"
  1702.                                     MIN 1/1/90
  1703.                                     MAX TODAY()
  1704.                                     REQUIRED
  1705.                                     TAG "Date1"
  1706.                                     TO DATE1.D
  1707.  
  1708.                                 PUSHBUTTON @4,5 WIDTH 10
  1709.                                     "~O~K"
  1710.                                     OK
  1711.                                     VALUE "Accept"
  1712.                                     TAG "Yes"
  1713.                                     TO BUTTONVALUE
  1714.                                 PUSHBUTTON @4,35 WIDTH 10
  1715.                                     "~C~ANCEL"
  1716.                                     CANCEL
  1717.                                     VALUE "Cancel"
  1718.                                     TAG "No"
  1719.                                     TO BUTTONVALUE
  1720.                             ENDDIALOG
  1721.                             IF BUTTONVALUE<>"Cancel" THEN           ;add the date to the backup string
  1722.                                 BACKUPSTRING=BACKUPSTRING+" /d:"+STRVAL(DATE1.D)
  1723.                             ENDIF
  1724.                         ENDIF
  1725.                         IF BUTTONVALUE<>"Cancel" THEN                   ;what about a time?
  1726.                             IF CHECKBOX[6]=TRUE THEN
  1727.                                 TIME.A="00:00"   ;set default variable values
  1728.                                 BUTTONVALUE="Cancel"
  1729.  
  1730.                                 ;show a dialog box that will allow the user to enter the dates in an
  1731.                                 ;easy manner
  1732.                                 SHOWDIALOG "Time entry"
  1733.                                     @5,15 HEIGHT 8 WIDTH 53
  1734.  
  1735.                                     @2,2 ?? "Enter the time to backup from: "
  1736.                                     ACCEPT @2,33
  1737.                                         WIDTH 8 "A5"
  1738.                                         PICTURE "{0#,1#,2{0,1,2,3}}:{0,1,2,3,4,5}#"
  1739.                                         REQUIRED
  1740.                                         TAG "timea"
  1741.                                         TO TIME.A
  1742.  
  1743.                                     PUSHBUTTON @4,5 WIDTH 10
  1744.                                         "~O~K"
  1745.                                         OK
  1746.                                         VALUE "Accept"
  1747.                                         TAG "Yes"
  1748.                                         TO BUTTONVALUE
  1749.                                     PUSHBUTTON @4,35 WIDTH 10
  1750.                                         "~C~ANCEL"
  1751.                                         CANCEL
  1752.                                         VALUE "Cancel"
  1753.                                         TAG "No"
  1754.                                         TO BUTTONVALUE
  1755.                                 ENDDIALOG
  1756.                                 IF BUTTONVALUE<>"Cancel" THEN           ;add the time to the string
  1757.                                     BACKUPSTRING=BACKUPSTRING+" /t:"+TIME.A
  1758.                                 ENDIF
  1759.                             ENDIF
  1760.                             IF BUTTONVALUE<>"Cancel" THEN           ;Lets backup
  1761.                                 BEEPEM.U("ILLEGAL")
  1762.                                 MESSAGE "Executing backup command: "
  1763.                                 SLEEP 500
  1764.                                 MESSAGE BACKUPSTRING
  1765.                                 SLEEP 2000
  1766.  
  1767.                                 RUN NOSHELL BACKUPSTRING
  1768.                                 IF RETVAL <> -1 THEN
  1769.                                     BEEPEM.U("ERROR")
  1770.                                     MESSAGE "Backup command executed!!"
  1771.                                     SLEEP 2000
  1772.                                 ELSE
  1773.                                     OK.U("Backup Problem", "BACKUP FAILED!//Backup Command may not be on your path...",TRUE,TRUE)
  1774.                                 ENDIF
  1775.                             ENDIF
  1776.                         ENDIF
  1777.                     ENDIF
  1778.                 ENDIF
  1779.             ENDIF
  1780.         ENDIF
  1781.     ENDIF
  1782. ENDPROC;---------------------------------------------------------------
  1783. WRITELIB LIBNAME BACKUPMANAGER
  1784. RELEASE PROCS BACKUPMANAGER
  1785. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "BackUpManager")
  1786.  
  1787.  
  1788.  
  1789. ;This file is copyright (c) 1992 Informant Communications Group and the
  1790. ;article author. The material here may be used in an application provided
  1791. ;that this copyright/disclaimer information is kept in the original source
  1792. ;file. The material presented here is provided "as is" and with no guarantee.
  1793. ;Informant Communications Group/Paradox Informant assume no responsibility
  1794. ;for the use or misuse of the material contained within.
  1795. ;
  1796. ;Contents        : procedures inErrorHandler.n(),
  1797. ;                             inErrorLog.u(),
  1798. ;                             msAlertDialog.u(),
  1799. ;                             msConfirm.l(),
  1800. ;                             msContinue!.u(),
  1801. ;                             msShortcuts.a(),
  1802. ;                             msWorking.u(),
  1803. ;                             msWorkingClear.u(),
  1804. ;                             quExecute.l()
  1805. ;
  1806. ;Source File     : ERRUTIL1.SC
  1807. ;Author          : Dan Paolini
  1808. ;                  DataStar International
  1809. ;                  dp Solutions
  1810. ;
  1811. ;Informant Issue : November 1992
  1812. ;
  1813. ;Description     : Error-handling procedures
  1814. ;
  1815. ; Paradox Informant
  1816. ; 10519 E. Stockton Blvd.
  1817. ; Suite 142
  1818. ; Elk Grove, CA  95624-9743
  1819. ; Phone: (916) 686-6610
  1820. ; Fax  : (916) 686-8497
  1821. ; BBS  : (916) 686-4740
  1822.  
  1823. ; ============================================================================
  1824. ;       TITLE: msWorkingClear.u         (c) 1991 - 1993 DataStar International
  1825. ;     RETURNS: No value
  1826. ; DESCRIPTION: Generic Information Message Window Clearer
  1827. ; ----------------------------------------------------------------------------
  1828. PROC MSWORKINGCLEAR.U()          ; Clears msWorking message
  1829.     PRIVATE  OLDWINDOW.H,
  1830.     OLDCANVAS.H
  1831.     ;Global  g.message.h
  1832.     OLDWINDOW.H = GETWINDOW()
  1833.     OLDCANVAS.H = GETCANVAS()
  1834.     IF ISASSIGNED(G.MESSAGE.H) AND ISWINDOW(G.MESSAGE.H) THEN
  1835.         WINDOW SELECT G.MESSAGE.H
  1836.         WINDOW CLOSE
  1837.     ENDIF
  1838.     IF ISWINDOW(OLDCANVAS.H) THEN
  1839.         SETCANVAS OLDCANVAS.H
  1840.     ELSE
  1841.         SETCANVAS DEFAULT
  1842.     ENDIF
  1843.     IF ISWINDOW(OLDWINDOW.H) THEN
  1844.         WINDOW SELECT OLDWINDOW.H
  1845.     ENDIF
  1846.     RETURN
  1847. ENDPROC
  1848. WRITELIB LIBNAME MSWORKINGCLEAR.U
  1849. RELEASE VARS MSWORKINGCLEAR.U
  1850. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "msWorkingClear.u")
  1851.  
  1852.  
  1853. ; ============================================================================
  1854. ;       TITLE: msWorking.u              (c) 1991 - 1993 DataStar International
  1855. ;     RETURNS: No value
  1856. ; DESCRIPTION: Generic Information Message Window, Cleared as follows:
  1857. ;                 0 Seconds      - must be manually cleared
  1858. ;                 1 - 5 Seconds  - self-clears
  1859. ;                -1 Seconds      - pauses while event = IDLE, then clears
  1860. ; ----------------------------------------------------------------------------
  1861. PROC MSWORKING.U(                ; Generic information message window
  1862.     MESSAGE.A,              ; Message to display (<ScreenWidth
  1863.     COLOR.N,                ; Color for message window
  1864.     BEEP.N,                 ; Number of beeps
  1865.     SLEEP.N)                ; # of Seconds to pause (-1 to 5)
  1866.     PRIVATE  Y, N,
  1867.     WIDTH.N,
  1868.     OLDCANVAS.H,
  1869.     OLDWINDOW.H,
  1870.     OFFSET.N
  1871.     ;Global  g.message.h
  1872.     ;        g.sysinfo.y
  1873.  
  1874.     IF LEN(MESSAGE.A) = 1 THEN
  1875.         MESSAGE.A = MSSHORTCUTS.A(MESSAGE.A)
  1876.     ENDIF
  1877.     MESSAGE.A = MESSAGE.A + "..."
  1878.  
  1879.     IF NOT ISASSIGNED(G.SYSINFO.Y) THEN
  1880.         SYSINFO TO G.SYSINFO.Y             ; Determine Screen Size
  1881.     ENDIF
  1882.  
  1883.     MSWORKINGCLEAR.U()
  1884.  
  1885.     DYNARRAY Y[]
  1886.     Y["CanClose"] = FALSE
  1887.     Y["CanMaximize"] = FALSE
  1888.     Y["CanMove"] = FALSE
  1889.     Y["CanResize"] = FALSE
  1890.     Y["HasFrame"] = FALSE    ; If Framed, window is *5* rows!!!
  1891.     Y["Style"] = COLOR.N
  1892.  
  1893.  
  1894.     WIDTH.N = MAX(50,MIN(LEN(MESSAGE.A)+4,G.SYSINFO.Y["ScreenWidth"]-4))
  1895.     OFFSET.N = MAX(5,INT((WIDTH.N-LEN(MESSAGE.A)+1)/2)+3)
  1896.     OLDCANVAS.H = GETCANVAS()
  1897.     OLDWINDOW.H = GETWINDOW()
  1898.  
  1899.  
  1900.     WINDOW CREATE  FLOATING @ -200,-200
  1901.     HEIGHT 1 WIDTH WIDTH.N
  1902.     ATTRIBUTES Y TO G.MESSAGE.H
  1903.  
  1904.     STYLE ATTRIBUTE COLOR.N
  1905.     PAINTCANVAS FILL FORMAT("w"+STRVAL(WIDTH.N)+",ac",MESSAGE.A) ATTRIBUTE COLOR.N  0,0,0,WIDTH.N-1
  1906.     PAINTCANVAS ATTRIBUTE COLOR.N + 128  0,WIDTH.N - OFFSET.N,0,WIDTH.N-OFFSET.N+2
  1907.  
  1908.     WINDOW MOVE G.MESSAGE.H TO 1, INT((G.SYSINFO.Y["ScreenWidth"]-WIDTH.N)/2)
  1909.  
  1910.     FOR N FROM 1 TO MIN(5,BEEP.N)
  1911.         BEEP SLEEP 100                   ; Beep for desired # of Beeps
  1912.     ENDFOR
  1913.  
  1914.     SWITCH
  1915.         CASE SLEEP.N > 0  :
  1916.             SLEEP MIN(SLEEP.N,5) * 1000   ; Sleep for desired # of seconds
  1917.             WINDOW SELECT G.MESSAGE.H
  1918.             WINDOW CLOSE
  1919.         CASE SLEEP.N < 0  :
  1920.             MESSAGE "Mouseclick or Press Any Key to Continue..."
  1921.             WHILE TRUE
  1922.                 GETEVENT ALL TO Y
  1923.                 IF (Y["Type"] = "MOUSE" AND Y["Action"] = "DOWN") OR
  1924.                     Y["Type"] = "KEY" THEN
  1925.                     QUITLOOP
  1926.                 ENDIF
  1927.             ENDWHILE
  1928.             WINDOW SELECT G.MESSAGE.H
  1929.             WINDOW CLOSE
  1930.     ENDSWITCH
  1931.  
  1932.     IF ISWINDOW(OLDCANVAS.H) THEN
  1933.         SETCANVAS OLDCANVAS.H
  1934.     ELSE
  1935.         SETCANVAS DEFAULT
  1936.     ENDIF
  1937.     IF ISWINDOW(OLDWINDOW.H) THEN
  1938.         WINDOW SELECT OLDWINDOW.H
  1939.     ENDIF
  1940.     RETURN
  1941. ENDPROC
  1942. WRITELIB LIBNAME MSWORKING.U
  1943. RELEASE VARS MSWORKING.U
  1944. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "msWorking.u")
  1945.  
  1946.  
  1947.  
  1948.  
  1949.  
  1950.  
  1951. ;===========================================================================
  1952. ;      AUTHOR: Copyright (c) 1992 - Daniel J. Paolini II
  1953. ;                                   DataStar International
  1954. ;                                   dp Solutions
  1955. ;     CREATED: 09-21-92 04:03 am    Version 4.03
  1956. ;
  1957. ;       TITLE: inErrorHandler.n         (c) 1991 - 1993 DataStar International
  1958. ;     RETURNS: Error Continuation Code
  1959. ; DESCRIPTION: Main Error Handling Procedure - calls inErrorLog.u
  1960. ;              The initial switch deals with specific errors, and attempts
  1961. ;              to continue the application.  You should do this only when
  1962. ;              you are sure it won't end up breaking something else (e.g.
  1963. ;              If you continue from a query error, and later code expects
  1964. ;              that the query will have performed successfully, you are
  1965. ;              just postponing the inevitable.  That is one reason to use a
  1966. ;              Query Execute procedure, so that you can interrupt the
  1967. ;              process in the event of an error.
  1968. ; ----------------------------------------------------------------------------
  1969. PROC INERRORHANDLER.N()          ; Main Error Handler
  1970.     PRIVATE  ERRORPROC,              ; Keeps errorproc from being recursive
  1971.     ERROR.Y,                ; DynArray from ErrorInfo
  1972.     MESSAGE.A,              ; Formatted message to user
  1973.     SCRIPT.A,               ; Concatonated re-named Savevars.sc
  1974.     ERRORWIN.A,             ; Paradox Window()
  1975.     A,                      ; Counter for FOREACH command
  1976.     WINDOWS.R,              ; Array of Windows from WINDOW LIST
  1977.     N1, N2                  ; Transient Loop Counters
  1978.     ;Global  g.sysinfo.y             ; System info dynarray
  1979.     ;        g.debug.l               ; Development DEBUG flag
  1980.     ;        g.y                     ; Dynarray of Passwords
  1981.     ;        g.startmemleft.n        ; Memory at Startup
  1982.     ;        error.l                 ; Error flag passed back to routine
  1983.     ERRORWIN.A = WINDOW()                     ; Capture the Paradox Window
  1984.     IF NIMAGES() > 0 AND IMAGETYPE() <> "Query" THEN
  1985.         SETBATCH OFF                           ; Just in case
  1986.     ENDIF
  1987.     ERRORINFO TO ERROR.Y                      ; Capture the error info bag
  1988.     RETVAL.N = 2                              ; Initialize returned value
  1989.     SWITCH
  1990.         CASE ERROR.Y["Proc"] = "WSDITTO.U"        :
  1991.             MSCONTINUE!.U("","You cannot ditto " + STRVAL(RECORD.R[Field()]) +
  1992.             " - " + ERRORWIN.A,79,"RED",1)
  1993.             RETVAL.N = 1                        ; Ignore Ditto
  1994.         CASE ERROR.Y["Proc"] = "WSFIELDVIEW.U" AND ERROR.Y["Code"] = 23 :
  1995.             MSCONTINUE!.U("","The Field Value does not satisfy current validity " +
  1996.             "checks.  Current field value is:  " +
  1997.             STRVAL([]),30,"BLUE",1)
  1998.             ERROR.L = TRUE                      ; Set error flag
  1999.             RETVAL.N = 1                        ; Step over the []=[] assignment
  2000.         CASE ERROR.Y["Proc"] = "WSPICKFORM.L"     :
  2001.             ERROR.L = TRUE                      ; Set error flag
  2002.             MSCONTINUE!.U("",ERROR.Y["Message"],79,"RED",1)
  2003.             RETVAL.N = 1
  2004.         CASE ERROR.Y["Proc"] = "WSCOPYFROMARRAY.U"   :
  2005.             SWITCH
  2006.                 CASE (ERROR.Y["Code"] = 60 AND
  2007.                     MATCH (ERROR.Y["Message"],"..linked fields in ..") OR
  2008.                     MATCH (ERROR.Y["Message"],"..master record is blank..")) OR
  2009.                     (ERROR.Y["Code"] = 23 AND
  2010.                     MATCH(ERROR.Y["Message"],"..value must be provided..")):
  2011.                     RETVAL.N = 1
  2012.                 CASE ERROR.Y["Code"] = 23 AND
  2013.                     MATCH(ERROR.Y["Message"],"..not one of the possible value.."):
  2014.                     WSCOPYFROMARRAYRECOVER.U(ARRAYNAME.A)
  2015.             ENDSWITCH
  2016.         CASE ERROR.Y["Code"] = 23
  2017.             AND IMAGETYPE() = "Query"
  2018.             AND ERROR.Y["Proc"] = "QUEXECUTE.L" :
  2019.             A = []
  2020.             CTRLBACKSPACE                       ; Eliminate offending expression
  2021.             MSCONTINUE!.U("","","The invalid query criterion: " + A +
  2022.             " was deleted from the " + FIELD() + " field," +
  2023.             " so that the Query could continue.",31,"BLUE",1)
  2024.             RETVAL.N = 1                        ; Skip over error command
  2025.         CASE ERROR.Y["Code"] = 34
  2026.             AND SEARCH("procedure",ERROR.Y["Message"]) <> 0  :
  2027.             SWITCH
  2028.                 CASE SEARCH("!",ERROR.Y["Message"]) <> 0    :
  2029.                     ERROR.L = TRUE
  2030.                     RETVAL.N = 1
  2031.                 CASE SEARCH("help",ERROR.Y["Message"]) <> 0 :
  2032.                     HELPCHOICE.A = "HELP"
  2033.                     HELPMENU.A = "DEFAULT"
  2034.                     RETVAL.N = 0
  2035.             ENDSWITCH
  2036.         CASE ERROR.Y["Code"] = 27              ; Using quExecute.l proc
  2037.             AND IMAGETYPE() = "Query"
  2038.             AND ERROR.Y["Proc"] = "QUEXECUTE.L" :
  2039.             ERROR.L = TRUE                      ; Set Query Error flag
  2040.             RETVAL.N = 1                        ; Skip over error command
  2041.         CASE ERROR.Y["Code"] = 27              ; Not using quExecute.l proc
  2042.             AND IMAGETYPE() = "Query" :
  2043.             MSCONTINUE!.U("","Query Error - " +WINDOW(),79,"RED",3)
  2044.             RETVAL.N = 1                        ; Skip over error command
  2045.         CASE ERROR.Y["Code"] = 27 :
  2046.             MSCONTINUE!.U("","Sorry, the Query could NOT be Completed",79,"RED",3)
  2047.             RETVAL.N = 1                        ; Skip over error command
  2048.         CASE ERROR.Y["Code"] = 43
  2049.             OR ERROR.Y["Message"] = "Printer not ready" :
  2050.             IOPRINTERSTATUS.L()
  2051.             IF RETVAL THEN
  2052.                 RETVAL.N = 0
  2053.             ELSE
  2054.                 RETVAL.N = 1
  2055.             ENDIF
  2056.         CASE ERROR.Y["Proc"] = "INSTARTUP.L"
  2057.             AND ERROR.Y["Code"] = 11     :        ; PrivDir conflict
  2058.             RETVAL.N = 1
  2059.         CASE ERROR.Y["Proc"] = "INERRORRESET.U"
  2060.             AND ERROR.Y["Code"] = 30     :        ; ErrorReset
  2061.             RETVAL.N = 1
  2062.     ENDSWITCH
  2063.  
  2064.     IF RETVAL.N = 2 THEN                      ; Error still not resolved
  2065.         ECHO OFF
  2066.         PASSWORD.A = ""                        ; Deassign any password variables
  2067.         IF NOT ISASSIGNED(G.SYSINFO.Y) THEN
  2068.             SYSINFO TO G.SYSINFO.Y              ; Capture System Info
  2069.         ENDIF
  2070.  
  2071.         IF G.SYSINFO.Y["UIMode"] = "COMPATIBLE" THEN
  2072.             CANVAS ON                           ; Just in case
  2073.         ENDIF
  2074.  
  2075.         IF ISASSIGNED(G.Y) THEN                ; Deassign any password variables
  2076.             FOREACH A IN G.Y
  2077.                 UNPASSWORD G.Y[a]
  2078.                 G.Y[a] = "********"
  2079.             ENDFOREACH
  2080.         ENDIF
  2081.  
  2082.         IF ISASSIGNED(G.A) THEN
  2083.             UNPASSWORD G.A
  2084.             G.A = "********"
  2085.         ENDIF
  2086.  
  2087.         IF ISASSIGNED(T.A) THEN
  2088.             UNPASSWORD T.A
  2089.             T.A = "********"
  2090.         ENDIF
  2091.  
  2092.         IF ISASSIGNED(CHARS.A) THEN
  2093.             CHARS.A = "********"
  2094.         ENDIF
  2095.  
  2096.         IF NOT MATCH(ERROR.Y["Message"],"..run Error..",A,MESSAGE.A) THEN
  2097.             IF NOT MATCH(ERROR.Y["Message"],"..Syntax Error..",A,MESSAGE.A) THEN
  2098.                 MESSAGE.A = ERROR.Y["Message"]
  2099.             ENDIF
  2100.         ENDIF
  2101.  
  2102.         MSWORKING.U(MESSAGE.A,79,0,0)
  2103.         IF NOT ISASSIGNED(G.DEBUG.L) OR NOT G.DEBUG.L THEN
  2104.             MSCONTINUE!.U("","Error in Procedure: " + ERROR.Y["Proc"] + " - " +
  2105.             MESSAGE.A,79,"RED",4)
  2106.             IF DIREXISTS("ERR") = 0 THEN        ; Create an ERR directory if none
  2107.                 RUN NOREFRESH "MD ERR"           ; Store error logs in separate Dir
  2108.             ENDIF                               ; Log the error info
  2109.             SCRIPT.A = "ERR\\"+STRVAL(TICKS())  ; Easy Unique Name
  2110.  
  2111.             INERRORLOG.U(ERROR.Y,G.SYSINFO.Y)   ; Log the error to disk and printer
  2112.  
  2113.             MSWORKING.U("Saving Current Variable Assignments to Disk",110,0,0)
  2114.             SAVEVARS ALL                        ; Rename Savevars.sc for posterity
  2115.             IF SYSMODE() <> "Main" THEN
  2116.                 RUN NOREFRESH "REN "+PRIVDIR()+"savevars.sc "+DIRECTORY()+"\\"+SCRIPT.A
  2117.             ELSE
  2118.                 {Tools} {Rename} {Script} SELECT "Savevars" SELECT SCRIPT.A
  2119.                 IF MENUCHOICE() = "Cancel" THEN     ; VERY unlikely
  2120.                     {Replace}
  2121.                 ENDIF
  2122.             ENDIF
  2123.         ELSE
  2124.             MSCONTINUE!.U("","Error in Procedure: " + ERROR.Y["Proc"],79,
  2125.             "RED",1)
  2126.         ENDIF
  2127.         MSWORKINGCLEAR.U()                     ; Removes message window
  2128.  
  2129.         IF NOT ISASSIGNED(G.DEBUG.L) OR NOT G.DEBUG.L THEN
  2130.             MSCONTINUE!.U("","Log Complete - Please Contact Technical Support",
  2131.             31,"BLUE",1)
  2132.             RESET
  2133.             {Tools} {More} {Protect} {Clearpasswords}
  2134.             SETCOLORS DEFAULT
  2135.             EXIT
  2136.         ELSE                                   ; Allow access to DEBUG prompt
  2137.             MSCONFIRM!.L("","IF <Debug>, Use <Ctrl><T> to Trace Back to Error",79,
  2138.             "RED",3,"~D~ebug","~C~ancel",TRUE)
  2139.             IF RETVAL THEN
  2140.                 MSCONFIRM!.L("","Maintain Context, or Display SAVEVARS?",63,
  2141.                 "CYAN",1,"~C~ontext","~S~avevars",TRUE)
  2142.                 IF NOT RETVAL THEN
  2143.                     CANCELDIALOG
  2144.                     WINDOW LIST TO WINDOWS.R
  2145.                     N1 = ARRAYSIZE(WINDOWS.R)
  2146.                     FOR N2 FROM 1 TO N1
  2147.                         IF ISWINDOW(WINDOWS.R[n2]) THEN
  2148.                             WINDOW SELECT WINDOWS.R[n2]
  2149.                             WINDOW CLOSE
  2150.                         ENDIF
  2151.                     ENDFOR
  2152.                     SAVEVARS ALL
  2153.                     EDITOR OPEN PRIVDIR() + "Savevars.sc"
  2154.                 ENDIF
  2155.                 DEBUG                            ; Must <Ctrl><T> back to error
  2156.                 RETVAL.N = 0
  2157.             ELSE
  2158.                 RESET
  2159.                 {Tools} {More} {Protect} {Clearpasswords}
  2160.                 SETCOLORS DEFAULT
  2161.                 QUIT "You have Canceled the Application from the Error Prompt..."
  2162.             ENDIF
  2163.         ENDIF
  2164.     ELSE
  2165.         PROC EPERRORRESET.N()      ; Reset the ErrorCode
  2166.             PRIVATE ERRORPROC
  2167.             RETURN 1
  2168.         ENDPROC
  2169.         ERRORPROC = "epErrorReset.n"           ; Specialized errorproc
  2170.         RETVAL = 1 + "A"                       ; Create errorcode 30
  2171.         ERRORPROC = ""                         ; Deassign errorproc
  2172.         RELEASE PROCS EPERRORRESET.N           ; Release procedure
  2173.     ENDIF
  2174.     RETURN RETVAL.N                           ; 0, 1 or 2
  2175. ENDPROC
  2176. WRITELIB LIBNAME INERRORHANDLER.N
  2177. RELEASE VARS INERRORHANDLER.N
  2178. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "inErrorHandler.n")
  2179.  
  2180.  
  2181. ; ============================================================================
  2182. ;       TITLE: inErrorLog.u             (c) 1991 - 1993 DataStar International
  2183. ;     RETURNS: No value
  2184. ; DESCRIPTION: Error Logging Procedure - called by inErrorHandler.n
  2185. ;              Creates a Memo Variable and writes it to disk from the
  2186. ;              contents of error.y (ErrorInfo, SysInfo & selected info).
  2187. ; ----------------------------------------------------------------------------
  2188. PROC INERRORLOG.U(               ; Logs Error to file and printer
  2189.     ERROR.Y,                ; ErrorInfo DynArray
  2190.     G.SYSINFO.Y)            ; SysInfo DynArray
  2191.     PRIVATE  A,                      ; Tag of error.y in FOREACH loop
  2192.     ERROR.M                 ; Memo variable holding errorlog
  2193.     ;Global  g.debug.l               ; Development DEBUG flag
  2194.     MSWORKING.U("An Error has occurred, please wait while it is logged",79,3,0)
  2195.  
  2196.     ERROR.Y["Date of Error"] = TODAY()
  2197.     ERROR.Y["Working Directory"] = DIRECTORY()
  2198.     ERROR.Y["Working Drivespace"] = DRIVESPACE(SUBSTR(DIRECTORY(),1,1))
  2199.     ERROR.Y["Current MemLeft"] = MEMLEFT()
  2200.     ERROR.Y["Private Directory"] = PRIVDIR()
  2201.     ERROR.Y["Private Drivespace"] = DRIVESPACE(SUBSTR(PRIVDIR(),1,1))
  2202.     ERROR.Y["Printer Status"] = FORMAT("LO",PRINTERSTATUS())
  2203.     ERROR.Y["RunTime"] = FORMAT("LY",ISRUNTIME())
  2204.     ERROR.Y["Current SysMode"] = SYSMODE()
  2205.     ERROR.Y["Time of Error"] = TIME()
  2206.     ERROR.Y["Paradox version"] = VERSION()
  2207.  
  2208.     ERROR.Y["Paradox Build"] = G.SYSINFO.Y["Build"]
  2209.     ERROR.Y["Current Extended Memory"] = G.SYSINFO.Y["Extended"]
  2210.     ERROR.Y["Current Expanded Memory"] = G.SYSINFO.Y["Expanded"]
  2211.     ERROR.Y["Mouse Available"] = G.SYSINFO.Y["Mouse"]
  2212.     ERROR.Y["Screen Height"] = STRVAL(G.SYSINFO.Y["ScreenHeight"]) + " Rows"
  2213.     ERROR.Y["Screen Width"] = STRVAL(G.SYSINFO.Y["ScreenWidth"]) + " Columns"
  2214.     ERROR.Y["UI Mode"] = G.SYSINFO.Y["UIMode"]
  2215.  
  2216.     IF NIMAGES() <> 0 THEN                    ; occurred on image on workspace
  2217.         ERROR.Y["Number of Images"] = NIMAGES()
  2218.         ERROR.Y["Current Table"] = TABLE()
  2219.         ERROR.Y["Current Image Type"] = IMAGETYPE()
  2220.         ERROR.Y["Current Field"] = FIELD()
  2221.         IF IMAGETYPE() = "Display" THEN
  2222.             ERROR.Y["Current Field Value"] = IIF(NIMAGERECORDS() <> 0,[],"No Records Present")
  2223.         ELSE
  2224.             ERROR.Y["Current Field Value"] = []
  2225.         ENDIF
  2226.  
  2227.         ERROR.Y["Shared Table"] = ISSHARED(TABLE())
  2228.         IF ERROR.Y["Current Image Type"] = "Query" THEN
  2229.             IF CHECKMARKSTATUS() <> "" THEN ; store checkmark if appropriate
  2230.                 ERROR.Y["Current Field Value"] = CHECKMARKSTATUS()+" "+[]
  2231.             ENDIF
  2232.             ERROR.Y["Formview"] = "N/A"
  2233.             ERROR.Y["Record Number"] = "N/A"
  2234.         ELSE
  2235. ;            ERROR.Y["Formview"] = FORMAT("LN",ISFORMVIEW())
  2236.             ERROR.Y["Record Number"] = RECNO()
  2237.         ENDIF
  2238.         ERROR.Y["Number of Records"] = NRECORDS(TABLE())
  2239.     ELSE                                      ; not in an image
  2240.         ERROR.Y["Number of Images"] = "N/A"
  2241.         ERROR.Y["Current Table"] = "N/A"
  2242.         ERROR.Y["Current Image Type"] = "N/A"
  2243.         ERROR.Y["Current Field"] = "N/A"
  2244.         ERROR.Y["Current Field Value"] = "N/A"
  2245.         ERROR.Y["Shared Table"] = "N/A"
  2246.         ERROR.Y["Number of Records"] = "N/A"
  2247.         ERROR.Y["Formview"] = "N/A"
  2248.         ERROR.Y["Record Number"] = "N/A"
  2249.     ENDIF
  2250.  
  2251.     IF ISASSIGNED(G.SYSINFO.Y["Starting MemLeft"]) THEN
  2252.         ERROR.Y["Starting MemLeft"] = G.SYSINFO.Y["Starting MemLeft"]
  2253.     ELSE
  2254.         ERROR.Y["Starting MemLeft"] = "UA"
  2255.     ENDIF
  2256.  
  2257.     IF ERROR.Y["User"] = "" THEN
  2258.         ERROR.Y["User"] = "N/A"
  2259.     ENDIF
  2260.  
  2261.     ERROR.M = FILL("-",80) + "\n" +
  2262.     FORMAT("w80,ac","*** Error while in Procedure " +
  2263.     ERROR.Y["Proc"] + " ***") + "\n" +
  2264.     SPACES(8) + "Error: #" + STRVAL(ERROR.Y["Code"]) + " - " +
  2265.     ERROR.Y["Message"] + "\n" + SPACES(8) + FILL("-",64) + "\n"
  2266.     FOREACH A IN ERROR.Y
  2267.         ERROR.M = ERROR.M + FORMAT("w31,ar",A) + ":  " + STRVAL(ERROR.Y[a]) + "\n"
  2268.     ENDFOREACH
  2269.     ; Write memo variable to diskfile
  2270.     MSWORKING.U("Writing Error Log to Disk",31,0,0)
  2271.     FILEWRITE APPEND "ERR\\Errorlog.sc" FROM ERROR.M
  2272.     IF NOT ISASSIGNED(G.DEBUG.L) OR NOT G.DEBUG.L THEN
  2273.         IF PRINTERSTATUS() THEN             ; prints log if printer is available
  2274.             MSWORKING.U("Writing Error Log to Printer",111,0,0)
  2275.             OPEN PRINTER
  2276.             FILEWRITE PRIVDIR()+"Errorlog" FROM ERROR.M
  2277.             RUN NOREFRESH "Copy "+PRIVDIR()+"Errorlog LPT1 > NUL"
  2278.             EDITOR NEW PRIVDIR()+"Errorlog"
  2279.             {Cancel} {Yes}
  2280.             CLOSE PRINTER
  2281.         ENDIF
  2282.     ENDIF
  2283.     RETURN
  2284. ENDPROC
  2285. WRITELIB LIBNAME INERRORLOG.U
  2286. RELEASE VARS INERRORLOG.U
  2287. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "inErrorLog.u")
  2288.  
  2289.  
  2290. ; ============================================================================
  2291. ;       TITLE: ioAcceptDialog.v         (c) 1991 - 1993 DataStar International
  2292. ;     RETURNS: Value Entered, or false if Cancelled
  2293. ; DESCRIPTION: Generic routine for accepting data from user, with or without
  2294. ;              a Picture or Default value, Hidden or unhidden.
  2295. ; ----------------------------------------------------------------------------
  2296. PROC IOACCEPTDIALOG.V(           ; One value DialogBox Accept
  2297.     TOP.N,                  ; Top Row for Box (999 = Centered)
  2298.     LEFT.N,                 ; Left Column (999 = Centered)
  2299.     TITLE.A,                ; Title for dBox
  2300.     PROMPT.A,               ; Data Input Prompt
  2301.     TYPE.A,                 ; Type of Data Input
  2302.     PICTURE.A,              ; Additional validity string
  2303.     DEFAULT.V,              ; Any Default for the Accept Value?
  2304.     HIDDEN.L,               ; Hidden, or not?
  2305.     COLORS.Y)               ; DynArray of Colors
  2306.     PRIVATE  WIDTH.N,                ; Width of Dialog Box
  2307.     LENGTH.N,               ; Length of Input
  2308.     RIGHT.N,                ; Right edge of Box
  2309.     INPUT.V,                ; Value entered by user
  2310.     OLDCOLORS.Y,            ; Previous Color Set
  2311.     ACCEPT.V,               ; Variable to capture Accept
  2312.     SPOT.N,                 ; Where to begin Prompt
  2313.     PBUTTON.A               ; Pushbutton variable
  2314.     ;Global  g.sysinfo.y
  2315.     IF NOT ISASSIGNED(G.SYSINFO.Y) THEN
  2316.         SYSINFO TO G.SYSINFO.Y             ; Determine Screen Size
  2317.     ENDIF
  2318.     IF NOT ISASSIGNED(G.APPCOLORS.Y) THEN
  2319.         GETCOLORS TO G.APPCOLORS.Y
  2320.     ENDIF
  2321.     IF G.SYSINFO.Y["UIMode"] = "COMPATIBLE" THEN
  2322.         ACCEPT.V = IOCANVASACCEPT.V(TOP.N, LEFT.N, 79, PROMPT.A, TYPE.A,
  2323.         IIF(ISBLANK(PICTURE.A),"",
  2324.         "Picture \""+PICTURE.A+"\""))
  2325.     ELSE
  2326.         IF LEN(PROMPT.A) > 50 THEN          ; Must keep to a reasonable length
  2327.             ACCEPT.V = FALSE
  2328.             MESSAGE "ERROR - Prompt is too Long!!!"
  2329.             BEEP BEEP BEEP
  2330.             SLEEP 5000
  2331.         ELSE
  2332.             IF TYPE(COLORS.Y) = "DY" THEN    ; Must be a DynArray, or else ignore
  2333.                 SETCOLORS FROM COLORS.Y
  2334.             ENDIF
  2335.             SWITCH                           ; Determine length of Accept Datatype
  2336.                 CASE TYPE.A = "D" :           ; Set Default value to passed value
  2337.                     LENGTH.N = 11              ;  or a blank value if none passed
  2338.                     ACCEPT.V = IIF(ISBLANK(DEFAULT.V),BLANKDATE(),DEFAULT.V)
  2339.                 CASE TYPE.A = "N" OR TYPE.A = "$"   :
  2340.                     LENGTH.N = 20
  2341.                     ACCEPT.V = IIF(ISBLANK(DEFAULT.V),BLANKNUM(),DEFAULT.V)
  2342.                 CASE TYPE.A = "S" :
  2343.                     LENGTH.N = 8
  2344.                     ACCEPT.V = IIF(ISBLANK(DEFAULT.V),BLANKNUM(),DEFAULT.V)
  2345.                 OTHERWISE         :
  2346.                     LENGTH.N = NUMVAL(SUBSTR(TYPE.A,2,3)) + 3
  2347.                     ACCEPT.V = DEFAULT.V
  2348.             ENDSWITCH                        ; Are we beyond 80 column screen width?
  2349.             IF LENGTH.N + LEN(PROMPT.A) > 69 THEN
  2350.                 LENGTH.N = 69 - LEN(PROMPT.A)
  2351.                 SPOT.N = 1
  2352.             ENDIF
  2353.             WIDTH.N = MIN(74,MAX(32,MAX(LEN(TITLE.A)+10,LENGTH.N+LEN(PROMPT.A)+5)))
  2354.             IF NOT ISASSIGNED(SPOT.N) THEN   ; Calculate starting spot if needed
  2355.                 SPOT.N = INT((WIDTH.N - 3 - LENGTH.N - LEN(PROMPT.A))/2)
  2356.             ENDIF
  2357.             IF ISBLANK(PICTURE.A) THEN       ; Set "global" Picture if none passed
  2358.                 IF TYPE.A = "D" THEN          ; Dates are tricky!
  2359.                     PICTURE.A = "{"+STRVAL(MONTH(TODAY()))+",#[#]}"+"/"+
  2360.                     "{"+STRVAL(DAY(TODAY()))+",#[#]}"+"/"+
  2361.                     "{"+SUBSTR(STRVAL(YEAR(TODAY())),3,2)+",#[#[#[#]]]}"
  2362.                 ELSE
  2363.                     PICTURE.A = "*@"
  2364.                 ENDIF
  2365.             ENDIF
  2366.             TOP.N = IIF(TOP.N = 999, INT((G.SYSINFO.Y["ScreenHeight"]-8)/2), TOP.N)
  2367.             TOP.N = IIF(TOP.N < 0 OR TOP.N > G.SYSINFO.Y["ScreenHeight"]-8, 8, TOP.N)
  2368.             LEFT.N = IIF(LEFT.N = 999 OR LEFT.N < 0 OR
  2369.             LEFT.N > G.SYSINFO.Y["ScreenWidth"]-WIDTH.N-3,
  2370.             INT((G.SYSINFO.Y["ScreenWidth"]-WIDTH.N)/2), LEFT.N)
  2371.             IF HIDDEN.L THEN
  2372.                 ACCEPT.V = IOACCEPTDIALOGHIDDEN.V(TOP.N, LEFT.N, TITLE.A,
  2373.                 PROMPT.A, TYPE.A, PICTURE.A,
  2374.                 WIDTH.N, SPOT.N, "CANCEL")
  2375.             ELSE
  2376.                 ACCEPT.V = IOACCEPTDIALOGVALUE.V(TOP.N, LEFT.N, TITLE.A,
  2377.                 PROMPT.A, TYPE.A, PICTURE.A,
  2378.                 WIDTH.N, SPOT.N, "CANCEL")
  2379.             ENDIF
  2380.         ENDIF
  2381.         SETCOLORS FROM G.APPCOLORS.Y
  2382.     ENDIF
  2383.     RETURN ACCEPT.V                     ; Return entered value or FALSE
  2384. ENDPROC
  2385. WRITELIB LIBNAME IOACCEPTDIALOG.V
  2386. RELEASE VARS IOACCEPTDIALOG.V
  2387. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "ioAcceptDialog.v")
  2388.  
  2389.  
  2390. ; ============================================================================
  2391. ;       TITLE: msConfirm!.l             (c) 1991 - 1993 DataStar International
  2392. ;     RETURNS: Logical true/false if User Confirmed/Canceled
  2393. ; DESCRIPTION: Generic Continue-or-Cancel Message routine
  2394. ;                 Alert 0 = No sound
  2395. ;                 Alert 1 = Three beeps
  2396. ;                 Alert 2 = Siren, short (high-low-high-low-high)
  2397. ;                 Alert 3 = Two beeps, continuous
  2398. ;                 Alert 4 = Two high beeps, two low beeps, continuous
  2399. ;                 Alert 5 = Siren, continuous
  2400. ; ----------------------------------------------------------------------------
  2401. PROC MSCONFIRM!.L(               ; Confirmation DialogBox
  2402.     TITLE.A,                ; Title for Dialog Box, or "" for Default
  2403.     MESSAGE.A,              ; Message to display (< 70 chars)
  2404.     MSGCOLOR.N,             ; Color for message (not DialogBox!)
  2405.     DBOXPALETTE.A,          ; Palette name for custom dBox window colors
  2406.     ALERT.N,                ; Sound level of Alert (0 - 4)
  2407.     OKLABEL.A,              ; Label of CONTINUE Pushbutton
  2408.     CXLABEL.A,              ; Label of CANCEL Pushbutton
  2409.     CONFIRM.L)              ; Should Confirm be default?
  2410.     PRIVATE  WIDTH.N,                ; Width of Dialog Box
  2411.     A1, A2,                 ; Match variables
  2412.     N1, N2,                 ; Button length comparisons
  2413.     BUTTONLENGTH.N,         ; Width of Pushbuttons
  2414.     BUTTON.L,               ; Value of selected Pushbutton
  2415.     ONCEFLAG.L,             ; True = Non-continuous Alert
  2416.     ICON.A,
  2417.     FRAMEHIGH.N,
  2418.     FRAMELOW.N
  2419.     ;Global  g.appcolors.y           ; Global Application Colors
  2420.     ;        g.sysinfo.y             ; Global System Information
  2421.  
  2422.     SETCANVAS DEFAULT
  2423.     IF NOT ISASSIGNED(G.SYSINFO.Y) THEN
  2424.         SYSINFO TO G.SYSINFO.Y
  2425.     ENDIF
  2426.  
  2427.     IF LEN(MESSAGE.A) = 1 THEN
  2428.         ICON.A = MSICON.A(MESSAGE.A)
  2429.         MESSAGE.A = MSSHORTCUTS.A(MESSAGE.A)
  2430.     ELSE
  2431.         IF ALERT.N > 3 THEN
  2432.             ICON.A = MSICON.A("!")
  2433.         ELSE
  2434.             ICON.A = MSICON.A("?")
  2435.         ENDIF
  2436.     ENDIF
  2437.  
  2438.     FRAMEHIGH.N = INATTRIBUTECONVERT.N(SYSCOLOR(1036),TRUE)
  2439.     FRAMELOW.N  = INATTRIBUTECONVERT.N(SYSCOLOR(1036),FALSE)
  2440.     ONCEFLAG.L  = ALERT.N < 3 OR ALERT.N > 50
  2441.     BUTTON.L    = FALSE
  2442.     MESSAGE.A   = MSWRAP.A(MESSAGE.A)
  2443.     TITLE.A     = IIF(TITLE.A = "", "Press <Tab> to Highlight - <Enter> to Select",
  2444.     TITLE.A)
  2445.  
  2446.     DYNARRAY DBOXPROCS.Y[]
  2447.     DBOXPROCS.Y["IDLE"] = "dbAlert.l"
  2448.  
  2449.     TOPROW.N = 7
  2450.     LEFTCOL.N = INT((G.SYSINFO.Y["ScreenWidth"]-60)/2)
  2451.  
  2452.     A1 = ""
  2453.     A2 = OKLABEL.A
  2454.     WHILE MATCH(A1+A2,"..~..",A1,A2)
  2455.     ENDWHILE
  2456.     N1 = LEN(A1+A2)
  2457.  
  2458.     A1 = ""
  2459.     A2 = CXLABEL.A
  2460.     WHILE MATCH(A1+A2,"..~..",A1,A2)
  2461.     ENDWHILE
  2462.     N2 = LEN(A1+A2)
  2463.     BUTTONLENGTH.N = MAX(N1,N2)+4
  2464.  
  2465.     SHOWDIALOG TITLE.A
  2466.         PROC "dbEventHandler.l"
  2467.         IDLE
  2468.         TRIGGER "Open"
  2469.         @ -200,-200
  2470.         HEIGHT 11 WIDTH 60
  2471.  
  2472.         FRAME FROM 0,1 TO 6,11
  2473.         PAINTCANVAS BORDER ATTRIBUTE FRAMELOW.N  0,1,6,11
  2474.         PAINTCANVAS BORDER ATTRIBUTE FRAMEHIGH.N 0,1,0,10
  2475.         PAINTCANVAS BORDER ATTRIBUTE FRAMEHIGH.N 0,1,6,1
  2476.         PAINTCANVAS FILL ICON.A ATTRIBUTE MSGCOLOR.N 1,2,5,10
  2477.  
  2478.         FRAME FROM 0,13 TO 6,56
  2479.         PAINTCANVAS BORDER ATTRIBUTE FRAMEHIGH.N 0,13,6,56
  2480.         PAINTCANVAS BORDER ATTRIBUTE FRAMELOW.N  0,13,0,55
  2481.         PAINTCANVAS BORDER ATTRIBUTE FRAMELOW.N  0,13,6,13
  2482.         PAINTCANVAS FILL MESSAGE.A ATTRIBUTE MSGCOLOR.N 1,15,5,54
  2483.  
  2484.         PUSHBUTTON  @ 7,10
  2485.             WIDTH BUTTONLENGTH.N IIF(CONFIRM.L,OKLABEL.A,CXLABEL.A)
  2486.             OK VALUE DBBUTTONPRESS.V(CONFIRM.L) TAG "BUTTON"
  2487.             TO BUTTON.L
  2488.  
  2489.         PUSHBUTTON  @ 7,48 - BUTTONLENGTH.N
  2490.             WIDTH BUTTONLENGTH.N IIF(CONFIRM.L,CXLABEL.A,OKLABEL.A)
  2491.             OK VALUE DBBUTTONPRESS.V(NOT CONFIRM.L) TAG "BUTTON"
  2492.             TO BUTTON.L
  2493.     ENDDIALOG
  2494.     MSWORKINGCLEAR.U()
  2495.     RETURN BUTTON.L
  2496. ENDPROC
  2497.  
  2498. WRITELIB LIBNAME MSCONFIRM!.L
  2499. RELEASE VARS MSCONFIRM!.L
  2500. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "msConfirm!.l")
  2501.  
  2502.  
  2503.  
  2504. ; ============================================================================
  2505. ;       TITLE: msContinue!.u            (c) 1991 - 1993 DataStar International
  2506. ;     RETURNS: No Value
  2507. ; DESCRIPTION: Generic Message and wait for a <Continue> keypress
  2508. ;                 Alert 0 = No sound
  2509. ;                 Alert 1 = Three beeps
  2510. ;                 Alert 2 = Siren, short (high-low-high-low-high)
  2511. ;                 Alert 3 = Two beeps, continuous
  2512. ;                 Alert 4 = Two high beeps, two low beeps, continuous
  2513. ;                 Alert 5 = Siren, continuous
  2514. ; ----------------------------------------------------------------------------
  2515. PROC MSCONTINUE!.U(              ; Generic Continue DialogBox
  2516.     TITLE.A,                ; Title for dBox, "" for Default
  2517.     MESSAGE.A,              ; Message to display
  2518.     MSGCOLOR.N,             ; Color for Message (not DialogBox!)
  2519.     DBOXPALETTE.A,          ; Dynarray of custom colors
  2520.     ALERT.N)                ; Sound level of Alert (0 - 5)
  2521.     PRIVATE  ICON.A,
  2522.     BUTTON.L,               ; Value of selected Pushbutton
  2523.     ONCEFLAG.L,             ; True = non-continuous alert
  2524.     FRAMEHIGH.N,
  2525.     FRAMELOW.N
  2526.     ;Global  g.appcolors.y           ; Global Application Colors
  2527.     ;        g.sysinfo.y             ; Global System Information
  2528.  
  2529.     SETCANVAS DEFAULT
  2530.     IF LEN(MESSAGE.A) = 1 THEN
  2531.         ICON.A = MSICON.A(MESSAGE.A)
  2532.         MESSAGE.A = MSSHORTCUTS.A(MESSAGE.A)
  2533.     ELSE
  2534.         IF ALERT.N > 3 THEN
  2535.             ICON.A = MSICON.A("!")
  2536.         ELSE
  2537.             ICON.A = MSICON.A("I")
  2538.         ENDIF
  2539.     ENDIF
  2540.  
  2541.     IF NOT ISASSIGNED(G.SYSINFO.Y) THEN
  2542.         SYSINFO TO G.SYSINFO.Y
  2543.     ENDIF
  2544.  
  2545.     DYNARRAY DBOXPROCS.Y[]
  2546.     DBOXPROCS.Y["IDLE"] = "dbAlert.l"
  2547.  
  2548.     FRAMEHIGH.N = INATTRIBUTECONVERT.N(SYSCOLOR(1036),TRUE)
  2549.     FRAMELOW.N  = INATTRIBUTECONVERT.N(SYSCOLOR(1036),FALSE)
  2550.     ONCEFLAG.L  = ALERT.N < 3 OR ALERT.N > 50
  2551.     MESSAGE.A   = MSWRAP.A(MESSAGE.A)
  2552.     BUTTON.L    = TRUE
  2553.     TOPROW.N    = 7
  2554.     LEFTCOL.N   = INT((G.SYSINFO.Y["ScreenWidth"]-60)/2)
  2555.     TITLE.A     = IIF(TITLE.A = "", "Press <Enter> to Continue", TITLE.A)
  2556.  
  2557.     SHOWDIALOG TITLE.A
  2558.         PROC "dbEventHandler.l"
  2559.         IDLE TRIGGER "OPEN"    ; Wait for Key Alert
  2560.         @ -200,-200
  2561.         HEIGHT 11 WIDTH 60
  2562.  
  2563.         FRAME FROM 0,1 TO 6,11
  2564.         PAINTCANVAS BORDER ATTRIBUTE FRAMELOW.N  0,1,6,11
  2565.         PAINTCANVAS BORDER ATTRIBUTE FRAMEHIGH.N 0,1,0,10
  2566.         PAINTCANVAS BORDER ATTRIBUTE FRAMEHIGH.N 0,1,6,1
  2567.         PAINTCANVAS FILL ICON.A
  2568.         ATTRIBUTE MSGCOLOR.N 1,2,5,10
  2569.  
  2570.         FRAME FROM 0,13 TO 6,56
  2571.         PAINTCANVAS BORDER ATTRIBUTE FRAMEHIGH.N 0,13,6,56
  2572.         PAINTCANVAS BORDER ATTRIBUTE FRAMELOW.N  0,13,0,55
  2573.         PAINTCANVAS BORDER ATTRIBUTE FRAMELOW.N  0,13,6,13
  2574.         PAINTCANVAS FILL MESSAGE.A
  2575.         ATTRIBUTE MSGCOLOR.N 1,15,5,54
  2576.  
  2577.         PUSHBUTTON @ 7,23
  2578.             WIDTH 12 "~C~ontinue"
  2579.             OK DEFAULT VALUE DBBUTTONPRESS.V(TRUE) TAG "OK"
  2580.             TO BUTTON.L
  2581.     ENDDIALOG
  2582.     MSWORKINGCLEAR.U()
  2583.     RETURN
  2584. ENDPROC
  2585. WRITELIB LIBNAME MSCONTINUE!.U
  2586. RELEASE VARS MSCONTINUE!.U
  2587. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "msContinue!.u")
  2588.  
  2589.  
  2590.  
  2591.  
  2592. ; ============================================================================
  2593. ;       TITLE: dbEventHandler.l         (c) 1991 - 1993 DataStar International
  2594. ;     RETURNS: Logical true/false id dBox accepted
  2595. ; DESCRIPTION: Generic Dialog Box Event Handler
  2596. ; ----------------------------------------------------------------------------
  2597. PROC DBEVENTHANDLER.L(           ; Alert Siren in Idle Dialog Box
  2598.     TYPE.A,                 ; EVENT, or TRIGGER Name
  2599.     TAG.A,                  ; Control element tag or null
  2600.     EVENT.V,                ; DynArray of GetEvent, or control value
  2601.     ELEMENT.A)              ; Checkbox label or null
  2602.     PRIVATE  H,                      ; Transient window handle
  2603.     Y,                      ; Transient window attributes dynarray
  2604.     RETVAL.L,               ; Value to return
  2605.     DBOXCOLORS.Y,           ; Custom Dialog Box Color Palette
  2606.     PROCTAG.A               ; Trigger name, or event type
  2607.     ;Global  alert.n                 ; Alert Value from dBox (0 - 5)
  2608.     ;        onceflag.l              ; For non-continuous Alert (1, 2)
  2609.     ;        dboxpalette.a           ; Palette name for custom colors
  2610.     ;        starticks.n             ; Starting Ticks, if assigned, enables timeout
  2611.     ;        frametag.a              ; Can be used by calling proc to paint frame
  2612.     RETVAL.L = TRUE
  2613.     SWITCH
  2614.         CASE TYPE.A = "OPEN" :
  2615.             IF ISASSIGNED(DBOXPROCS.Y["OPEN"]) THEN
  2616.                 EXECPROC DBOXPROCS.Y["OPEN"]
  2617.                 RETVAL.L = RETVAL
  2618.             ELSE
  2619.                 WINDOW HANDLE DIALOG TO H
  2620.                 DYNARRAY Y[]
  2621.                 Y["OriginRow"] = TOPROW.N
  2622.                 Y["OriginCol"] = LEFTCOL.N
  2623.                 IF ISASSIGNED(DBOXPALETTE.A) AND NOT ISBLANK(DBOXPALETTE.A) THEN
  2624.                     DBPALETTESET.U(DBOXPALETTE.A)
  2625.                     WINDOW SETCOLORS H FROM DBOXCOLORS.Y
  2626.                     REPAINTDIALOG
  2627.                 ENDIF
  2628.                 WINDOW SETATTRIBUTES H FROM Y
  2629.             ENDIF
  2630.         CASE TYPE.A = "IDLE" :
  2631.             IF ISASSIGNED(DBOXPROCS.Y["IDLE"]) THEN
  2632.                 EXECPROC DBOXPROCS.Y["IDLE"]
  2633.                 RETVAL.L = RETVAL
  2634.             ELSE
  2635.                 IF ISASSIGNED(STARTICKS.N) AND TICKS() > STARTICKS.N + 600000 THEN
  2636.                     CANCELDIALOG
  2637.                 ENDIF
  2638.             ENDIF
  2639.         OTHERWISE :
  2640.             PROCTAG.A = IIF(TYPE.A = "EVENT",EVENT.V["Type"],TYPE.A)
  2641.             IF ISASSIGNED(DBOXPROCS.Y[proctag.a]) THEN
  2642.                 EXECPROC DBOXPROCS.Y[proctag.a]
  2643.                 RETVAL.L = RETVAL
  2644.             ENDIF
  2645.     ENDSWITCH
  2646.     FRAMETAG.A = TAG.A
  2647.     REPAINTDIALOG
  2648.     RETURN RETVAL.L
  2649. ENDPROC
  2650. WRITELIB LIBNAME DBEVENTHANDLER.L
  2651. RELEASE VARS DBEVENTHANDLER.L
  2652. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "dbEventHandler.l")
  2653.  
  2654.  
  2655.  
  2656. ; ============================================================================
  2657. ;       TITLE: dbAlert.l                (c) 1991 - 1993 DataStar International
  2658. ;     RETURNS: True, for dBox Event Handler
  2659. ; DESCRIPTION: Dialog Event Handler proc for IDLE event Alerts
  2660. ; ----------------------------------------------------------------------------
  2661. PROC DBALERT.L()                 ; Idle Alert called from Event Handler
  2662.     PRIVATE  N1, N2                  ; Transient loop counter
  2663.     ;Global  alert.n                 ; Alert Value from dBox (0 - 5)
  2664.     ;        onceflag.l              ; For non-continuous Alert (1, 2)
  2665.     IF NOT ISASSIGNED(ONCEFLAG.L) THEN
  2666.         ONCEFLAG.L = TRUE
  2667.     ENDIF
  2668.     SWITCH
  2669.         CASE ALERT.N = 1 AND ONCEFLAG.L :
  2670.             BEEP SLEEP 50
  2671.             BEEP SLEEP 50
  2672.             BEEP
  2673.             ONCEFLAG.L = FALSE            ; Turns off subsequent Alerts
  2674.         CASE ALERT.N = 2 AND ONCEFLAG.L :
  2675.             SOUND 770 150
  2676.             SOUND 440 150
  2677.             SOUND 770 150
  2678.             SOUND 440 150
  2679.             SOUND 770 150
  2680.             ONCEFLAG.L = FALSE            ; Turns off subsequent Alerts
  2681.         CASE ALERT.N = 3  :
  2682.             BEEP SLEEP 50 BEEP SLEEP 1000
  2683.         CASE ALERT.N = 4  :
  2684.             SOUND 300 50 SLEEP 100
  2685.             SOUND 300 50 SLEEP 100
  2686.             SOUND 150 50 SLEEP 100
  2687.             SOUND 150 50 SLEEP 100
  2688.             SLEEP 200
  2689.         CASE ALERT.N = 5  :
  2690.             SOUND 770 150
  2691.             SOUND 440 150
  2692.         CASE ALERT.N = 86 AND ONCEFLAG.L :
  2693.             FOR N1 FROM 4 TO 0 STEP -1
  2694.                 FOR N2 FROM 11 TO 0 STEP -1
  2695.                     SOUND INT(POW(2,N1+N2/12)*110) 5
  2696.                 ENDFOR
  2697.             ENDFOR
  2698.             SOUND 10 3000
  2699.             ONCEFLAG.L = FALSE            ; Turns off subsequent Alerts
  2700.     ENDSWITCH
  2701.     RETURN TRUE
  2702. ENDPROC
  2703. WRITELIB LIBNAME DBALERT.L
  2704. RELEASE VARS DBALERT.L
  2705. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "dbAlert.l")
  2706.  
  2707.  
  2708.  
  2709.  
  2710. ; ============================================================================
  2711. ;       TITLE: dbButtonPress.v          (c) 1991 - 1993 DataStar International
  2712. ;     RETURNS: Whatever value is passed as parameter
  2713. ; DESCRIPTION: Adds 300 millisecond delay to PushButton press
  2714. ; ----------------------------------------------------------------------------
  2715. PROC DBBUTTONPRESS.V(            ; Adds 300 ms delay to button press
  2716.     RETVAL.V)               ; Value to assign to Pushbutton variable
  2717.     SLEEP 300
  2718.     RETURN RETVAL.V
  2719. ENDPROC
  2720. WRITELIB LIBNAME DBBUTTONPRESS.V
  2721. RELEASE VARS DBBUTTONPRESS.V
  2722. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "dbButtonPress.v")
  2723.  
  2724.  
  2725.  
  2726.  
  2727.  
  2728. ; ============================================================================
  2729. ;       TITLE: dbPaletteSet.u           (c) 1991 - 1993 DataStar International
  2730. ;     RETURNS: No value (sets local global dynarray:  dboxcolors.y)
  2731. ; DESCRIPTION: Creates a dynarray of dialog box colors based upon palette.a
  2732. ; ----------------------------------------------------------------------------
  2733. PROC DBPALETTESET.U(             ; Creates Palette for Dialog Boxes
  2734.     PALETTE.A)
  2735.     ;Global  dboxcolors.y
  2736.     DYNARRAY DBOXCOLORS.Y[]
  2737.     SWITCH
  2738.         CASE UPPER(PALETTE.A) = "BLUE" :
  2739.             DBOXCOLORS.Y["1"]  = 27   ; Active dialog box frame and title
  2740.             DBOXCOLORS.Y["2"]  = 26   ; Selected dialog box frame when dragging
  2741.             DBOXCOLORS.Y["3"]  = 48   ; Scroll bar
  2742.             DBOXCOLORS.Y["4"]  = 63   ; Scroll bar controls
  2743.             DBOXCOLORS.Y["5"]  = 31   ; Default background text
  2744.             DBOXCOLORS.Y["6"]  = 23   ; Label when linked control is inactive
  2745.             DBOXCOLORS.Y["7"]  = 31   ; Label when linked control is active
  2746.             DBOXCOLORS.Y["8"]  = 30   ; Label hot key
  2747.             DBOXCOLORS.Y["9"]  = 48   ; Text for normal   push button label
  2748.             DBOXCOLORS.Y["10"] = 59   ; Text for default  push button label
  2749.             DBOXCOLORS.Y["11"] = 63   ; Text for selected push button label
  2750.             DBOXCOLORS.Y["13"] = 62   ; Hot key for push button label
  2751.             DBOXCOLORS.Y["14"] = 16   ; Button shadow
  2752.             DBOXCOLORS.Y["16"] = 27   ; Normal      radio button / check box
  2753.             DBOXCOLORS.Y["16"] = 31   ; Highlighted radio button / check box
  2754.             DBOXCOLORS.Y["17"] = 30   ; Hot key for radio button / check box
  2755.             DBOXCOLORS.Y["18"] = 63   ; Normal   typein box text
  2756.             DBOXCOLORS.Y["19"] = 47   ; Selected typein box text
  2757.             DBOXCOLORS.Y["20"] = 49   ; Typein box arrows
  2758.             DBOXCOLORS.Y["25"] = 48   ; Normal   pick list item text
  2759.             DBOXCOLORS.Y["26"] = 47   ; Selected text when pick list is active
  2760.             DBOXCOLORS.Y["27"] = 63   ; Selected text when pick list is inactive
  2761.             DBOXCOLORS.Y["28"] = 49   ; Column dividers
  2762.             FRAMEHIGH.N        = 25   ; Frame highlight (sunny side)
  2763.             FRAMELOW.N         = 16   ; Frame lowlight (shadow side)
  2764.         CASE UPPER(PALETTE.A) = "RED" :
  2765.             DBOXCOLORS.Y["1"]  = 79   ; Active dialog box frame and title
  2766.             DBOXCOLORS.Y["2"]  = 75   ; Selected dialog box frame when dragging
  2767.             DBOXCOLORS.Y["3"]  = 112  ; Scroll bar
  2768.             DBOXCOLORS.Y["4"]  = 127  ; Scroll bar controls
  2769.             DBOXCOLORS.Y["5"]  = 71   ; Default background text
  2770.             DBOXCOLORS.Y["6"]  = 65   ; Label when linked control is inactive
  2771.             DBOXCOLORS.Y["7"]  = 79   ; Label when linked control is active
  2772.             DBOXCOLORS.Y["8"]  = 78   ; Label hot key
  2773.             DBOXCOLORS.Y["9"]  = 112  ; Text for normal   push button label
  2774.             DBOXCOLORS.Y["10"] = 116  ; Text for default  push button label
  2775.             DBOXCOLORS.Y["11"] = 127  ; Text for selected push button label
  2776.             DBOXCOLORS.Y["13"] = 126  ; Hot key for push button label
  2777.             DBOXCOLORS.Y["14"] = 64   ; Button shadow
  2778.             DBOXCOLORS.Y["16"] = 71   ; Normal      radio button / check box
  2779.             DBOXCOLORS.Y["16"] = 79   ; Highlighted radio button / check box
  2780.             DBOXCOLORS.Y["17"] = 78   ; Hot key for radio button / check box
  2781.             DBOXCOLORS.Y["18"] = 31   ; Normal   typein box text
  2782.             DBOXCOLORS.Y["19"] = 47   ; Selected typein box text
  2783.             DBOXCOLORS.Y["20"] = 27   ; Typein box arrows
  2784.             DBOXCOLORS.Y["25"] = 112  ; Normal   pick list item text
  2785.             DBOXCOLORS.Y["26"] = 31   ; Selected text when pick list is active
  2786.             DBOXCOLORS.Y["27"] = 127  ; Selected text when pick list is inactive
  2787.             DBOXCOLORS.Y["28"] = 116  ; Column dividers
  2788.             FRAMEHIGH.N        = 76   ; Frame highlight (sunny side)
  2789.             FRAMELOW.N         = 64   ; Frame lowlight (shadow side)
  2790.         CASE UPPER(PALETTE.A) = "CYAN" :
  2791.             DBOXCOLORS.Y["1"]  = 63   ; Active dialog box frame and title
  2792.             DBOXCOLORS.Y["2"]  = 59   ; Selected dialog box frame when dragging
  2793.             DBOXCOLORS.Y["3"]  = 23   ; Scroll bar
  2794.             DBOXCOLORS.Y["4"]  = 31   ; Scroll bar controls
  2795.             DBOXCOLORS.Y["5"]  = 49   ; Default background text
  2796.             DBOXCOLORS.Y["6"]  = 48   ; Label when linked control is inactive
  2797.             DBOXCOLORS.Y["7"]  = 63   ; Label when linked control is active
  2798.             DBOXCOLORS.Y["8"]  = 62   ; Label hot key
  2799.             DBOXCOLORS.Y["9"]  = 27   ; Text for normal   push button label
  2800.             DBOXCOLORS.Y["10"] = 29   ; Text for default  push button label
  2801.             DBOXCOLORS.Y["11"] = 31   ; Text for selected push button label
  2802.             DBOXCOLORS.Y["13"] = 30   ; Hot key for push button label
  2803.             DBOXCOLORS.Y["14"] = 48   ; Button shadow
  2804.             DBOXCOLORS.Y["16"] = 49   ; Normal      radio button / check box
  2805.             DBOXCOLORS.Y["16"] = 63   ; Highlighted radio button / check box
  2806.             DBOXCOLORS.Y["17"] = 62   ; Hot key for radio button / check box
  2807.             DBOXCOLORS.Y["18"] = 31   ; Normal   typein box text
  2808.             DBOXCOLORS.Y["19"] = 47   ; Selected typein box text
  2809.             DBOXCOLORS.Y["20"] = 27   ; Typein box arrows
  2810.             DBOXCOLORS.Y["25"] = 112  ; Normal   pick list item text
  2811.             DBOXCOLORS.Y["26"] = 31   ; Selected text when pick list is active
  2812.             DBOXCOLORS.Y["27"] = 127  ; Selected text when pick list is inactive
  2813.             DBOXCOLORS.Y["28"] = 115  ; Column dividers
  2814.             FRAMEHIGH.N        = 59   ; Frame highlight (sunny side)
  2815.             FRAMELOW.N         = 48   ; Frame lowlight (shadow side)
  2816.         CASE UPPER(PALETTE.A) = "GREEN" :
  2817.             DBOXCOLORS.Y["1"]  = 47   ; Active dialog box frame and title
  2818.             DBOXCOLORS.Y["2"]  = 43   ; Selected dialog box frame when dragging
  2819.             DBOXCOLORS.Y["3"]  = 96   ; Scroll bar
  2820.             DBOXCOLORS.Y["4"]  = 111  ; Scroll bar controls
  2821.             DBOXCOLORS.Y["5"]  = 32   ; Default background text
  2822.             DBOXCOLORS.Y["6"]  = 42   ; Label when linked control is inactive
  2823.             DBOXCOLORS.Y["7"]  = 47   ; Label when linked control is active
  2824.             DBOXCOLORS.Y["8"]  = 46   ; Label hot key
  2825.             DBOXCOLORS.Y["9"]  = 27   ; Text for normal   push button label
  2826.             DBOXCOLORS.Y["10"] = 29   ; Text for default  push button label
  2827.             DBOXCOLORS.Y["11"] = 31   ; Text for selected push button label
  2828.             DBOXCOLORS.Y["13"] = 30   ; Hot key for push button label
  2829.             DBOXCOLORS.Y["14"] = 32   ; Button shadow
  2830.             DBOXCOLORS.Y["16"] = 33   ; Normal      radio button / check box
  2831.             DBOXCOLORS.Y["16"] = 47   ; Highlighted radio button / check box
  2832.             DBOXCOLORS.Y["17"] = 46   ; Hot key for radio button / check box
  2833.             DBOXCOLORS.Y["18"] = 112  ; Normal   typein box text
  2834.             DBOXCOLORS.Y["19"] = 31   ; Selected typein box text
  2835.             DBOXCOLORS.Y["20"] = 114  ; Typein box arrows
  2836.             DBOXCOLORS.Y["25"] = 112  ; Normal   pick list item text
  2837.             DBOXCOLORS.Y["26"] = 31   ; Selected text when pick list is active
  2838.             DBOXCOLORS.Y["27"] = 127  ; Selected text when pick list is inactive
  2839.             DBOXCOLORS.Y["28"] = 114  ; Column dividers
  2840.             FRAMEHIGH.N        = 42   ; Frame highlight (sunny side)
  2841.             FRAMELOW.N         = 32   ; Frame lowlight (shadow side)
  2842.         CASE UPPER(PALETTE.A) = "BROWN" :
  2843.             DBOXCOLORS.Y["1"]  = 111  ; Active dialog box frame and title
  2844.             DBOXCOLORS.Y["2"]  = 107  ; Selected dialog box frame when dragging
  2845.             DBOXCOLORS.Y["3"]  = 112  ; Scroll bar
  2846.             DBOXCOLORS.Y["4"]  = 127  ; Scroll bar controls
  2847.             DBOXCOLORS.Y["5"]  = 96   ; Default background text
  2848.             DBOXCOLORS.Y["6"]  = 97   ; Label when linked control is inactive
  2849.             DBOXCOLORS.Y["7"]  = 111  ; Label when linked control is active
  2850.             DBOXCOLORS.Y["8"]  = 110  ; Label hot key
  2851.             DBOXCOLORS.Y["9"]  = 27   ; Text for normal   push button label
  2852.             DBOXCOLORS.Y["10"] = 29   ; Text for default  push button label
  2853.             DBOXCOLORS.Y["11"] = 31   ; Text for selected push button label
  2854.             DBOXCOLORS.Y["13"] = 30   ; Hot key for push button label
  2855.             DBOXCOLORS.Y["14"] = 96   ; Button shadow
  2856.             DBOXCOLORS.Y["16"] = 97   ; Normal      radio button / check box
  2857.             DBOXCOLORS.Y["16"] = 111  ; Highlighted radio button / check box
  2858.             DBOXCOLORS.Y["17"] = 110  ; Hot key for radio button / check box
  2859.             DBOXCOLORS.Y["18"] = 112  ; Normal   typein box text
  2860.             DBOXCOLORS.Y["19"] = 47   ; Selected typein box text
  2861.             DBOXCOLORS.Y["20"] = 118  ; Typein box arrows
  2862.             DBOXCOLORS.Y["25"] = 112  ; Normal   pick list item text
  2863.             DBOXCOLORS.Y["26"] = 47   ; Selected text when pick list is active
  2864.             DBOXCOLORS.Y["27"] = 127  ; Selected text when pick list is inactive
  2865.             DBOXCOLORS.Y["28"] = 118  ; Column dividers
  2866.             FRAMEHIGH.N        = 110  ; Frame highlight (sunny side)
  2867.             FRAMELOW.N         = 96   ; Frame lowlight (shadow side)
  2868.         CASE UPPER(PALETTE.A) = "MAGENTA" :
  2869.             DBOXCOLORS.Y["1"]  = 95   ; Active dialog box frame and title
  2870.             DBOXCOLORS.Y["2"]  = 91   ; Selected dialog box frame when dragging
  2871.             DBOXCOLORS.Y["3"]  = 23   ; Scroll bar
  2872.             DBOXCOLORS.Y["4"]  = 31   ; Scroll bar controls
  2873.             DBOXCOLORS.Y["5"]  = 80   ; Default background text
  2874.             DBOXCOLORS.Y["6"]  = 81   ; Label when linked control is inactive
  2875.             DBOXCOLORS.Y["7"]  = 95   ; Label when linked control is active
  2876.             DBOXCOLORS.Y["8"]  = 94   ; Label hot key
  2877.             DBOXCOLORS.Y["9"]  = 27   ; Text for normal   push button label
  2878.             DBOXCOLORS.Y["10"] = 29   ; Text for default  push button label
  2879.             DBOXCOLORS.Y["11"] = 31   ; Text for selected push button label
  2880.             DBOXCOLORS.Y["13"] = 30   ; Hot key for push button label
  2881.             DBOXCOLORS.Y["14"] = 80   ; Button shadow
  2882.             DBOXCOLORS.Y["16"] = 81   ; Normal      radio button / check box
  2883.             DBOXCOLORS.Y["16"] = 95   ; Highlighted radio button / check box
  2884.             DBOXCOLORS.Y["17"] = 94   ; Hot key for radio button / check box
  2885.             DBOXCOLORS.Y["18"] = 112  ; Normal   typein box text
  2886.             DBOXCOLORS.Y["19"] = 31   ; Selected typein box text
  2887.             DBOXCOLORS.Y["20"] = 113  ; Typein box arrows
  2888.             DBOXCOLORS.Y["25"] = 112  ; Normal   pick list item text
  2889.             DBOXCOLORS.Y["26"] = 31   ; Selected text when pick list is active
  2890.             DBOXCOLORS.Y["27"] = 127  ; Selected text when pick list is inactive
  2891.             DBOXCOLORS.Y["28"] = 117  ; Column dividers
  2892.             FRAMEHIGH.N        = 93   ; Frame highlight (sunny side)
  2893.             FRAMELOW.N         = 80   ; Frame lowlight (shadow side)
  2894.         CASE UPPER(PALETTE.A) = "GRAY" :
  2895.             DBOXCOLORS.Y["1"]  = 127  ; Active dialog box frame and title
  2896.             DBOXCOLORS.Y["2"]  = 123  ; Selected dialog box frame when dragging
  2897.             DBOXCOLORS.Y["3"]  = 19   ; Scroll bar
  2898.             DBOXCOLORS.Y["4"]  = 27   ; Scroll bar controls
  2899.             DBOXCOLORS.Y["5"]  = 112  ; Default background text
  2900.             DBOXCOLORS.Y["6"]  = 113  ; Label when linked control is inactive
  2901.             DBOXCOLORS.Y["7"]  = 127  ; Label when linked control is active
  2902.             DBOXCOLORS.Y["8"]  = 126  ; Label hot key
  2903.             DBOXCOLORS.Y["9"]  = 32   ; Text for normal   push button label
  2904.             DBOXCOLORS.Y["10"] = 43   ; Text for default  push button label
  2905.             DBOXCOLORS.Y["11"] = 47   ; Text for selected push button label
  2906.             DBOXCOLORS.Y["13"] = 46   ; Hot key for push button label
  2907.             DBOXCOLORS.Y["14"] = 112  ; Button shadow
  2908.             DBOXCOLORS.Y["16"] = 112  ; Normal      radio button / check box
  2909.             DBOXCOLORS.Y["16"] = 127  ; Highlighted radio button / check box
  2910.             DBOXCOLORS.Y["17"] = 126  ; Hot key for radio button / check box
  2911.             DBOXCOLORS.Y["18"] = 31   ; Normal   typein box text
  2912.             DBOXCOLORS.Y["19"] = 47   ; Selected typein box text
  2913.             DBOXCOLORS.Y["20"] = 26   ; Typein box arrows
  2914.             DBOXCOLORS.Y["25"] = 48   ; Normal   pick list item text
  2915.             DBOXCOLORS.Y["26"] = 47   ; Selected text when pick list is active
  2916.             DBOXCOLORS.Y["27"] = 63   ; Selected text when pick list is inactive
  2917.             DBOXCOLORS.Y["28"] = 55   ; Column dividers
  2918.             FRAMEHIGH.N        = 127  ; Frame highlight (sunny side)
  2919.             FRAMELOW.N         = 112  ; Frame lowlight (shadow side)
  2920.     ENDSWITCH
  2921.     RETURN
  2922. ENDPROC
  2923. WRITELIB LIBNAME DBPALETTESET.U
  2924. RELEASE VARS DBPALETTESET.U
  2925. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "dbPaletteSet.u")
  2926.  
  2927.  
  2928.  
  2929.  
  2930. ; ============================================================================
  2931. ;       TITLE: msWrap.a                 (c) 1991 - 1993 DataStar International
  2932. ;     RETURNS: Formatted 200 char message
  2933. ; DESCRIPTION: Formats message for dBox message routines
  2934. ; ----------------------------------------------------------------------------
  2935. PROC MSWRAP.A(                   ; Formats message for dBox
  2936.     MESSAGE.A)              ; Message to format
  2937.     PRIVATE  N1,
  2938.     N2,
  2939.     N3
  2940.     IF LEN(MESSAGE.A) < 41 THEN
  2941.         MESSAGE.A = SPACES(80) + FORMAT("w40,ac",MESSAGE.A) + SPACES(80)
  2942.     ELSE
  2943.         IF LEN(MESSAGE.A) < 121 THEN
  2944.             MESSAGE.A = SPACES(40) + MESSAGE.A
  2945.         ENDIF
  2946.         FOR N1 FROM 40 TO 160 STEP 40
  2947.             N2 = N1 + 1
  2948.             WHILE SUBSTR(MESSAGE.A, N2, 1) <> " "
  2949.                 N2 = N2 - 1
  2950.             ENDWHILE
  2951.             N3 = N2 + 1
  2952.             WHILE SUBSTR(MESSAGE.A, N3, 1) = " "
  2953.                 N3 = N3 + 1
  2954.             ENDWHILE
  2955.             MESSAGE.A = FORMAT("w"+STRVAL(N1),SUBSTR(MESSAGE.A,1,N2-1)) +
  2956.             FORMAT("w"+STRVAL(200-N1),SUBSTR(MESSAGE.A,N3,200))
  2957.         ENDFOR
  2958.     ENDIF
  2959.     RETURN MESSAGE.A
  2960. ENDPROC
  2961. WRITELIB LIBNAME MSWRAP.A
  2962. RELEASE VARS MSWRAP.A
  2963. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "msWrap.a")
  2964.  
  2965.  
  2966.  
  2967. ; ============================================================================
  2968. ;       TITLE: inAttributeConvert.n     (c) 1991 - 1993 DataStar International
  2969. ;     RETURNS: Color attribute
  2970. ; DESCRIPTION: Returns either the intense foreground of a background color if
  2971. ;              highlight.l = true, else black on background color.
  2972. ; ----------------------------------------------------------------------------
  2973. PROC INATTRIBUTECONVERT.N(       ; Converts color into highlight or lowlight
  2974.     COLOR.N,                ; Background color
  2975.     HIGHLIGHT.L)            ; True=highlight, false=lowlight
  2976.     RETURN (INT(COLOR.N/16)*16) + IIF(HIGHLIGHT.L,INT(COLOR.N/16)+8,0)
  2977. ENDPROC
  2978. WRITELIB LIBNAME INATTRIBUTECONVERT.N
  2979. RELEASE VARS INATTRIBUTECONVERT.N
  2980. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "InAttributeConvert.n")
  2981.  
  2982.  
  2983. ; ============================================================================
  2984. ;       TITLE: msShortcuts.a            (c) 1991 - 1993 DataStar International
  2985. ;     RETURNS: Expanded Message Value
  2986. ; DESCRIPTION: Shortcuts for Generic Information Messages
  2987. ; ----------------------------------------------------------------------------
  2988. PROC MSSHORTCUTS.A(              ; Shortcuts for Messages
  2989.     MESSAGE.A)              ; Message Code
  2990.     SWITCH                                 ; shortcuts
  2991.         CASE MESSAGE.A = "C" : MESSAGE.A = "Operation Canceled - Returning"
  2992.         CASE MESSAGE.A = "M" : MESSAGE.A = "One Moment - Returning to MENU"
  2993.         CASE MESSAGE.A = "P" : MESSAGE.A = "P R I N T I N G  -  This will take a few moments"
  2994.         CASE MESSAGE.A = "Q" : MESSAGE.A = "Q U E R Y I N G  -  This will take a few moments"
  2995.         CASE MESSAGE.A = "R" : MESSAGE.A = "Report NOT Printed - Returning"
  2996.         CASE MESSAGE.A = "W" : MESSAGE.A = "W O R K I N G  -  One Moment"
  2997.         CASE MESSAGE.A = "K" : MESSAGE.A = "Key Violation!  Do You Want to Overwrite the Existing Record?"
  2998.         CASE MESSAGE.A = "A" : MESSAGE.A = "A R E   Y O U   S U R E ?"
  2999.         CASE MESSAGE.A = "U" : MESSAGE.A = "Unable to Lock Necessary Tables, Please Try Later"
  3000.         CASE MESSAGE.A = "N" : MESSAGE.A = "The Printer is NOT Responding!  Please fix Printer, or Cancel Report"
  3001.         CASE MESSAGE.A = "D" : MESSAGE.A = "Do You Want to DELETE This Record?"
  3002.         OTHERWISE            : MESSAGE.A = "DataStar International"
  3003.     ENDSWITCH
  3004.     RETURN MESSAGE.A
  3005. ENDPROC
  3006.  
  3007. WRITELIB LIBNAME MSSHORTCUTS.A
  3008. RELEASE VARS MSSHORTCUSTS.A
  3009. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "msShortCuts.a")
  3010.  
  3011.  
  3012.  
  3013. ; ============================================================================
  3014. ;       TITLE: msIcon.a                 (c) 1991 - 1993 DataStar International
  3015. ;     RETURNS: String containing message box icon
  3016. ; DESCRIPTION: Assigns Icon based upon icon code
  3017. ; ----------------------------------------------------------------------------
  3018. PROC MSICON.A(                   ; Create icon for message dBoxes
  3019.     ICON.A)
  3020.     ICON.A = UPPER(ICON.A)
  3021.     SWITCH
  3022.         CASE SEARCH(ICON.A,"IWM") <> 0 :
  3023.             ICON.A = "    ▀    " +
  3024.             "   ██    " +
  3025.             "    █    " +
  3026.             "    █    " +
  3027.             "   ███   "
  3028.         CASE SEARCH(ICON.A,"DKA?") <> 0 :
  3029.             ICON.A = " █▀▀▀▀█  " +
  3030.             "      █  " +
  3031.             "    █▀▀  " +
  3032.             "    █    " +
  3033.             "    ▄    "
  3034.         CASE SEARCH(ICON.A,"!U") <> 0 :
  3035.             ICON.A = "   ▐█▌   " +
  3036.             "   ███   " +
  3037.             "   ▐█▌   " +
  3038.             "    █    " +
  3039.             "    ▄    "
  3040.         CASE SEARCH(ICON.A,"PN") <> 0 :
  3041.             ICON.A = " █████ " +
  3042.             " █████ " +
  3043.             " █████ " +
  3044.             "┌─┬─┬─┬─┐" +
  3045.             "▀███████▀"
  3046.         CASE SEARCH(ICON.A,"CR") <> 0 :
  3047.             ICON.A = " ▄     ▄ " +
  3048.             "  ▀▄ ▄▀  " +
  3049.             "   ▄▀▄   " +
  3050.             " ▄▀   ▀▄ " +
  3051.             "         "
  3052.         OTHERWISE :
  3053.             ICON.A = "    █    " +
  3054.             "  ▄█▀█▄  " +
  3055.             "▀▀█▄▀▄█▀▀" +
  3056.             "   ▀█▀   " +
  3057.             "    ▀    "
  3058.     ENDSWITCH
  3059.     RETURN ICON.A
  3060. ENDPROC
  3061. WRITELIB LIBNAME MSICON.A
  3062. RELEASE VARS MSICON.A
  3063. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "msIcon.a")
  3064.  
  3065.  
  3066.  
  3067. ; ============================================================================
  3068. ;       TITLE: quExecute.l              (c) 1991 - 1993 DataStar International
  3069. ;     RETURNS: Logical true/false IF Query successful
  3070. ; DESCRIPTION: Generic Query processor
  3071. ; ----------------------------------------------------------------------------
  3072. PROC QUEXECUTE.L(                ; Generic Query Processor
  3073.     CLEAR.L)                ; Should resultant table be cleared?
  3074.     PRIVATE  ERROR.L,                ; Error routine flag
  3075.     PROC.A,                 ; Name of current procedure
  3076.     RETVAL.L                ; Value to return
  3077.     PROC.A = "quExecute.l"
  3078.     ERROR.L = FALSE
  3079.     DO_IT!                        ; Main Errorproc checks IF Query Completes
  3080.     IF ERROR.L OR WINDOW() <> "" THEN
  3081.        ; MSCONTINUE!.U("","Query Error - " + WINDOW(),79,"RED",4)
  3082.         RETVAL.L = FALSE
  3083.         IF ISASSIGNED(G.DEBUG.L) AND G.DEBUG.L THEN
  3084.             DEBUG
  3085.         ENDIF
  3086.     ELSE
  3087.         IF CLEAR.L THEN
  3088.             CLEARIMAGE
  3089.         ENDIF
  3090.         WHILE NIMAGES() > 0
  3091.             MOVETO 1
  3092.             IF IMAGETYPE() = "Query" THEN
  3093.                 CLEARIMAGE
  3094.             ELSE
  3095.                 QUITLOOP
  3096.             ENDIF
  3097.         ENDWHILE
  3098.         RETVAL.L = TRUE
  3099.     ENDIF
  3100.     RETURN RETVAL.L
  3101. ENDPROC
  3102.  
  3103. WRITELIB LIBNAME QUEXECUTE.L
  3104. RELEASE VARS UQEXECUTE.L
  3105. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "quExecute.l")
  3106.  
  3107.  
  3108.  
  3109.  
  3110. ;══════════════════════════════════════════════════════════════════════════════
  3111. ;    PROCEDURE: wbsFillScreen()
  3112. ;    COPYRIGHT: (c) 1991-1992 Weston Brothers Software, Inc.
  3113. ;       AUTHOR: Angelo Laudon
  3114. ;  DESCRIPTION: Fills the full screen canvas with the default Paradox
  3115. ;               background character in its current color setting.
  3116. ;   PARAMETERS: N/A
  3117. ;      RETURNS: N/A
  3118. ; SPECIAL NOTE: N/A
  3119. ; used with expressed consent for CISMSG Application
  3120. ;══════════════════════════════════════════════════════════════════════════════
  3121. PROC WBSFILLSCREEN()
  3122.     PRIVATE SAVECANVAS, SYS
  3123.  
  3124.     SAVECANVAS = GETCANVAS()
  3125.  
  3126.     SETCANVAS DEFAULT
  3127.  
  3128.     SYSINFO TO SYS
  3129.  
  3130.     PAINTCANVAS FILL "░" ATTRIBUTE SYSCOLOR(1000)
  3131.     0, 0, SYS["SCREENHEIGHT"] - 1, SYS["SCREENWIDTH"] - 1
  3132.  
  3133.     ;  SETCANVAS SaveCanvas
  3134.     SETCANVAS DEFAULT
  3135.  
  3136. ENDPROC
  3137. WRITELIB LIBNAME WBSFILLSCREEN
  3138. RELEASE VARS WBSFILLSCREEN
  3139. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "wbsFillScreen")
  3140.  
  3141.  
  3142. ; ============================================================================
  3143. ;       TITLE: msProgressBar.u()        (c) 1991 - 1993 DataStar International
  3144. ;     RETURNS: No Value
  3145. ; DESCRIPTION: Displays progress bar on screen indicating to user
  3146. ;              processing messages and percent complete.
  3147. ; ----------------------------------------------------------------------------
  3148. PROC MSPROGRESSBAR.U(            ; Creates Progress Bar thermometer
  3149.     TOPROW.N,               ; Top row for Window
  3150.     LEFTCOL.N,              ; Left column for Window
  3151.     TITLE.A,                ; Title for bar
  3152.     MESSAGE.A,              ; Message, below title
  3153.     WINCOLOR.N,             ; Color of Window, includes Title
  3154.     BARCOLOR.N,             ; Color of Bar
  3155.     MSGCOLOR.N,             ; Color of Message
  3156.     PERCENTDONE.N)          ; 0 = SetUpWindow and MoveIntoPosition
  3157.     PRIVATE  Y,                      ; Throwaway Window DynArray
  3158.     OLDCANVAS.H,            ; Current Canvas
  3159.     OLDWINDOW.H             ; Current Window
  3160.     ;Global  g.sysinfo.y             ; SysInfo
  3161.     ;        g.handles.y             ; Window Handles
  3162.  
  3163.     OLDWINDOW.H = GETWINDOW()
  3164.     OLDCANVAS.H = GETCANVAS()
  3165.     IF PERCENTDONE.N = -1 THEN
  3166.         WINDOW SELECT G.HANDLES.Y["PROGRESS"]
  3167.         SETCANVAS G.HANDLES.Y["PROGRESS"]
  3168.         WINCLOSE
  3169.     ELSE
  3170.         IF NOT ISASSIGNED(G.SYSINFO.Y) THEN
  3171.             SYSINFO TO G.SYSINFO.Y
  3172.         ENDIF
  3173.  
  3174.         DYNARRAY Y[]
  3175.         Y["hasframe"] = FALSE
  3176.         Y["Style"]    = WINCOLOR.N
  3177.         Y["height"]   = 8
  3178.         Y["width"]    = 64
  3179.  
  3180.         IF NOT ISASSIGNED(G.HANDLES.Y) THEN
  3181.             DYNARRAY G.HANDLES.Y[]
  3182.         ENDIF
  3183.  
  3184.         IF NOT ISASSIGNED(G.HANDLES.Y["PROGRESS"]) OR
  3185.             NOT ISWINDOW(G.HANDLES.Y["PROGRESS"])  THEN
  3186.             WINDOW CREATE FLOATING @ -200, -200
  3187.             ATTRIBUTES Y TO G.HANDLES.Y["PROGRESS"]
  3188.         ENDIF
  3189.  
  3190.         WINDOW SELECT G.HANDLES.Y["PROGRESS"]
  3191.         SETCANVAS G.HANDLES.Y["PROGRESS"]
  3192.         CANVAS OFF
  3193.  
  3194.         IF TOPROW.N = 999 THEN
  3195.             TOPROW.N = 7
  3196.         ENDIF
  3197.  
  3198.         IF LEFTCOL.N = 999 THEN
  3199.             LEFTCOL.N = INT((G.SYSINFO.Y["ScreenWidth"]-64)/2)
  3200.         ENDIF
  3201.  
  3202.         IF PERCENTDONE.N = 0 THEN     ; 0 = 1st time through Setup
  3203.             WINDOW MOVE G.HANDLES.Y["PROGRESS"] TO TOPROW.N,LEFTCOL.N
  3204.  
  3205.             @ 0,0  ??"┌──────────────────────────────────────────────────────────────┐"
  3206.             @ 1,0  ??"│                                                              │"
  3207.             @ 2,0  ??"│                                                              │"
  3208.             @ 3,0  ??"│                                                              │"
  3209.             @ 4,0  ??"│     ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░     │"
  3210.             @ 5,0  ??"│      0           25         50          75          100      │"
  3211.             @ 6,0  ??"│                      Percent Complete                        │"
  3212.             @ 7,0  ??"└──────────────────────────────────────────────────────────────┘"
  3213.  
  3214.             @ 1,2 ?? FORMAT("ac,w60",TITLE.A)
  3215.             PAINTCANVAS ATTRIBUTE WINCOLOR.N 0,0,6,63
  3216.             PAINTCANVAS ATTRIBUTE BARCOLOR.N 4,6,4,57
  3217.  
  3218.             PAINTCANVAS BORDER ATTRIBUTE 112 0,0,7,63
  3219.             PAINTCANVAS ATTRIBUTE 127 0,0,7,0
  3220.             PAINTCANVAS ATTRIBUTE 127 7,0,7,62
  3221.         ENDIF
  3222.  
  3223.         STYLE ATTRIBUTE MSGCOLOR.N
  3224.         @ 2,2 ?? FORMAT("ac,w60",MESSAGE.A)
  3225.         STYLE ATTRIBUTE BARCOLOR.N
  3226.         @ 4,7 ?? FILL("\219",MIN(INT(PERCENTDONE.N/2),50))
  3227.         STYLE
  3228.  
  3229.         CANVAS ON
  3230.     ENDIF
  3231.     IF ISWINDOW(OLDCANVAS.H) THEN
  3232.         SETCANVAS OLDCANVAS.H
  3233.     ELSE
  3234.         SETCANVAS DEFAULT
  3235.     ENDIF
  3236.     IF ISWINDOW(OLDWINDOW.H) THEN
  3237.         WINDOW SELECT OLDWINDOW.H
  3238.     ENDIF
  3239.     RETURN
  3240. ENDPROC
  3241.  
  3242. WRITELIB LIBNAME MSPROGRESSBAR.U
  3243. RELEASE VARS MSPROGRESSBAR.U
  3244. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "msProgressBar.u")
  3245.  
  3246.  
  3247. ;══════════════════════════BSC═══════════════════════════════════════
  3248. ; PROCEDURE   : MtHProgressMsg.U
  3249. ; AUTHOR      : Mark T. Houpt
  3250. ; COPYRIGHT   : (C) 1993 BAT-Systems Consulting
  3251. ; PARAMETERS  : See Below
  3252. ;
  3253. ;
  3254. ;
  3255. ; RETURNS     : No Value
  3256. ;
  3257. ; Special Info: Addapted from DataStar Int. msProgressBar.u  This is an
  3258. ;               Updated Progress Msg Window
  3259. ;═══════════════════════════BSC════════════════════════════════════════
  3260. ; Major Portions      (c) 1991 - 1993 DataStar International
  3261. ; ---------------------------------------------------------------------
  3262. PROC MtHPROGRESSMSG.U(            ; Creates Progress Bar thermometer
  3263.     TOPROW.N,               ; Top row for Window
  3264.     LEFTCOL.N,              ; Left column for Window
  3265.     TITLE.A,                ; Title for bar - Must be Under 40 characters
  3266.     MESSAGE.A,              ; Message, below title - Must Be unnder 40 Characters
  3267.     WINCOLOR.N,             ; Color of Window, includes Title
  3268.     MSGCOLOR.N,             ; Color of Message
  3269.     Pass.n)                 ; 0 = SetUpWindow and -1 to close
  3270.     PRIVATE  Y,                      ; Throwaway Window DynArray
  3271.     OLDCANVAS.H,            ; Current Canvas
  3272.     OLDWINDOW.H             ; Current Window
  3273.     ;Global  g.sysinfo.y             ; SysInfo
  3274.     ;        g.handles.y             ; Window Handles
  3275.  
  3276.     OLDWINDOW.H = GETWINDOW()
  3277.     OLDCANVAS.H = GETCANVAS()
  3278.     IF PASS.N = -1 THEN
  3279.         WINDOW SELECT G.HANDLES.Y["PROGRESSMSG"]
  3280.         SETCANVAS G.HANDLES.Y["PROGRESSMSG"]
  3281.         WINCLOSE
  3282.     ELSE
  3283.         IF NOT ISASSIGNED(G.SYSINFO.Y) THEN
  3284.             SYSINFO TO G.SYSINFO.Y
  3285.         ENDIF
  3286.  
  3287.         DYNARRAY Y[]
  3288.         Y["hasframe"] = FALSE
  3289.         Y["Style"]    = WINCOLOR.N
  3290.         Y["height"]   = 6
  3291.         Y["width"]    = 44
  3292.  
  3293.         IF NOT ISASSIGNED(G.HANDLES.Y) THEN
  3294.             DYNARRAY G.HANDLES.Y[]
  3295.         ENDIF
  3296.  
  3297.         IF NOT ISASSIGNED(G.HANDLES.Y["PROGRESSMSG"]) OR
  3298.             NOT ISWINDOW(G.HANDLES.Y["PROGRESSMSG"])  THEN
  3299.             WINDOW CREATE FLOATING @ -200, -200
  3300.             ATTRIBUTES Y TO G.HANDLES.Y["PROGRESSMSG"]
  3301.         ENDIF
  3302.  
  3303.         WINDOW SELECT G.HANDLES.Y["PROGRESSMSG"]
  3304.         SETCANVAS G.HANDLES.Y["PROGRESSMSG"]
  3305.         CANVAS OFF
  3306.  
  3307.         IF TOPROW.N = 999 THEN
  3308.             TOPROW.N = 7
  3309.         ENDIF
  3310.  
  3311.         IF LEFTCOL.N = 999 THEN
  3312.             LEFTCOL.N = INT((G.SYSINFO.Y["ScreenWidth"]-64)/2)
  3313.         ENDIF
  3314.  
  3315.         IF Pass.N = 0 THEN     ; 0 = 1st time through Setup
  3316.             WINDOW MOVE G.HANDLES.Y["PROGRESSMSG"] TO TOPROW.N,LEFTCOL.N
  3317.  
  3318.             @ 0,0  ??"┌──────────────────────────────────────────┐"
  3319.             @ 1,0  ??"│                                          │"
  3320.             @ 2,0  ??"│                                          │"
  3321.             @ 3,0  ??"│                                          │"
  3322.             @ 4,0  ??"│                                          │"
  3323.             @ 5,0  ??"└──────────────────────────────────────────┘"
  3324.  
  3325.             @ 1,2 ?? FORMAT("ac,w40",TITLE.A)
  3326.             PAINTCANVAS ATTRIBUTE WINCOLOR.N 0,0,6,43
  3327.  
  3328.             PAINTCANVAS BORDER ATTRIBUTE 112 0,0,7,43
  3329.             PAINTCANVAS ATTRIBUTE 127 0,0,7,0
  3330.             PAINTCANVAS ATTRIBUTE 127 7,0,7,42
  3331.         ENDIF
  3332.  
  3333.         STYLE ATTRIBUTE MSGCOLOR.N
  3334.         @ 3,2 ?? FORMAT("ac,w40",MESSAGE.A)
  3335.         @ 4,22
  3336.         if Pass.n = 1 then
  3337.             CURSOR BAR
  3338.         endif
  3339.         CANVAS ON
  3340.     ENDIF
  3341.     IF ISWINDOW(OLDCANVAS.H) THEN
  3342.         SETCANVAS OLDCANVAS.H
  3343.     ELSE
  3344.         SETCANVAS DEFAULT
  3345.     ENDIF
  3346.     IF ISWINDOW(OLDWINDOW.H) THEN
  3347.         WINDOW SELECT OLDWINDOW.H
  3348.     ENDIF
  3349.     IF Pass.n = - 1 then
  3350.       CURSOR NORMAL
  3351.     ENDIF
  3352.     RETURN
  3353. ENDPROC
  3354. WRITELIB LIBNAME MtHPROGRESSMSG.U
  3355. RELEASE VARS MtHPROGRESSMSG.U
  3356. LB_DISPLAYPROGRESS.U(PROCTOTAL.N, "MtHProgressMSG.u")
  3357.  
  3358.