>Thank you for your answer. I will try your example.
>
>Only one more question: How can I fill the vars and take the data in it to another form while the vars cannot be public?
>
>Greetings,
>Ron
Ron,
You can do it in many ways. What I find easy (and could be used with modal forms that can only return a single variable like functions do) is to create an object, put parameters as its properties (and even a whole table if I need). ie:
Searched and found my customer in current table. I want to return all fields of this record:
scatter name oCustomer
return oCustomer
oCustomer.Cust_id is same as Customer.Cust_id of my record ...
Or as an another example, I want to return all records of a table and info how many records I'm returning (I might need such a thing for various reasons, ie: cursors can't pass between datasessions but objects can, on a form I might want to manage multiple rows at a time etc):
oEmployees = GetRecsSample()
? oEmployees.RecordCount
For ix=1 To oEmployees.RecordCount
? m.ix,oEmployees.Record[m.ix].First_name,oEmployees.Record[m.ix].Last_name
Endfor
Function GetRecsSample
Select * From employee Into Cursor myCursor
oReturn = Createobject('custom')
oReturn.AddProperty('RecordCount',Reccount('myCursor'))
oReturn.AddProperty('Record['+Trans(Reccount('myCursor'))+']')
Scan
Scatter Name oReturn.Record[recno()]
Endscan
Return oReturn
endfunc
Cetin