Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Forms, Methods and parameter passing
Message
From
06/02/2002 11:08:05
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
06/02/2002 10:46:21
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00615998
Message ID:
00616078
Views:
31
>To answer your question below - YES the code below is the propery_access method
>
>YOUR COMMENTS BELOW
>---------------------------------------------------------
>David,
>If I'm reading it right there is a 'property' called price not a method.
>
>* Which object is this? Is this price_access method itself ?
>parameters ItemNumber
>this.price=ItemNumber+1
>return this.price

David,
You're querying a property. If you include a parameter with it VFP tries to return you an array value (it could be an array property where you were requesting nth element).

You could do that with _Assign however.

*Price_Assign
parameters ItemNumber
this.price=ItemNumber+1

this.Price = 5
replace myField with this.Price

For a form method like you sampled in your code (replace...) add a method to form say GetPrice. Then in GetPrice method you could code freely like in old good days :

* Form.GetPrice 'method'
lparameters tnItemNumber
external array arrPrice
select price from products where ItemId = tnItemNumber into array arrPrice
return iif(_Tally=0,0,arrPrice)

* Commandbutton.click
replace myfield with thisform.GetPrice(thisform.ItemNo)

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform