/* * szctrlmt.p - Control Table Maintenance Procedure * * Created by Varacom Pty Ltd - http://www.varacom.com.au/ * This header, and the license agreement must remain intact. * * IMPORTANT: Please read the Varacom Open-source Software License * Agreement at the bottom of this file BEFORE using it. * * Modification History * * Code Who When What * ------- ------- -------- ------------------------------------------------ * 1.0.0 smp 08/07/98 Created * 1.0.1 smp 10/07/98 Added extra key values */ {mfdtitle.i "1.0.1 "} def var del-yn like mfc_logical initial yes no-undo. def var v-key1 like usrw_wkfl.usrw_key1 initial "SZCTRLMT" no-undo. form usrw_wkfl.usrw_key1 format "x(8)" label "Key 1" colon 20 usrw_wkfl.usrw_key3 format "x(8)" label "Key 3" colon 40 usrw_wkfl.usrw_key5 format "x(8)" label "Key 5" colon 60 usrw_wkfl.usrw_key2 format "x(8)" label "Key 2" colon 20 usrw_wkfl.usrw_key4 format "x(8)" label "Key 4" colon 40 usrw_wkfl.usrw_key6 format "x(8)" label "Key 6" colon 60 skip(1) usrw_wkfl.usrw_user1 format "x(50)" label "Description" colon 20 skip(1) usrw_wkfl.usrw_charfld[1] format "x(50)" colon 20 label "Character 1" usrw_wkfl.usrw_charfld[2] format "x(50)" colon 20 label "2" usrw_wkfl.usrw_charfld[3] format "x(50)" colon 20 label "3" usrw_wkfl.usrw_charfld[4] format "x(50)" colon 20 label "4" usrw_wkfl.usrw_charfld[5] format "x(50)" colon 20 label "5" usrw_wkfl.usrw_charfld[6] format "x(50)" colon 20 label "6" skip(1) usrw_wkfl.usrw_decfld[1] format "->>>,>>>,>>9.99" colon 20 label "Decimal 1" usrw_wkfl.usrw_decfld[4] format "->>>,>>>,>>9.99" colon 60 label "4" usrw_wkfl.usrw_decfld[2] format "->>>,>>>,>>9.99" colon 20 label "2" usrw_wkfl.usrw_decfld[5] format "->>>,>>>,>>9.99" colon 60 label "5" usrw_wkfl.usrw_decfld[3] format "->>>,>>>,>>9.99" colon 20 label "3" usrw_wkfl.usrw_decfld[6] format "->>>,>>>,>>9.99" colon 60 label "6" skip(1) usrw_wkfl.usrw_datefld[1] format "99/99/9999" colon 20 label "Date 1" usrw_wkfl.usrw_datefld[3] format "99/99/9999" colon 60 label "3" usrw_wkfl.usrw_datefld[2] format "99/99/9999" colon 20 label "2" usrw_wkfl.usrw_datefld[4] format "99/99/9999" colon 60 label "4" with frame a side-labels width 80. find first usrw_wkfl where usrw_wkfl.usrw_key1 = v-key1 no-lock no-error. if available usrw_wkfl then do: display usrw_wkfl.usrw_key1 usrw_wkfl.usrw_key2 usrw_wkfl.usrw_key3 usrw_wkfl.usrw_key4 usrw_wkfl.usrw_key5 usrw_wkfl.usrw_key6 usrw_wkfl.usrw_user1 usrw_wkfl.usrw_charfld[1] usrw_wkfl.usrw_charfld[2] usrw_wkfl.usrw_charfld[3] usrw_wkfl.usrw_charfld[4] usrw_wkfl.usrw_charfld[5] usrw_wkfl.usrw_charfld[6] usrw_wkfl.usrw_decfld[1] usrw_wkfl.usrw_decfld[2] usrw_wkfl.usrw_decfld[3] usrw_wkfl.usrw_decfld[4] usrw_wkfl.usrw_decfld[5] usrw_wkfl.usrw_decfld[6] usrw_wkfl.usrw_datefld[1] usrw_wkfl.usrw_datefld[2] usrw_wkfl.usrw_datefld[3] usrw_wkfl.usrw_datefld[4] with frame a. end. /* AVAILABLE USRW_WKFL */ MainLoop: repeat: view frame a. prompt-for usrw_wkfl.usrw_key2 with frame a editing: /* * Find next/prev record */ {mfnp05.i usrw_wkfl usrw_index1 "usrw_wkfl.usrw_key1 = v-key1" usrw_key2 usrw_key2 } if recno <> ? then do: display usrw_wkfl.usrw_key1 usrw_wkfl.usrw_key2 usrw_wkfl.usrw_key3 usrw_wkfl.usrw_key4 usrw_wkfl.usrw_key5 usrw_wkfl.usrw_key6 usrw_wkfl.usrw_user1 usrw_wkfl.usrw_charfld[1] usrw_wkfl.usrw_charfld[2] usrw_wkfl.usrw_charfld[3] usrw_wkfl.usrw_charfld[4] usrw_wkfl.usrw_charfld[5] usrw_wkfl.usrw_charfld[6] usrw_wkfl.usrw_decfld[1] usrw_wkfl.usrw_decfld[2] usrw_wkfl.usrw_decfld[3] usrw_wkfl.usrw_decfld[4] usrw_wkfl.usrw_decfld[5] usrw_wkfl.usrw_decfld[6] usrw_wkfl.usrw_datefld[1] usrw_wkfl.usrw_datefld[2] usrw_wkfl.usrw_datefld[3] usrw_wkfl.usrw_datefld[4] with frame a. end. /* RECNO <> ? */ end. /* EDITING */ /* * Add/mod/delete */ assign del-yn = no. find usrw_wkfl where usrw_wkfl.usrw_key1 = v-key1 and usrw_wkfl.usrw_key2 = input frame a usrw_wkfl.usrw_key2 exclusive-lock no-error. if not available usrw_wkfl then do: /* NEW ITEM */ {mfmsg.i 1 1} create usrw_wkfl. assign usrw_wkfl.usrw_key1 = v-key1 usrw_wkfl.usrw_key2 = input frame a usrw_wkfl.usrw_key2 . end. /* NOT AVAILABLE USRW_WKFL */ do on error undo MainLoop, leave MainLoop: /* DISPLAY */ display usrw_wkfl.usrw_key1 usrw_wkfl.usrw_key3 usrw_wkfl.usrw_key4 usrw_wkfl.usrw_key5 usrw_wkfl.usrw_key6 usrw_wkfl.usrw_user1 usrw_wkfl.usrw_charfld[1] usrw_wkfl.usrw_charfld[2] usrw_wkfl.usrw_charfld[3] usrw_wkfl.usrw_charfld[4] usrw_wkfl.usrw_charfld[5] usrw_wkfl.usrw_charfld[6] usrw_wkfl.usrw_decfld[1] usrw_wkfl.usrw_decfld[2] usrw_wkfl.usrw_decfld[3] usrw_wkfl.usrw_decfld[4] usrw_wkfl.usrw_decfld[5] usrw_wkfl.usrw_decfld[6] usrw_wkfl.usrw_datefld[1] usrw_wkfl.usrw_datefld[2] usrw_wkfl.usrw_datefld[3] usrw_wkfl.usrw_datefld[4] with frame a. update usrw_wkfl.usrw_key3 usrw_wkfl.usrw_key4 usrw_wkfl.usrw_key5 usrw_wkfl.usrw_key6 usrw_wkfl.usrw_user1 usrw_wkfl.usrw_charfld[1] usrw_wkfl.usrw_charfld[2] usrw_wkfl.usrw_charfld[3] usrw_wkfl.usrw_charfld[4] usrw_wkfl.usrw_charfld[5] usrw_wkfl.usrw_charfld[6] usrw_wkfl.usrw_decfld[1] usrw_wkfl.usrw_decfld[2] usrw_wkfl.usrw_decfld[3] usrw_wkfl.usrw_decfld[4] usrw_wkfl.usrw_decfld[5] usrw_wkfl.usrw_decfld[6] usrw_wkfl.usrw_datefld[1] usrw_wkfl.usrw_datefld[2] usrw_wkfl.usrw_datefld[3] usrw_wkfl.usrw_datefld[4] with frame a editing: ststatus = stline[2]. status input ststatus. readkey. /* DELETE */ if lastkey = keycode("F5") or lastkey = keycode("CTRL-D") then do: del-yn = yes. {mfmsg01.i 11 1 del-yn} if del-yn then leave. end. else apply lastkey. end. /* EDITING */ /* * Delete */ if del-yn = yes then do: delete usrw_wkfl. clear frame a. del-yn = no. next MainLoop. end. /* DEL-YN = YES */ status input. end. /*do on error*/ end. /* MainLoop */ status input. /******************************************************************************* Varacom Open-source Software License Agreement. This software is Copyright © 1995-2000 by Varacom Pty Ltd. http://www.varacom.com.au/ BY OPENING, INSTALLING, OR DISTRIBUTING ANY PORTION OF THESE FILES, REFERRED HEREIN AS THE VARACOM SOFTWARE, YOU AGREE TO BE BOUND TO THE FOLLOWING TERMS AND CONDITIONS: 1. You must have a valid Progress license to use the Varacom Software. 2. You are granted a non-exclusive right to use the Varacom Software. 3. For any purpose, commercial or otherwise except these purposes: o Sexually oriented, gambling related or racist. o Anything which would be illegal in the jurisdiction in which the server resides. 4. You may modify the Varacom Software for your own use or use within your company. 5. You may distribute the Varacom Software, with or without modifications. 6. You must include this entire license agreement. 7. You must include all of the unmodified source code that you received prior to modification. You must include the source code to your modifications. Your modifications must be noted in the code, or in the documentation. If you distribute the Varacom Software as part of a commercial software product, you must include in your license the following statement: "This product contains software created by Varacom Pty Ltd - http://www.varacom.com.au/. Distribution of the Varacom Software components is subject to the Varacom Open-source Software License Agreement included." 8. You may charge a fee to distribute the Varacom Software, if you wish. BUT, you may NOT restrict the further distribution of the Varacom Software portions of your distribution. 9. Any modifications to the files distributed with the Varacom Software that you distribute publicly become the property of Varacom and are subject to this license. 10. You indemnify and hold harmless the contributors and distributors of the Varacom Software from any and all damages, either direct or consequential, related to the use, installation, or distribution of the Varacom Software. YOU UNDERSTAND THAT THE VARACOM SOFTWARE AND ITS CONTRIBUTORS EXPRESSLY DISCLAIM ANY AND ALL WARRANTIES, INCLUDING FITNESS OF PURPOSE AND MERCHANTABILITY. If any section of this license agreement is found to be inapplicable because of court decision then the remaining provisions will remain in effect. Progress is a trademark of Progress Software Corporation. *******************************************************************************/