jgoodman00
Programmer
- Jan 23, 2001
- 1,510
I have the following code:
If (DistTrack) < (DistStructure) Then
TrackOrStructure = DistTrack
Else
TrackOrStructure = DistStructure
End If
DistTrack is a number, which represents the distance of an object to the track. DistStructure is a number, which represents the distance of an object to a structure.
I need TrackOrStructure to be populated with the smallest number, & as far as I can tell the above should do that. My aim is to say that if DistTrack is less than DistStructure then TrackOrStructure should be DistTrack. Otherwise it should be the distance to a structure.
However, I have a record where DistTrack = 5 & DistStructure = 11, but for some reason TrackOrStructure is set to 11.
Has anyone else ever encountered this apparent 'reverse logic' problem, & if so did they solve it??? James Goodman
j.goodman00@btinternet.com
If (DistTrack) < (DistStructure) Then
TrackOrStructure = DistTrack
Else
TrackOrStructure = DistStructure
End If
DistTrack is a number, which represents the distance of an object to the track. DistStructure is a number, which represents the distance of an object to a structure.
I need TrackOrStructure to be populated with the smallest number, & as far as I can tell the above should do that. My aim is to say that if DistTrack is less than DistStructure then TrackOrStructure should be DistTrack. Otherwise it should be the distance to a structure.
However, I have a record where DistTrack = 5 & DistStructure = 11, but for some reason TrackOrStructure is set to 11.
Has anyone else ever encountered this apparent 'reverse logic' problem, & if so did they solve it??? James Goodman
j.goodman00@btinternet.com