×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

What is the function of a Function?

What is the function of a Function?

What is the function of a Function?

(OP)
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)

RE: What is the function of a Function?

val = readInput(CellIndex)

RE: What is the function of a Function?

(OP)
Thanks strongm - Different call from Sub!

"Truth will sooner come out from error than from confusion."
Francis Bacon (1561-1626)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close