Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Function calling a another funtion in functional library
#1
Not Solved
Hi Can u please suggest a way to rectify

Im having a functional library with the code

Function 1 (stra)
{
Function 2(strc)
}
Funtion 2(strd)
{
{

It gives me error in the 3 statement while executing Wrong number of arguments or invalid property assignment: 'SelectSnoMedValue'

The same thing execute when i run function 2 seperately in my action

Please suggest a way

the
Reply
#2
Not Solved
OK. Maybe you are just getting caught in the when to use parenthesis or not issue. If you are assigning a variable with a function return you need them. If you are just calling a function or sub and not returning a value...you don't need them.

Code:
Function func1 ()
   'Call function 2 and pass value and get the return
   returnval = func2("Call func2 and return value")
   msgbox returnval
   'Call function or sub without a return value
   func3 "Call func3"
End Function

Function func2(strd)
  'do something here and return value
  func2 = "func2: " & strd
End function

Function func3(strf)
   'do something but no return value
   msgbox "func3: " & strf
End Function

Hope this helps.
Reply
#3
Not Solved
HI ,

Sorry for the last thread im not using any parenthesis
I have a funtional libray say y
im defining two funtion ,One funtion calling another funtion it gives me that error
Code:
Public Function Record(stname,strage)
    Browser("LorPrimary").Page("LorMain").Frame("Search").webedit("as").set "name"
call selectdtpicker(strage)
end funtion

Public Function age(strage)

Browser("LorPrimary").Page("LorMain").Frame("Search").datepeicker("as").set strage 'the date picker is an custon type

end funtion


In my action
i call
Theis funtion Record("ss","13/01/1987")

it gives me an error
Reply
#4
Not Solved
Where are you using the variable stname?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Calling a Function in Function Library when function is defined in an Action jitenderkkr 0 2,926 11-27-2014, 12:53 PM
Last Post: jitenderkkr
  calling QTP script from one to another krishnas.tester 3 6,695 11-12-2014, 10:32 AM
Last Post: vinod123
  calling stored procedure from Oracle borisk 3 6,419 03-19-2013, 12:41 PM
Last Post: gaveyom
  Function written in Func library is not returning values but works in same script Shwethareddy 5 4,623 02-25-2013, 10:55 AM
Last Post: vinod123
  Function is not calling from subdriver qtpexpert 0 2,055 01-18-2013, 12:25 PM
Last Post: qtpexpert

Forum Jump:


Users browsing this thread: 2 Guest(s)