Defined Function question

fredfortsonsr

Registered User.
Local time
Today, 19:38
Joined
Apr 11, 2001
Messages
15
Hi, I have a question involving a function that exists in a Module. (I am reviewing someone elses program)

The Function is quite lengthy, but begins like such.
*****************************
Sub FindDewPoint(fIsTable As Boolean)
*****************************
Now, inside the form is the following code that calls the function.
My question is why is the word FALSE following it? The same for the 3 functions following it. Is the programmer saying NOT to run the function? Doesn't seem so.
I am also thinking that he was simply setting the value of the Function to FALSE upon starting, but then results of the Function could change that.

If [Gas Phase] Then
FindDewPoint False ' Run this Function in Module 1
Moles False
PreCalcEnd False
Module1.Weight (False)
End If

Any opinions out there?

Thanks
Fred
 
OK. I acknowledge that it's not a Function, but a Sub.

Still, by using FindDewPoint FALSE what is the programmer saying? Does he
want to run the Sub? Is he required to pass either a TRUE or FALSE
parameter? Does it matter which parameter is passed since if the Sub runs it
will create it's own result?

Curious.

Fred
 
OK. I studied a bit more and have some more insight. Now I realize that he is passing the Boolean FALSE to the SUB.

I follow the SUB and here's a section of code that doesn't make senseby passing FALSE to it:

' Get the form's mixture id number
If fIsTable Then
MixtureId = Forms![frmBackCalcMixtable]!MixtureId
Else
MixtureId = Forms![frmPreCalcMixtures]![MixtureId]
End If

The way I read it is:
If FALSE Then.....

If WHAT'S FALSE? It would seem that he should be saying TRUE, then at least I could assume he was saying IF the FORM is OPEN or something.

All those lines of code are doing is getting the Mixture ID from one of two forms that may be loaded.

Any idea what he was doing with that argument?

Thanks

Fred
 

Users who are viewing this thread

Back
Top Bottom