Announcement

Collapse
No announcement yet.

Using CONTROL ADD IMAGEBUTTON

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using CONTROL ADD IMAGEBUTTON

    Can someone tell me why when I use the CONTROL ADD IMAGEBUTTON in the following program then PRG2 will not close (red X) correctly. Is there something else I must use when using CONTROL ADD IMAGEBUTTON?

    Code:
    #COMPILE EXE
    #DIM ALL
    #RESOURCE BITMAP, 500, "Sok_Button1.bmp"
    
    #INCLUDE "C:\PBWIN10\WINAPI\WIN32API.INC"
    
    %PRG1_BUTTON1  = 100
    %PRG1_BUTTON11 = 110
    
    %PRG2_LABEL1  = 151 'hDlg1
    %PRG2_LABEL10 = 160
    %PRG2_TEXT1   = 300
    
    GLOBAL Prg1,prg2 AS LONG
    
    GLOBAL fHAND1,fHAND2,fHAND3 AS LONG
    GLOBAL d_prod,msg AS STRING
    
    DECLARE SUB prgAdd()   'Add socks to data file
    
    
    FUNCTION PBMAIN () AS LONG
        FONT NEW "Aerial", 12,1,255 TO fHAND1
        FONT NEW "Aerial", 14,1,255 TO fHAND2
        FONT NEW "Courier New",12,1,255 TO fHAND3
    
        DIALOG NEW UNITS,%HWND_DESKTOP,SPACE$(40)+"F I N I S H E D    S O C K S    M A I N    M E N U", _
        ,,370,210, %WS_OVERLAPPED OR %WS_SYSMENU, %WS_EX_OVERLAPPEDWINDOW TO prg1
        DIALOG SET COLOR prg1, %RGB_RED,%RGB_RED
        CONTROL ADD BUTTON, prg1, %PRG1_BUTTON1,"Add Inventory Records",20,10,150,20,%BS_CENTER OR %WS_BORDER
        CONTROL SET FONT prg1, %PRG1_BUTTON1, fHAND1
    '     CONTROL ADD IMGBUTTON, prg1, %PRG1_BUTTON1, "#500", 20, 10, 150, 20, %BS_NOTIFY
        CONTROL ADD BUTTON, prg1, %PRG1_BUTTON11,"Exit Program",135,160,100,20,%BS_CENTER OR %WS_BORDER
        CONTROL SET FONT prg1, %PRG1_BUTTON11, fHAND1
        DIALOG SHOW MODAL prg1, CALL mainProc
    END FUNCTION
    
    CALLBACK FUNCTION mainProc
        SELECT CASE AS LONG CB.MSG
            CASE %WM_COMMAND
                SELECT CASE CB.CTL
                    CASE %PRG1_BUTTON1
                        DIALOG HIDE prg1
                        CALL prgAdd()
                        DIALOG END prg2
                    CASE %PRG1_BUTTON11
                        DIALOG END prg1
                END SELECT
        END SELECT
    END FUNCTION
    
    SUB prgAdd()
        LOCAL msg AS STRING
        DIALOG NEW UNITS,0,"ADD FINISHED SOCKS ENTRY SCREEN",,,400,350, %WS_SYSMENU TO prg2
        DIALOG SET COLOR prg2, %RGB_BLUE,%RGB_BLUE
        CONTROL ADD LABEL, prg2, %PRG2_LABEL10, "",5,10,385,20,%SS_CENTER OR %SS_CENTERIMAGE OR %WS_BORDER, _
                          %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE
        CONTROL SET COLOR prg2, %PRG2_LABEL10, %RGB_BLACK, %RGB_ORANGERED
        CONTROL SET FONT prg2, %PRG2_LABEL10, fHAND1
        CONTROL ADD LABEL, prg2, %PRG2_LABEL1,"DATE PRODUCED:",5,40,110,20,%SS_CENTER OR %SS_CENTERIMAGE OR %WS_BORDER, _
                          %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE
        CONTROL SET COLOR prg2, %PRG2_LABEL1, %RGB_BLACK, %RGB_YELLOW
        CONTROL SET FONT prg2, %PRG2_LABEL1, fHAND1
        CONTROL ADD TEXTBOX, prg2, %PRG2_TEXT1,"",125,40,80,20,%ES_LEFT, %WS_EX_CLIENTEDGE
        CONTROL SET COLOR prg2, %PRG2_TEXT1, %RGB_WHITE, %RGB_BLACK
        CONTROL SET FONT prg2, %PRG2_TEXT1, fHAND2
        msg = "Enter Date as MM/DD/YYYY and Press (ENTER),   (ESC) To Start Over"
        CONTROL SET TEXT prg2, %PRG2_LABEL10, msg
        CONTROL SET FOCUS prg2, %PRG2_TEXT1
        DIALOG SHOW MODAL prg2,CALL prgAddProc
    END SUB
    
    CALLBACK FUNCTION prgAddProc
        LOCAL msg AS STRING
        LOCAL lnT1&,start&,ending&
        SELECT CASE AS LONG CB.MSG
            CASE %WM_COMMAND
                SELECT CASE CBCTL
                    CASE %IDCANCEL
                        msg = "Enter Date as MM/DD/YYYY and Press (ENTER),   (ESC) To Start Over"
                        CONTROL SET TEXT prg2, %PRG2_TEXT1, ""
                        CONTROL SET TEXT prg2, %PRG2_LABEL10, msg
                        CONTROL SET FOCUS prg2,%PRG2_TEXT1
                        EXIT FUNCTION
                    CASE %PRG2_TEXT1
                        CONTROL GET TEXT prg2,%PRG2_TEXT1 TO d_prod
                        IF CBCTLMSG = %EN_CHANGE THEN
                            CONTROL SEND prg2, %PRG2_TEXT1, %EM_GETSEL, VARPTR(start&), VARPTR(ending&)
                            lnT1& = LEN(TRIM$(d_prod))
                            IF lnT1& = 2 OR lnT1& = 5 THEN
                                d_prod = STRINSERT$(d_prod,"/",(lnT1&+1))
                                CONTROL SET TEXT prg2,%PRG2_TEXT1,d_prod
                                CONTROL SEND prg2, %PRG2_TEXT1, %EM_SETSEL, start&+1, ending&+1
                            END IF
                        END IF
                    CASE %IDOK
                        IF GetFocus() = GetDlgItem(prg2, %PRG2_TEXT1) THEN
                            IF d_prod = "" OR d_prod = "0" THEN
                                Winbeep 3000,400
                                MSGBOX("The Date Produced can NOT be BLANK or 0."+$CRLF+ _
                                       "Please click (OK) or Press ENTER to Redo."),%MB_OK,"DATE CAN'T BE BLANK OR 0"
                                CONTROL SET TEXT prg2,%PRG2_TEXT1,""
                                EXIT FUNCTION
                            END IF
                        END IF
                END SELECT
            CASE %WM_CLOSE
                DIALOG NORMALIZE prg1
                EXIT FUNCTION
        END SELECT
    END FUNCTION
    Attached Files

  • #2
    Well I think I have found my problem. I need to be testing for cbctlmsg and if it equals %bn_clicked then CALL prgAdd(). When I add this to the program it works correctly. Am I correct in this?

    Comment


    • #3
      Commenting in or out the IMGBUTTON works the same way. Clicking "Add Inventory Records" hides prg1 and shows prg2. Typing in "0" or "" shows an error message. Typing in a valid date and hitting [ENTER] does nothing. Pressing the [X] in the corner closes prg2 and restores prg1. The only thing I can see wrong is that once you type in a valid date it can't get to the %WM_CLOSE routine without pressing the [X] unless that is what you want.

      Frank

      Comment


      • #4
        Maybe something like this?
        Code:
            CASE %IDOK
              IF GetFocus() = GetDlgItem(prg2, %PRG2_TEXT1) THEN
                IF d_prod = "" OR d_prod = "0" THEN
                  Winbeep 3000,400
                  MSGBOX("The Date Produced can NOT be BLANK or 0."+$CRLF+ _
                         "Please click (OK) or Press ENTER to Redo."),%MB_OK,"DATE CAN'T BE BLANK OR 0"
                  CONTROL SET TEXT prg2,%PRG2_TEXT1,""
                  EXIT FUNCTION
                ELSE
                  PostMessage(prg2, %WM_SYSCOMMAND, %SC_CLOSE, 0)       '<------------------------------Exit prg2
                END IF
              END IF

        Comment


        • #5
          Mr. Frank Rogers
          Sorry I didn't explain this better. I shortened both prgs to make it easier to ready quickly. What was happening with me was that when I opened prg2 and then tried to close it by clicking on the X it would not close, I had to use task manager to close it. Here is what I added to the call back function of prg1 to make it work. I added the CBCTLMSG = %BN_CLICKED.


          CALLBACK FUNCTION mainProc
          SELECT CASE AS LONG CB.MSG
          CASE %WM_COMMAND
          SELECT CASE CB.CTL
          CASE %PRG1_BUTTON1
          IF CBCTLMSG = %BN_CLICKED THEN
          DIALOG HIDE prg1
          CALL prgAdd()
          DIALOG END prg2
          END IF
          CASE %PRG1_BUTTON11
          DIALOG END prg1
          END SELECT
          END SELECT
          END FUNCTION

          Comment


          • #6
            Mr. Frank Rogers
            Sorry I didn't explain this better. I shortened both prgs to make it easier to ready quickly. What was happening with me was that when I opened prg2 and then tried to close it by clicking on the X it would not close, I had to use task manager to close it. Here is what I added to the call back function of prg1 to make it work. I added the CBCTLMSG = %BN_CLICKED.


            Code:
            CALLBACK FUNCTION mainProc
                SELECT CASE AS LONG CB.MSG
                    CASE %WM_COMMAND
                        SELECT CASE CB.CTL
                            CASE %PRG1_BUTTON1
                                IF CBCTLMSG = %BN_CLICKED THEN
                                    DIALOG HIDE prg1
                                    CALL prgAdd()
                                    DIALOG END prg2
                                END IF
                            CASE %PRG1_BUTTON11
                                DIALOG END prg1
                        END SELECT
                END SELECT
            END FUNCTION

            Comment


            • #7
              Leroy,

              With %BS_NOTIFY style applied to the ImgButton, %BN_KILLFOCUS and %BN_SETFOCUS notification messages are being sent to the Callback Function
              Code:
              IF CBCTLMSG = %BN_CLICKED THEN
              Filters them out and prevents repeated prgAdd() calls.

              - You could have omitted the %BS_NOTIFY style instead

              Rgds, Dave

              Comment


              • #8
                Never recommend not verifying %BN_CLICKED. There are messages other than %BN_KILLFOCUS and %BN_SETFOCUS that are sent under %WM_COMMAND..
                Dale

                Comment


                • #9
                  To quote the help topic for Control Add Imgbutton..

                  Notification messages are sent to the Callback Function with CB.MSG = %WM_COMMAND, CB.CTL holding the ID (id&) of the control, and CB.CTLMSG holding the following values:
                  .
                  %BN_CLICKED Sent when the user clicks a mouse button, or activates the button with the hot-key (unless the button has been disabled).
                  %BN_DISABLE Sent when a button is disabled.
                  %BN_KILLFOCUS Sent when a button loses the keyboard focus. The button must include the %BS_NOTIFY style.
                  %BN_SETFOCUS Sent when a button receives the keyboard focus. The button must include the %BS_NOTIFY style.
                  .
                  When a Callback Function receives a %WM_COMMAND message, it should explicitly test the value of CB.CTL and CB.CTLMSG to guarantee it is responding appropriately to the notification message.
                  Rgds, Dave

                  Comment


                  • #10
                    Those are not the only messages. PB Help only mentions the ones we're most likely interested in. To quote your quote plus bold -
                    it should explicitly test the value of CB.CTL and CB.CTLMSG to guarantee it is responding appropriately to the notification message.
                    %BN_CLICKED is a cb.ctlmsg message. So, explicitly test that it is %BN_CLICKED.

                    Repeat "Never recommend not verifying %BN_CLICKED." (You may chose not to check, then it is your problem; just never recommend to someone else!)
                    Dale

                    Comment


                    • #11
                      Repeat "Never recommend not verifying %BN_CLICKED."
                      Admonishment noted with thanks. My comment was more of an observation than recommendation but I do regret my lack of rigor now
                      Those are not the only messages.
                      Might be of value if you could be more specific - which messages and under which conditions they occur??
                      Last edited by Dave Biggs; 2 Nov 2019, 07:19 AM.
                      Rgds, Dave

                      Comment


                      • #12
                        Originally posted by Dave Biggs View Post
                        Admonishment noted with thanks. My comment was more of an observation that recommendation but I do regret my lack of rigor now

                        Might be of value if you could be more specific - which messages and under which conditions they occur??
                        If you look in Help under "Built In Numeric Equates", you will find the following under "Buttons" (%BN_ = Button Notification) for a start:

                        %BN_CLICKED, %BN_DBLCLK, %BN_DISABLE, %BN_DOUBLECLICKED, %BN_HILITE, %BN_KILLFOCUS, %BN_PAINT, %BN_SETFOCUS, %BN_UNHILITE

                        There are possibly a few under the "Callback" section under %NM_...as well

                        Comment


                        • #13
                          Google (without quotes) "msdn bn_clicked".
                          The left frame of the page lists other button notifications.
                          (Some say for Windows 3, but are still sent. Recommended new message/API listed for those.) BN_DOUBLECLICKED is one example of needing BS_NOTIFY style for something not in PB Help.

                          (I use MSDN in the search because it forces Microsoft links to be first.)

                          Cheers,

                          ((added - Thanks Stuart, I forgot about being listed there.))
                          Dale

                          Comment


                          • #14
                            Ok I see %BN_DBLCLK (aka %BN_DOUBLECLICKED). Does get sent if %BS_Notify is specified but is not listed in PBHelp for ImgButton

                            Those other %BN_ notifications though, seem to be obsolete (ie not used in Win32 apps)? I didn't find any clues on how they are generated yet.

                            Rgds, Dave

                            Comment


                            • #15
                              Do you want them triggering whatever %BN_CLICKED is supposed to do?
                              Dale

                              Comment


                              • #16
                                On the trail of "Other messages".. looking to see if %BN_PAINT, %BN_HILITE, %BN_UNHILITE, %BN_DISABLE ever actually occur in a Win32 app?
                                Rgds, Dave

                                Comment


                                • #17
                                  Originally posted by Dave Biggs View Post
                                  On the trail of "Other messages".. looking to see if %BN_PAINT, %BN_HILITE, %BN_UNHILITE, %BN_DISABLE ever actually occur in a Win32 app?
                                  Yes. They do.
                                  When the button is painted, the paint message is sent first.
                                  If your program allows hilite selection, the hilite messages will be sent upon hiliting or unhiliting.
                                  If you disable the button, the disable message will be sent.
                                  Since every control is a type of window, it needs messages for every change, in order for Windows to process those changes.
                                  The world is strange and wonderful.*
                                  I reserve the right to be horrifically wrong.
                                  Please maintain a safe following distance.
                                  *wonderful sold separately.

                                  Comment


                                  • #18
                                    Hi Kurt,

                                    I've not been able to cause any of those notifications in test code - have you? I thought %BN_DISABLE would be an easy candidate but not yet
                                    Rgds, Dave

                                    Comment


                                    • #19
                                      Thanks to everyone for ALL the help you supplied. The problem I was having was when I clicked on the button in PRG1 it would display my dialog in PRG2 however when I clicked the red X on the dialog in PRG2 it would NOT close the dialog. When I added the check for cbctlmsg and checked for %BN_CLICKED then everything worked like I wanted it.

                                      Comment


                                      • #20
                                        Leroy,

                                        Your solution was the correct one.
                                        As discussed above, you need to be sure that your program reacts only to the required %WM_COMMAND notification code.

                                        Here is a modified version of your original code to demonstrate some additional notification codes that could cause problems when %BS_NOTIFY is in play..
                                        (Close console window with [X] to exit).
                                        Code:
                                        #COMPILE EXE
                                        #DIM ALL
                                        #RESOURCE BITMAP, 500, "Sok_Button1.bmp"
                                        
                                        #INCLUDE "C:\PBWIN10\WINAPI\WIN32API.INC"
                                        
                                        %PRG1_BUTTON1  = 100
                                        %PRG1_BUTTON11 = 110
                                        
                                        %PRG2_LABEL1  = 151 'hDlg1
                                        %PRG2_LABEL10 = 160
                                        %PRG2_TEXT1   = 300
                                        
                                        GLOBAL Prg1,prg2 AS LONG
                                        
                                        GLOBAL fHAND1,fHAND2,fHAND3 AS LONG
                                        GLOBAL d_prod,msg AS STRING
                                        
                                        DECLARE SUB prgAdd()   'Add socks to data file
                                        
                                        
                                        FUNCTION PBMAIN () AS LONG
                                            FONT NEW "Aerial", 12,1,255 TO fHAND1
                                            FONT NEW "Aerial", 14,1,255 TO fHAND2
                                            FONT NEW "Courier New",12,1,255 TO fHAND3
                                        
                                            DIALOG NEW UNITS,%HWND_DESKTOP,SPACE$(40)+"F I N I S H E D    S O C K S    M A I N    M E N U", _
                                            150,250,370,210, %WS_OVERLAPPED OR %WS_SYSMENU, %WS_EX_OVERLAPPEDWINDOW TO prg1
                                            DIALOG SET COLOR prg1, %RGB_RED,%RGB_RED
                                         '    CONTROL ADD BUTTON, prg1, %PRG1_BUTTON1,"Add Inventory Records",20,10,150,20,%BS_CENTER OR %WS_BORDER
                                         '    CONTROL SET FONT prg1, %PRG1_BUTTON1, fHAND1
                                            CONTROL ADD IMGBUTTON, prg1, %PRG1_BUTTON1, "#500", 20, 10, 150, 20, %BS_NOTIFY     ' << test, remove %BS_NOTIFY
                                            CONTROL ADD BUTTON, prg1, %PRG1_BUTTON11,"Exit Program",135,160,100,20,%BS_CENTER OR %WS_BORDER
                                            CONTROL SET FONT prg1, %PRG1_BUTTON11, fHAND1
                                            DIALOG SHOW MODAL prg1, CALL mainProc
                                        END FUNCTION
                                        
                                        '------------------
                                        SUB CPrint (sOut AS STRING, Opt x&, y&)                         ' << ADD for test
                                         STATIC hConsole AS LONG, cWritten AS LONG
                                          SOut = SOut + $CRLF
                                          IF hConsole = 0 THEN
                                            AllocConsole : SetConsoleTitle "Test OutPut"
                                            hConsole = GetStdHandle(%STD_OUTPUT_HANDLE)
                                            SetWindowPos GetConsoleWindow, %HWND_TOPMOST, x&,y&,0,0, %SWP_NOSIZE
                                          END IF
                                          WriteFile hConsole, BYVAL  STRPTR(sOut), LEN(sOut), cWritten, BYVAL 0&
                                        END SUB
                                         '------------------/CPrint ~ monitor with console window
                                        
                                        Function Translate_nCode(nCode As Long) As String
                                          ' User Button Notification Codes = 0 ~ 7
                                          Function = Choose$(nCode+1, "%BN_CLICKED 0","%BN_PAINT 1","%BN_HILITE 2","%BN_UNHILITE 3","%BN_DISABLE 4","%BN_DBLCLK 5", _
                                                                      "%BN_SETFOCUS 6","%BN_KILLFOCUS 7" Else "Other")
                                        End Function
                                        '------------------/Translate_nCode
                                        
                                        CALLBACK FUNCTION mainProc
                                            SELECT CASE AS LONG CB.MSG
                                                CASE %WM_COMMAND
                                                    SELECT CASE CB.CTL
                                                        CASE %PRG1_BUTTON1
                                                          cPrint Translate_nCode(CB.CTLMSG), 10, 10     ' << ADD for tests
                                         '                  If CB.CTLMSG = %BN_CLICKED Then      ' Correct Fix - apply filter for notification code
                                                            DIALOG HIDE prg1                   ' opt comment out these lines for tests
                                                            CALL prgAdd()                      '  "     "     "
                                                            DIALOG END prg2
                                         '                  End If
                                                        CASE %PRG1_BUTTON11
                                                            DIALOG END prg1
                                                    END SELECT
                                            END SELECT
                                        END FUNCTION
                                        
                                        SUB prgAdd()                                                    ' << ADD for tests
                                         cPrint "prgAdd()"
                                            LOCAL msg AS STRING
                                            DIALOG NEW UNITS,0,"ADD FINISHED SOCKS ENTRY SCREEN",,,400,350, %WS_SYSMENU TO prg2
                                            DIALOG SET COLOR prg2, %RGB_BLUE,%RGB_BLUE
                                            CONTROL ADD LABEL, prg2, %PRG2_LABEL10, "",5,10,385,20,%SS_CENTER OR %SS_CENTERIMAGE OR %WS_BORDER, _
                                                              %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE
                                            CONTROL SET COLOR prg2, %PRG2_LABEL10, %RGB_BLACK, %RGB_ORANGERED
                                            CONTROL SET FONT prg2, %PRG2_LABEL10, fHAND1
                                            CONTROL ADD LABEL, prg2, %PRG2_LABEL1,"DATE PRODUCED:",5,40,110,20,%SS_CENTER OR %SS_CENTERIMAGE OR %WS_BORDER, _
                                                              %WS_EX_STATICEDGE OR %WS_EX_WINDOWEDGE
                                            CONTROL SET COLOR prg2, %PRG2_LABEL1, %RGB_BLACK, %RGB_YELLOW
                                            CONTROL SET FONT prg2, %PRG2_LABEL1, fHAND1
                                            CONTROL ADD TEXTBOX, prg2, %PRG2_TEXT1,"",125,40,80,20,%ES_LEFT, %WS_EX_CLIENTEDGE
                                            CONTROL SET COLOR prg2, %PRG2_TEXT1, %RGB_WHITE, %RGB_BLACK
                                            CONTROL SET FONT prg2, %PRG2_TEXT1, fHAND2
                                            msg = "Enter Date as MM/DD/YYYY and Press (ENTER),   (ESC) To Start Over"
                                            CONTROL SET TEXT prg2, %PRG2_LABEL10, msg
                                            CONTROL SET FOCUS prg2, %PRG2_TEXT1
                                            DIALOG SHOW MODAL prg2,CALL prgAddProc
                                        END SUB
                                        
                                        CALLBACK FUNCTION prgAddProc
                                            LOCAL msg AS STRING
                                            LOCAL lnT1&,start&,ending&
                                            SELECT CASE AS LONG CB.MSG
                                                CASE %WM_COMMAND
                                                    SELECT CASE CBCTL
                                                        CASE %IDCANCEL
                                                            msg = "Enter Date as MM/DD/YYYY and Press (ENTER),   (ESC) To Start Over"
                                                            CONTROL SET TEXT prg2, %PRG2_TEXT1, ""
                                                            CONTROL SET TEXT prg2, %PRG2_LABEL10, msg
                                                            CONTROL SET FOCUS prg2,%PRG2_TEXT1
                                                            EXIT FUNCTION
                                                        CASE %PRG2_TEXT1
                                                            CONTROL GET TEXT prg2,%PRG2_TEXT1 TO d_prod
                                                            IF CBCTLMSG = %EN_CHANGE THEN
                                                                CONTROL SEND prg2, %PRG2_TEXT1, %EM_GETSEL, VARPTR(start&), VARPTR(ending&)
                                                                lnT1& = LEN(TRIM$(d_prod))
                                                                IF lnT1& = 2 OR lnT1& = 5 THEN
                                                                    d_prod = STRINSERT$(d_prod,"/",(lnT1&+1))
                                                                    CONTROL SET TEXT prg2,%PRG2_TEXT1,d_prod
                                                                    CONTROL SEND prg2, %PRG2_TEXT1, %EM_SETSEL, start&+1, ending&+1
                                                                END IF
                                                            END IF
                                                        CASE %IDOK
                                                            IF GetFocus() = GetDlgItem(prg2, %PRG2_TEXT1) THEN
                                                                IF d_prod = "" OR d_prod = "0" THEN
                                                                    Winbeep 3000,400
                                                                    MSGBOX("The Date Produced can NOT be BLANK or 0."+$CRLF+ _
                                                                           "Please click (OK) or Press ENTER to Redo."),%MB_OK,"DATE CAN'T BE BLANK OR 0"
                                                                    CONTROL SET TEXT prg2,%PRG2_TEXT1,""
                                                                    EXIT FUNCTION
                                                                END IF
                                                            END IF
                                                    END SELECT
                                                CASE %WM_CLOSE
                                                    DIALOG NORMALIZE prg1
                                                    EXIT FUNCTION
                                            END SELECT
                                        END FUNCTION
                                        Rgds, Dave

                                        Comment

                                        Working...
                                        X