Delphi 5 Pro lies about my not using variable
Delphi 5 claims I never use the value returned by a function. This is
not true, I do us it later in the code if a logical test is passed. But
since Delphi 5 doesn't think I am using the variable, it doesn't bother
saving the value my function returns. Can anything be done? See code
segments below:
....
BlankIndex : Integer ;
LastUseIndex : Integer ;
NewLstUseIndex : Integer ; { Declair in VAR section of procedure }
..........
if ( Application.MessageBox( 'First line of Last Login Log cont
incorrect, Cancel Processing?',
'Error in Log file', MB_YESNO + MB_ICONERROR ) = ID_YES ) then
Close() ;
DateChecked := Now ;
repeat
Readln( LF, Line ) ;
BlankIndex := Pos( ' ', Line ) ;
UserName := Copy( Line, 0, BlankIndex - 1 ) ;
if ( NOT IsSystemAccount( UserName, SystemLogIns ) ) then
begin
WorkStr := StrPos( PChar(Line), NeverLoggedIn ) ;
if ( WorkStr = nil ) then
begin { couldn't find Never Logged In string, set last login
record for this user }
NewLastLogin := GetLastLogDate( Line ) ;
NewLstUseIndex := GetNextIndexToLastLogDB ; { function
!should! assign value to NewLstUseIndex }
...........
LastUseIndex :=
HiveUserDataModule.LastLoginQueryForUser.FieldValues['LastUseIndex'] ;
if ( LastUseIndex <> 0 ) then
begin
LastLogin :=
HiveUserDataModule.LastLoginQueryForUser.FieldValues['Date_Last_Logon']
;
if ( LastLogin < NewLastLogin ) then LastLogin :=
NewLastLogin ;
end
else
begin { This is a new LastLog Record, Get next index value
LastUseIndex := NewLstUseIndex ; { I use NewLstUseIndex
here!! but do not have valid value }
LastLogin := NewLastLogin ;
end ;
{ set
--
Jon W. Robinson
Principal Scientist
Raytheon ITSS
Code 935
Building 28, Room W192
Goddard Space Flight Center
Greenbelt, MD 20771
301 286-0681 (Phone)
301 286-1776 (FAX)
|
|
robinson.vcf
< 1K
Download
|