home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 5 / 05.iso / a / a084 / 2.ddi / CKSAMPLE / OPTIONS.SPR < prev    next >
Encoding:
Text File  |  1993-05-25  |  16.8 KB  |  605 lines

  1. *       *********************************************************
  2. *       *                                                         
  3. *       * 05/18/93             OPTIONS.SPR               13:44:35 
  4. *       *                                                         
  5. *       *********************************************************
  6. *       *                                                         
  7. *       * Steven Hsu, Wayne Lampel                                
  8. *       *                                                         
  9. *       * Copyright (c) 1993 Microsoft                            
  10. *       * One Microsoft Way                                       
  11. *       * Redmond, WA  98052                                      
  12. *       *                                                         
  13. *       * Description:                                            
  14. *       * This program was automatically generated by GENSCRN.    
  15. *       *                                                         
  16. *       *********************************************************
  17.  
  18. DO CASE
  19. CASE _WINDOWS
  20.  
  21.     
  22.     #REGION 0
  23.     REGIONAL m.currarea, m.talkstat, m.compstat
  24.     
  25.     IF SET("TALK") = "ON"
  26.         SET TALK OFF
  27.         m.talkstat = "ON"
  28.     ELSE
  29.         m.talkstat = "OFF"
  30.     ENDIF
  31.     m.compstat = SET("COMPATIBLE")
  32.     SET COMPATIBLE FOXPLUS
  33.     
  34.     m.rborder = SET("READBORDER")
  35.     SET READBORDER ON
  36.     
  37.     *       *********************************************************
  38.     *       *                                                         
  39.     *       *               Windows Window definitions                
  40.     *       *                                                         
  41.     *       *********************************************************
  42.     *
  43.     
  44.     IF NOT WEXIST("_qfx0tgfhq")
  45.         DEFINE WINDOW _qfx0tgfhq ;
  46.             AT  0.000, 0.000  ;
  47.             SIZE 18.077,60.500 ;
  48.             TITLE " Options " ;
  49.             FONT "MS Sans Serif", 8 ;
  50.             STYLE "B" ;
  51.             FLOAT ;
  52.             CLOSE ;
  53.             NOMINIMIZE ;
  54.             DOUBLE
  55.         MOVE WINDOW _qfx0tgfhq CENTER
  56.     ENDIF
  57.     
  58.     
  59.     *       *********************************************************
  60.     *       *                                                         
  61.     *       *         OPTIONS/Windows Setup Code - SECTION 2          
  62.     *       *                                                         
  63.     *       *********************************************************
  64.     *
  65.     
  66.     #REGION 1
  67.     if  wvisible("View")
  68.         dispview = .t.
  69.     else
  70.         dispview = .f.
  71.     endif
  72.     
  73.     asynch = dbgetopt(ckhandle, "Asynchronous")
  74.     IF (asynch < 0)
  75.         DO repoerro.spr WITH asynch
  76.     ELSE
  77.         asynch = asynch + 1
  78.     ENDIF
  79.     
  80.     usetabs    = dbgetopt(ckhandle, "UseTables")
  81.     IF (usetabs < 0)
  82.         DO repoerro.spr WITH usetabs
  83.     ELSE
  84.         usetabs = usetabs + 1
  85.     ENDIF
  86.     
  87.     connto = dbgetopt(0, "ConnTimeout")
  88.     IF (connto < 0)
  89.         DO repoerro.spr WITH connto
  90.     ENDIF
  91.     
  92.     gento = dbgetopt(ckhandle, "GenTimeout")
  93.     IF (gento < 0)
  94.         DO repoerro.spr WITH gento
  95.     ENDIF
  96.     
  97.     * until the dbgetopt returns the correct value
  98.     if gento = 0
  99.         gento = 15
  100.     endif
  101.     
  102.     memosz = dbgetopt(ckhandle, "UseMemoSize")
  103.     IF (memosz < 0)
  104.         DO repoerro.spr WITH memosz
  105.     ENDIF
  106.     
  107.     * until the dbgetopt returns the correct value
  108.     if memosz > 254
  109.         memosz = 254
  110.     endif
  111.     
  112.     
  113.     *       *********************************************************
  114.     *       *                                                         
  115.     *       *              OPTIONS/Windows Screen Layout              
  116.     *       *                                                         
  117.     *       *********************************************************
  118.     *
  119.     
  120.     #REGION 1
  121.     IF WVISIBLE("_qfx0tgfhq")
  122.         ACTIVATE WINDOW _qfx0tgfhq SAME
  123.     ELSE
  124.         ACTIVATE WINDOW _qfx0tgfhq NOSHOW
  125.     ENDIF
  126.     @ 3.077,32.667 SAY "Connect:"  ;
  127.         FONT "MS Sans Serif", 8 ;
  128.         STYLE "B"
  129.     @ 4.615,32.667 SAY "General:"  ;
  130.         FONT "MS Sans Serif", 8 ;
  131.         STYLE "B"
  132.     @ 9.615,32.667 SAY "Memo cutoff:"  ;
  133.         FONT "MS Sans Serif", 8 ;
  134.         STYLE "B"
  135.     @ 1.923,1.833 TO 6.769,26.166 ;
  136.         PEN 1, 8
  137.     @ 1.462,3.000 SAY " Result Set "  ;
  138.         FONT "MS Sans Serif", 8 ;
  139.         STYLE "B" ;
  140.         COLOR RGB(,,,255,255,255)
  141.     @ 9.077,2.000 TO 13.923,26.333 ;
  142.         PEN 1, 8
  143.     @ 8.615,3.000 SAY " Execution Mode "  ;
  144.         FONT "MS Sans Serif", 8 ;
  145.         STYLE "B" ;
  146.         COLOR RGB(,,,255,255,255)
  147.     @ 2.000,30.333 TO 6.846,57.833 ;
  148.         PEN 1, 8
  149.     @ 1.538,31.333 SAY " Timeouts (in seconds) "  ;
  150.         FONT "MS Sans Serif", 8 ;
  151.         STYLE "B" ;
  152.         COLOR RGB(,,,255,255,255)
  153.     @ 15.154,11.167 GET ExitAction ;
  154.         PICTURE "@*HN \! OK ;\? Cancel" ;
  155.         SIZE 1.769,16.500,4.000 ;
  156.         DEFAULT 1 ;
  157.         FONT "MS Sans Serif", 8 ;
  158.         STYLE "B" ;
  159.         VALID _qfx0tggla()
  160.     @ 3.077,3.667 GET useTabs ;
  161.         PICTURE "@*RVN \<Return in Cursors;Return in \<Tables" ;
  162.         SIZE 1.308,20.833,0.000 ;
  163.         DEFAULT 1 ;
  164.         FONT "MS Sans Serif", 8 ;
  165.         STYLE "BT"
  166.     @ 10.231,3.667 GET asynch ;
  167.         PICTURE "@*RVN \<Synchronous;\<Asynchronous" ;
  168.         SIZE 1.308,17.667,0.077 ;
  169.         DEFAULT 1 ;
  170.         FONT "MS Sans Serif", 8 ;
  171.         STYLE "BT"
  172.     @ 3.154,47.333 GET ConnTO ;
  173.         SIZE 1.000,6.400 ;
  174.         DEFAULT " " ;
  175.         FONT "MS Sans Serif", 8 ;
  176.         PICTURE "@K"
  177.     @ 4.692,47.333 GET genTO ;
  178.         SIZE 1.000,6.400 ;
  179.         DEFAULT " " ;
  180.         FONT "MS Sans Serif", 8 ;
  181.         PICTURE "@K"
  182.     @ 9.538,47.333 GET memoSz ;
  183.         SIZE 1.000,6.400 ;
  184.         DEFAULT " " ;
  185.         FONT "MS Sans Serif", 8 ;
  186.         PICTURE "@K"
  187.     @ 11.615,32.667 GET dispview ;
  188.         PICTURE "@*C \<Display View window" ;
  189.         SIZE 1.308,25.333 ;
  190.         DEFAULT 0 ;
  191.         FONT "MS Sans Serif", 8 ;
  192.         STYLE "BT" ;
  193.         VALID _qfx0tggxb()
  194.     
  195.     IF NOT WVISIBLE("_qfx0tgfhq")
  196.         ACTIVATE WINDOW _qfx0tgfhq
  197.     ENDIF
  198.     
  199.     READ CYCLE MODAL
  200.     
  201.     RELEASE WINDOW _qfx0tgfhq
  202.     
  203.     #REGION 0
  204.     
  205.     SET READBORDER &rborder
  206.     
  207.     IF m.talkstat = "ON"
  208.         SET TALK ON
  209.     ENDIF
  210.     IF m.compstat = "ON"
  211.         SET COMPATIBLE ON
  212.     ENDIF
  213.     
  214.     
  215.     *       *********************************************************
  216.     *       *                                                         
  217.     *       *              OPTIONS/Windows Cleanup Code               
  218.     *       *                                                         
  219.     *       *********************************************************
  220.     *
  221.     
  222.     #REGION 1
  223.     PRIVATE retcode
  224.     
  225.     IF (exitaction != 1)
  226.         RETURN
  227.     ENDIF
  228.     
  229.     asynch = asynch - 1
  230.     retcode = dbsetopt(ckhandle, "Asynchronous", asynch)
  231.     IF (retcode < 0)
  232.         DO repoerro.spr WITH retcode
  233.     ENDIF
  234.     
  235.     usetabs = usetabs - 1
  236.     retcode = dbsetopt(ckhandle, "UseTables", usetabs)
  237.     IF (retcode < 0)
  238.         DO repoerro.spr WITH retcode
  239.     ENDIF
  240.     
  241.     retcode = dbsetopt(0, "ConnTimeout", connto)
  242.     IF (retcode < 0)
  243.         DO repoerro.spr WITH retcode
  244.     ENDIF
  245.     
  246.     retcode = dbsetopt(ckhandle, "GenTimeout", gento)
  247.     IF (retcode< 0)
  248.         DO repoerro.spr WITH retcode
  249.     ENDIF
  250.     
  251.     retcode = dbsetopt(ckhandle, "UseMemoSize", memosz)
  252.     IF (retcode < 0)
  253.         DO repoerro.spr WITH retcode
  254.     ENDIF
  255.     
  256.  
  257. CASE _DOS
  258.  
  259.     
  260.     #REGION 0
  261.     REGIONAL m.currarea, m.talkstat, m.compstat
  262.     
  263.     IF SET("TALK") = "ON"
  264.         SET TALK OFF
  265.         m.talkstat = "ON"
  266.     ELSE
  267.         m.talkstat = "OFF"
  268.     ENDIF
  269.     m.compstat = SET("COMPATIBLE")
  270.     SET COMPATIBLE FOXPLUS
  271.     
  272.     *       *********************************************************
  273.     *       *                                                         
  274.     *       *                MS-DOS Window definitions                
  275.     *       *                                                         
  276.     *       *********************************************************
  277.     *
  278.     
  279.     IF NOT WEXIST("_qfx0tghj3")
  280.         DEFINE WINDOW _qfx0tghj3 ;
  281.             FROM INT((SROW()-13)/2),INT((SCOL()-59)/2) ;
  282.             TO INT((SROW()-13)/2)+12,INT((SCOL()-59)/2)+58 ;
  283.             TITLE " Options " ;
  284.             FLOAT ;
  285.             CLOSE ;
  286.             NOMINIMIZE ;
  287.             DOUBLE ;
  288.             COLOR SCHEME 5
  289.     ENDIF
  290.     
  291.     
  292.     *       *********************************************************
  293.     *       *                                                         
  294.     *       *          OPTIONS/MS-DOS Setup Code - SECTION 2          
  295.     *       *                                                         
  296.     *       *********************************************************
  297.     *
  298.     
  299.     #REGION 1
  300.     on key label ALT+C _curobj = 4
  301.     on key label ALT+G _curobj = 5
  302.     on key label ALT+M _curobj = 6
  303.     
  304.     if  wvisible("View")
  305.         dispview = .t.
  306.     else
  307.         dispview = .f.
  308.     endif
  309.     
  310.     asynch = dbgetopt(ckhandle, "Asynchronous")
  311.     IF (asynch < 0)
  312.         DO repoerro.spr WITH asynch
  313.     ELSE
  314.         asynch = asynch + 1
  315.     ENDIF
  316.     
  317.     usetabs    = dbgetopt(ckhandle, "UseTables")
  318.     IF (usetabs < 0)
  319.         DO repoerro.spr WITH usetabs
  320.     ELSE
  321.         usetabs = usetabs + 1
  322.     ENDIF
  323.     
  324.     connto = dbgetopt(0, "ConnTimeout")
  325.     IF (connto < 0)
  326.         DO repoerro.spr WITH connto
  327.     ENDIF
  328.     
  329.     gento = dbgetopt(ckhandle, "GenTimeout")
  330.     IF (gento < 0)
  331.         DO repoerro.spr WITH gento
  332.     ENDIF
  333.     
  334.     * until the dbgetopt returns the correct value
  335.     if gento = 0
  336.         gento = 15
  337.     endif
  338.     
  339.     memosz = dbgetopt(ckhandle, "UseMemoSize")
  340.     IF (memosz < 0)
  341.         DO repoerro.spr WITH memosz
  342.     ENDIF
  343.     
  344.     * until the dbgetopt returns the correct value
  345.     if memosz > 254
  346.         memosz = 254
  347.     endif
  348.     
  349.     
  350.     *       *********************************************************
  351.     *       *                                                         
  352.     *       *              OPTIONS/MS-DOS Screen Layout               
  353.     *       *                                                         
  354.     *       *********************************************************
  355.     *
  356.     
  357.     #REGION 1
  358.     IF WVISIBLE("_qfx0tghj3")
  359.         ACTIVATE WINDOW _qfx0tghj3 SAME
  360.     ELSE
  361.         ACTIVATE WINDOW _qfx0tghj3 NOSHOW
  362.     ENDIF
  363.     @ 0,1 TO 3,26
  364.     @ 5,1 TO 8,26
  365.     @ 0,30 TO 3,54
  366.     @ 2,35 SAY "General:" ;
  367.         SIZE 1,8, 0
  368.     @ 1,35 SAY "Connect:" ;
  369.         SIZE 1,8, 0
  370.     @ 5,31 SAY "Memo cutoff size:" ;
  371.         SIZE 1,17, 0
  372.     @ 3,35 TO 3,35
  373.     @ 0,2 SAY " Result Set" ;
  374.         SIZE 1,11, 0 ;
  375.         COLOR N+/W    
  376.     @ 5,3 SAY " Execution Mode" ;
  377.         SIZE 1,15, 0 ;
  378.         COLOR N+/W    
  379.     @ 0,31 SAY " Timeouts (in seconds)" ;
  380.         SIZE 1,22, 0 ;
  381.         COLOR N+/W    
  382.     @ 1,3 GET useTabs ;
  383.         PICTURE "@*RVN \<Return in Cursors;Return in \<Tables" ;
  384.         SIZE 1,21,0 ;
  385.         DEFAULT 1
  386.     @ 6,6 GET asynch ;
  387.         PICTURE "@*RVN \<Synchronous;\<Asynchronous" ;
  388.         SIZE 1,16,0 ;
  389.         DEFAULT 1
  390.     @ 10,10 GET ExitAction ;
  391.         PICTURE "@*HN \! OK ;\? Cancel" ;
  392.         SIZE 1,16,4 ;
  393.         DEFAULT 1 ;
  394.         VALID _qfx0tgie7()
  395.     @ 1,44 GET ConnTO ;
  396.         SIZE 1,6 ;
  397.         DEFAULT " " ;
  398.         PICTURE "@K"
  399.     @ 2,44 GET genTO ;
  400.         SIZE 1,6 ;
  401.         DEFAULT " " ;
  402.         PICTURE "@K"
  403.     @ 5,49 GET memoSz ;
  404.         SIZE 1,6 ;
  405.         DEFAULT " " ;
  406.         PICTURE "@K"
  407.     @ 7,31 GET dispview ;
  408.         PICTURE "@*C \<Display View window" ;
  409.         SIZE 1,23 ;
  410.         DEFAULT 0 ;
  411.         VALID _qfx0tgino()
  412.     
  413.     IF NOT WVISIBLE("_qfx0tghj3")
  414.         ACTIVATE WINDOW _qfx0tghj3
  415.     ENDIF
  416.     
  417.     READ CYCLE MODAL
  418.     
  419.     RELEASE WINDOW _qfx0tghj3
  420.     
  421.     #REGION 0
  422.     IF m.talkstat = "ON"
  423.         SET TALK ON
  424.     ENDIF
  425.     IF m.compstat = "ON"
  426.         SET COMPATIBLE ON
  427.     ENDIF
  428.     
  429.     
  430.     *       *********************************************************
  431.     *       *                                                         
  432.     *       *               OPTIONS/MS-DOS Cleanup Code               
  433.     *       *                                                         
  434.     *       *********************************************************
  435.     *
  436.     
  437.     #REGION 1
  438.     PRIVATE retcode
  439.     
  440.     IF (exitaction != 1)
  441.         RETURN
  442.     ENDIF
  443.     
  444.     asynch = asynch - 1
  445.     retcode = dbsetopt(ckhandle, "Asynchronous", asynch)
  446.     IF (retcode < 0)
  447.         DO repoerro.spr WITH retcode
  448.     ENDIF
  449.     
  450.     usetabs = usetabs - 1
  451.     retcode = dbsetopt(ckhandle, "UseTables", usetabs)
  452.     IF (retcode < 0)
  453.         DO repoerro.spr WITH retcode
  454.     ENDIF
  455.     
  456.     retcode = dbsetopt(0, "ConnTimeout", connto)
  457.     IF (retcode < 0)
  458.         DO repoerro.spr WITH retcode
  459.     ENDIF
  460.     
  461.     retcode = dbsetopt(ckhandle, "GenTimeout", gento)
  462.     IF (retcode< 0)
  463.         DO repoerro.spr WITH retcode
  464.     ENDIF
  465.     
  466.     retcode = dbsetopt(ckhandle, "UseMemoSize", memosz)
  467.     IF (retcode < 0)
  468.         DO repoerro.spr WITH retcode
  469.     ENDIF
  470.     on key label ALT+C
  471.     on key label ALT+G
  472.     on key label ALT+M
  473.     
  474.  
  475. ENDCASE
  476.  
  477.  
  478. *       *********************************************************
  479. *       *                                                         
  480. *       * _QFX0TGGLA           ExitAction VALID                   
  481. *       *                                                         
  482. *       * Function Origin:                                        
  483. *       *                                                         
  484. *       * From Platform:       Windows                            
  485. *       * From Screen:         OPTIONS,     Record Number:   11   
  486. *       * Variable:            ExitAction                         
  487. *       * Called By:           VALID Clause                       
  488. *       * Object Type:         Push Button                        
  489. *       * Snippet Number:      1                                  
  490. *       *                                                         
  491. *       *********************************************************
  492. *
  493. FUNCTION _qfx0tggla     &&  ExitAction VALID
  494. #REGION 1
  495. IF exitaction = 1
  496.     IF memosz > 254 OR memosz < 1
  497.         WAIT WINDOW "Memo cutoff must be between 1 - 254" NOWAIT
  498.         _CUROBJ = 3
  499.         RETURN
  500.     ENDIF
  501.     IF connto > 600 OR connto < 1
  502.         WAIT WINDOW "Connect timeout must be between 1 - 600" NOWAIT
  503.         _CUROBJ = 1
  504.         RETURN
  505.     ENDIF
  506.     IF gento > 600 OR gento < 1
  507.         WAIT WINDOW "General timeout must be between 1 - 600" NOWAIT
  508.         _CUROBJ = 2
  509.         RETURN
  510.     ENDIF
  511. ENDIF
  512. CLEAR READ
  513.  
  514.  
  515. *       *********************************************************
  516. *       *                                                         
  517. *       * _QFX0TGGXB           dispview VALID                     
  518. *       *                                                         
  519. *       * Function Origin:                                        
  520. *       *                                                         
  521. *       * From Platform:       Windows                            
  522. *       * From Screen:         OPTIONS,     Record Number:   17   
  523. *       * Variable:            dispview                           
  524. *       * Called By:           VALID Clause                       
  525. *       * Object Type:         Check Box                          
  526. *       * Snippet Number:      2                                  
  527. *       *                                                         
  528. *       *********************************************************
  529. *
  530. FUNCTION _qfx0tggxb     &&  dispview VALID
  531. #REGION 1
  532. if dispview
  533.     set view on
  534. else
  535.     set view off
  536. endif
  537.  
  538. *       *********************************************************
  539. *       *                                                         
  540. *       * _QFX0TGIE7           ExitAction VALID                   
  541. *       *                                                         
  542. *       * Function Origin:                                        
  543. *       *                                                         
  544. *       * From Platform:       MS-DOS                             
  545. *       * From Screen:         OPTIONS,     Record Number:   33   
  546. *       * Variable:            ExitAction                         
  547. *       * Called By:           VALID Clause                       
  548. *       * Object Type:         Push Button                        
  549. *       * Snippet Number:      3                                  
  550. *       *                                                         
  551. *       *********************************************************
  552. *
  553. FUNCTION _qfx0tgie7     &&  ExitAction VALID
  554. #REGION 1
  555. if exitaction = 1
  556.     if memosz > 255 or memosz < 1
  557.         wait window "Memo cutoff must be between 1 - 255" nowait
  558.         _curobj = 3
  559.         return
  560.     endif
  561.     if connto > 600 or connto < 1
  562.         wait window "Connect timeout must be between 1 - 600" nowait
  563.         _curobj = 1
  564.         return
  565.     endif
  566.     if gento > 600 or gento < 1
  567.         wait window "General timeout must be between 1 - 600" nowait
  568.         _curobj = 2
  569.         return
  570.     endif
  571. endif
  572. clear read
  573.  
  574. *       *********************************************************
  575. *       *                                                         
  576. *       * _QFX0TGINO           dispview VALID                     
  577. *       *                                                         
  578. *       * Function Origin:                                        
  579. *       *                                                         
  580. *       * From Platform:       MS-DOS                             
  581. *       * From Screen:         OPTIONS,     Record Number:   37   
  582. *       * Variable:            dispview                           
  583. *       * Called By:           VALID Clause                       
  584. *       * Object Type:         Check Box                          
  585. *       * Snippet Number:      4                                  
  586. *       *                                                         
  587. *       *********************************************************
  588. *
  589. FUNCTION _qfx0tgino     &&  dispview VALID
  590. #REGION 1
  591. if dispview
  592.     set view on
  593. else
  594.     set view off
  595. endif
  596.  
  597.  
  598. *       *********************************************************
  599. *       *                                                         
  600. *       *   OPTIONS/MS-DOS Supporting Procedures and Functions    
  601. *       *                                                         
  602. *       *********************************************************
  603. *
  604.  
  605. #REGION 1