Hi Listers I have a dialog that's not behaving as expected. Perhaps it's cos I'm rusty at the moment but I can't see anything wrong with the code. It has 2 combos. The 2nd is supposed to enable a button on the same dialog, if it finds a value in an array. But no matter what I select from the combo:
A) it keeps returning the same index B) even though a value is got from the array the button doesn't get enabled. Code is below. The vars: gnAAStage & gnSelAAID are both declared globally and initiated to 1. I originally had a "value" clause on the popup menus but commented them out in case they were resetting the vars to 1 The Sub GET_ANAL_FILES_FOLDER seems to correctly get gcAnalFolder from the array. My "Note" trace at the end of GET_ANAL_FILES_FOLDER sub reacts positively anyway (as value 1 is legal) but still the button isn't enabled. Note that I originally tried to enable it via its ID, but I've had problems with this in the past and had no joy, so I changed it to enable the handler instead. Neither works. I've put in a dummy dialog stub for now but it doesn't get invoked. Anybody see the problem? 'ppreciate it Terry McDonnell '________________________________________________ Sub PLOT_OP_FILE_DIALOG ' _____________________ Dim lnSelID as SmallInt If not glGotAAs then Note "Sorry. System cannot find Analysis Areas Table." Else DIALOG Title "Select Accessiblity Output File to plot" Width 240 ... Control PopUpMenu Position 10, 20 Width 220 Title from Variable gaAAreas Into gnSelAAID ... Control PopUpMenu Position 10, 50 Width 130 Calling GET_ANAL_FILES_FOLDER Title from Variable gaAccAnalTypes() Into gnAAStage Control Button Position 10, 70 Title "Get Output File ..." ID GET_AA_FILE_BUTTON_ID Calling GET_ANAL_FILE_DIALOG Disable Control OKButton Control CancelButton If CommandInfo( CMD_INFO_DLG_OK) Then ... End If End If End Sub '________________________________________________ Sub GET_ANAL_FILES_FOLDER '_______________________ gcAnalFolder = "" note "gnAAStage = " + str$(gnAAStage) Do CASE gnAAStage Case 1 gcAnalFolder = MISysOptions.Stage1Fold Case 2 gcAnalFolder = MISysOptions.Stage2Fold Case 3 gcAnalFolder = MISysOptions.Stage3Fold Case 4 gcAnalFolder = MISysOptions.Stage4Fold Case 5 gcAnalFolder = MISysOptions.Stage5Fold End CASE If gcAnalFolder <> "" then note "yes. gcAnalFolder = " + gcAnalFolder ' Alter Button ID GET_AA_FILE_BUTTON_ID enable Alter Button GET_ANAL_FILE_DIALOG enable Else Note "There is no folder specified for this type of Accessiblity Analysis File." Alter Button ID GET_AA_FILE_BUTTON_ID disable End If End Sub '________________________________________________ Sub GET_ANAL_FILE_DIALOG '_______________________ DIALOG Control OKButton Control CancelButton End Sub _______________________________________________ MapInfo-L mailing list MapInfo-L@lists.directionsmag.com http://www.directionsmag.com/mailman/listinfo/mapinfo-l