I have a button on my toolbar that allows the user to save the results of a search.
Here's the code from the parent class click event:
Here's the code in the instance that is causing me a problem:
As you can see from my comments, the MESSAGEBOX line is never executed.
Can anyone advise me why this might be?
Thanks,
Stewart
Here's the code from the parent class click event:
Code:
LOCAL FileName, OriginalDirectory, StartDirectory, TextBoxObject, FileType
TextBoxObject = THIS.Textbox [COLOR=green][b]&& custom property[/b][/color]
OriginalDirectory = SET([Directory]) [COLOR=green][b]&& the current directory[/b][/color]
StartDirectory = FredUser(THIS.FredUserStartDirectoryRef, [c:\temp\], [RD]) [COLOR=green][b]&& ...get, from user's preference table, the last folder they looked in[/b][/color]
IF DIRECTORY(StartDirectory)
CHDIR (StartDirectory) [COLOR=green][b]&& change to path returned by FredUser, or...[/b][/color]
ELSE
CHDIR c:\temp [COLOR=green][b]&& ...if that folder doesn't exist, go to one that does[/b][/color]
ENDIF
FileType = THIS.Filetypes [COLOR=green][b]&& *.dbf, *.csv etc etc[/b][/color]
FileName = GETFILE(FileType,"Letter name :-","OK",0,"Select the pic file you want") [COLOR=green][b]&& get the user to select a file / enter a new filename[/b][/color]
CHDIR (OriginalDirectory) [COLOR=green][b]&& return to original directory[/b][/color]
IF NOT EMPTY(FileName) [COLOR=green][b]&& check that a filename was returned[/b][/color]
&TextBoxObject..Value = FileName [COLOR=green][b]&& set the Value property of the TextBox to the path/filename[/b][/color]
&TextBoxObject..ToolTipText = IIF(LEN(FileName) > _ToolTipTextMaxLen, LEFT(FileName, _ToolTipTextMaxLen-3)+[...],FileName) [COLOR=green][b]&& set the ToolTipText the same[/b][/color]
=FredUser(THIS.FredUserStartDirectoryRef, JUSTPATH(FileName)) [COLOR=green][b]&& update preference table[/b][/color]
IF NOT EMPTY(THIS.FredUserFilePathName) [COLOR=green][b]&& update preference table[/b][/color]
=FredUser(THIS.FredUserFilePathName, FileName)
ENDIF
ENDIF
Here's the code in the instance that is causing me a problem:
Code:
DODEFAULT()
LOCAL lContinue, PreviousSafety
lContinue = .T.
IF FILE([THIS.Parent.txtResults.Value])
SET BELL TO [C:\Program Files\Microsoft Office\OFFICE11\MEDIA\BOMB.WAV] [COLOR=green][b]&& ...this line is executed[/b][/color]
? _Chime [COLOR=green][b]&& this line is executed[/b][/color]
MbResponse = MESSAGEBOX("File " + THIS.Parent.txtResults.Value + " already exists." + CR + "Are you sure you want to overwrite it?",MB_YESNO+MB_QUESTIONICON,"Foundation - saving results") [COLOR=green][b]&& this line is NOT executed - that is, no MessageBox appears[/b][/color]
lContinue = MbResponse = MB_YES [COLOR=green][b]&& I don't know if this line runs[/b][/color]
ENDIF
IF lContinue [COLOR=green][b]&& at this point, lContinue is TRUE[/b][/color]
PreviousSafety = SET("SAFETY")
SET SAFETY OFF
_SCREEN.LockScreen = .T.
SELECT StdResults
COPY TO (THIS.Parent.txtResults.Value)
GO TOP
_SCREEN.LockScreen = .F.
SET SAFETY &PreviousSafety
ENDIF
Can anyone advise me why this might be?
Thanks,
Stewart