pgraham9999 0 Posted February 6, 2021 I have a unit in a large project that does a zip backup of the data files at close. The main zip procedure declares a variable Dir:TDirectory; which is used to retrieve file names for the backup: sl:=StrArray(Dir.GetFiles(SourceDir)); I then pass sl to the zip file. It works correctly. However, compile gives a warning "variable 'Dir' is declared but never used". If I remove the variable, compile fails. I don't like to leave warnings! How can I remove this one? Share this post Link to post
Attila Kovacs 629 Posted February 6, 2021 just write sl:=StrArray(TDirectory.GetFiles(SourceDir)); and drop "Dir" Share this post Link to post
David Heffernan 2345 Posted February 6, 2021 It is a class method. Use the class as the subject of the method call. Share this post Link to post
pgraham9999 0 Posted February 6, 2021 That was too easy! The following {$IFDEF MSWINDOWS} ReportMemoryLeaksOnShutdown := DebugHook <> 0; {$ENDIF} gets warning "Symbol 'DebugHook' is specific to platform" Didn't I just say that! Share this post Link to post
FPiette 383 Posted February 7, 2021 9 hours ago, pgraham9999 said: That was too easy! The following {$IFDEF MSWINDOWS} ReportMemoryLeaksOnShutdown := DebugHook <> 0; {$ENDIF} gets warning "Symbol 'DebugHook' is specific to platform" Didn't I just say that! To remove that warning, go to menu, project, options, building, Delphi compiler, hints and warnings and expand output warnings and set platform symbol to false. Share this post Link to post
Vandrovnik 214 Posted February 7, 2021 2 hours ago, FPiette said: To remove that warning, go to menu, project, options, building, Delphi compiler, hints and warnings and expand output warnings and set platform symbol to false. There are also directives for these warnings: {$WARN UNIT_PLATFORM OFF} {$WARN SYMBOL_PLATFORM OFF} 1 Share this post Link to post
pgraham9999 0 Posted February 7, 2021 SYMBOL_PLATFORM OFF did it! Thanks. My mind is just too old for the little things! Share this post Link to post