Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Sub or Function
#1
Not Solved
In a Sub, should we be able to:

Fax(rNum, C)
or
Fax(rNum, 1)

or do I need to use a Function?
Reply
#2
Not Solved
You can do everything in a sub that you could in a function EXCEPT that you cant return anything back.
In your examples,
If C is a variable, it works for both function and sub and i think neither function nor sub will work if you put some constant like '1' in arguments list which is absolutely of no use.
Reply
#3
Not Solved
Raj,

Thx again for your help.

For whatever reason, Fax(rNum, 1) will work as a Function but not as a Sub. passing anything back, but in a Sub, I keeping getting messages not wanting me to use ( ). But my call works Ok as a Function.

For me, Fax(rNum, 1) or Fax(rNum, 0) works great. If my function gets a 0 then it runs all of the negvative tests. Since I only want these testzs run one time, when a 1 is passed, the negative tests qarec skipped. This saves a ton of execution time.

thx for reading.



Reply
#4
Not Solved
hmmm, may be but better coding standard is to use variable name
Code:
Function Fax(rNum,runStatus)
If runStatus=0 Then
'some code here
else if runStatus=1
'some other code here
End if
End if
End Function
Reply
#5
Not Solved
I dont have gtalk. Sorry, but im scared of giving out my email address. I had a guy that started harassing me and the stalking me. To scary... sorry.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a function in a Test Script from a function library anupam4j 3 5,891 06-26-2015, 12:31 AM
Last Post: babu123

Forum Jump:


Users browsing this thread: 1 Guest(s)