//-------------------------------------------------------------> // ReportUnusedLocals.vw // R.Worsley 3/09/2008 // UI for class to Locate any unused local variables //-------------------------------------------------------------> Use Windows.pkg Use DFClient.pkg Use File_dlg.pkg Use cTextEdit.pkg Deferred_View Activate_oReportUnusedLocals for ; Object oReportUnusedLocals is a dbView Set Border_Style to Border_Thick Set Size to 220 300 Set Location to 2 2 Set Label to "Search for Unused Locals" Set piMinSize to 180 300 Procedure Entering_Scope Returns Integer Integer iRetVal iScreenOrFile String sFileName Forward Get msg_Entering_Scope to iRetVal If (not(iRetVal)) Begin Get psFileName of oApplication to sFileName Get piScreenOrFile of oApplication to iScreenOrFile If (sFileName <> "") Begin Set value of oSourceName to sFileName Set Current_Radio of oOutputRadioGroup to iScreenOrFile Send OnClick to oProcess_Btn End Set Enabled_State of oSourceName to (sFileName = "") End Procedure_Return iRetVal End_Procedure Use ReportUnusedLocals.pkg Object oReportUnusedLocals is a cReportUnusedLocals End_Object Object oOpenDialog is a OpenDialog Set Dialog_Caption to "Select source code" Set Initial_Folder to (sGetSourceDirectory(oReportUnusedLocals(Self))) End_Object Object oSourceName is a Form Set Size to 13 221 Set Location to 9 68 Set Label_Col_Offset to 2 Set Label_Justification_Mode to jMode_Right Set Label to "Source to Check:" Set Prompt_Button_Mode to PB_PromptOn Set Form_Button_Bitmap 0 To 'Prompt.Bmp' Set peAnchors to anTopLeftRight Procedure Prompt Integer bOk String sFileName Get Show_Dialog of oOpenDialog to bOk If (bOk) Begin Get File_Name of (oOpenDialog(Self)) to sFileName Set Value to sFileName End End_Procedure End_Object Object oOutputRadioGroup is a RadioGroup Set Location to 28 47 Set Size to 30 201 Set Label to "Output" Set peAnchors to anTopLeftRight Object oRadio1 is a Radio Set Label to "Output Box" Set Size to 10 61 Set Location to 12 16 End_Object Object oRadio2 is a Radio Set Label to "File - UnusedLocals.log" Set Size to 10 93 Set Location to 12 99 End_Object Procedure Notify_Select_State Integer iToItem Integer iFromItem Forward Send Notify_Select_State iToItem iFromItem End_Procedure End_Object Object oProcess_Btn is a Button Set Location to 198 171 Set Label to "Process" Set peAnchors to anBottomRight // fires when the button is clicked Procedure OnClick String sFilename Integer iOutPutType Get Value of oSourceName to sFileName Get Current_Radio of oOutputRadioGroup to iOutputType Set psSourceName of oReportUnusedLocals to sFileName Set piOutputType of oReportUnusedLocals to iOutputType Send Delete_Data to oVarDisplay Send doProcess to oReportUnusedLocals End_Procedure End_Object Object oExit_Btn is a Button Set Location to 198 238 Set Label to "Exit" Set peAnchors to anBottomRight Procedure OnClick Send Exit_Application End_Procedure End_Object Object oVarDisplay is a cTextEdit Set Size to 124 269 Set Location to 66 17 Set peAnchors to anAll Set Read_Only_State to True End_Object Cd_End_Object