What went wrong
Question ID: 106520
0
0

Environment ? qtp12 and powerbuilder12,

I define two functions?

*Function GetAllDataTxt (object)

GetAllData = object.Describe (datawindow.data)
End Function*

**Function GetAllDataRows (object)

GetAllDataRows = object.Rowcount
End Function**

But,Executed in the script
data = GetAllDataTxt (PbWindow ("w_mdi"). PbWindow ("w_employee_list"). PbDatawindow ("dw_1"))

This line success

rows = GetAllDataRows (PbWindow ("w_mdi"). PbWindow ("w_employee_list"). PbDatawindow ("dw_1"))

This line error, Genural Run Error

Who knows where is the problem? please help me

Marked as spam
Posted by (Questions: 1, Answers: 0)
Asked on November 19, 2015 9:24 am
71 views
Answers (1)
0
Private answer

The problem is that the function is not returning values. To return a value from a function, assign the value to the function name.

For example

Function something(myVar)
something= myVar + 2
End Function

print something(5)

Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on November 19, 2015 1:42 pm
EyeOnTesting

Welcome back to "EyeOnTesting" brought to you by Orasi Software, Inc.

X
Scroll to Top