Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the function of a Function? 1

Status
Not open for further replies.

OfficeAnimal

Technical User
Jun 4, 2009
277
0
0
AU
I am trying to establish whether or not a call to a function is replaced by the value it generates. I have this code
Function readInput(CellIndex)
' debug
WScript.Echo "In readInput"

readInput = InputBox("Enter Coefficient " & CellIndex, vbOKOnly+vbQuestion, "Coefficient Entry")

' debug
WScript.Echo "Entered datum was " & readInput
End Function ' readInput

' ----------------------------------------------------------------------------

Sub validateTheDatum(DataArray, RunTheProgram, CellIndex, ValidSignal)
' Selection Sub to ensure only numeric data is returned

' debug
WScript.Echo "In validateTheDatum"
Dim val
val = readInput CellIndex ' <----------------------------- Debug expects end of statement here
wscript.Echo val


' <-------------------------------------------- When debugged, real code goes here


' debug
ValidSignal = False
WScript.Echo "validateTheDatum just changed ValidSignal to" & ValidSignal

End Sub ' validateTheDatum


What have I goofed up?
Thanks

"Truth will sooner come out from error than from confusion."
Francis Bacon (1561-1626)
 
Thanks strongm - Different call from Sub!

"Truth will sooner come out from error than from confusion."
Francis Bacon (1561-1626)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top