1

The LA Fox Developer
A Newsletter for FoxPro Application Developers in Southern California
Visit our WebSite at: http://www.mesllc.com/lafox.html
December 1998
Using (or not) the Value
Assign Method
by Russell Campbell
Access and assign methods have been added to VFP 6. These are methods that are fired when a property is assigned a value or a property’s value is accessed. For instance, you could have a caption assign method and a caption access method. These are not automatically part of an object, but can be added very easily in the class designer. The methods are named with the property name plus “_access” or”_assign”. Therefore the caption access method is named “caption_access” and the caption assign method is named "caption assign". Caption_assign fires anytime you change the object’s caption (oMyObject. Caption = “Customer”) and caption_access fires anytime you access the object’s caption (MyVar = oMyObject.Caption). Each property can have an access and/or assign method associated with it.

When I first learned about access and assign methods no ideas for immediate uses jumped out at the however my gut instinct
told me that they would come in useful. It wasn’t long before my gut instinct proved to be correct.

I was working on a form dealing with product costs. To calculate the total cost of a product, I had to add up the material costs, the internal labor costs, and any outside costs. There is a textbox on each screen that displays each of these three costs and there is a textbox for the total cost. Each of these costs need to be updated when other fields change. A standard approach to this would be to have each of those fields call a method that calculates the new cost, changes the field that displays the new cost, and then calls a method to calculate the total cost. Instead of using this technique, I decided that this might be a good place to use an assign method. The fields that related to the subcosts (quantity, price, etc.) would simply recalculate the subcost and assign it to the related subcost textbox. That textbox would have a value_assign method that would in turn call the routine that calculated the total cost. Although not an incredible simplification, it did centralize the call to the method that calculated the total cost and it gave me an opportunity to work with and learn about assign methods.

(Con’t, page 4)

In this issue
12 Bugs of Christmas
John Rivard Interview
Dates and Time
At LA Fox

December 21, 1998, 6:30 PM, Ken Levy and The Annual LA Fox Christmas Party. It’s that time of the year again. Come join us for merriment, good times, fox fellowship, and tasty treats. Ken will be demonstrating the latest and greatest of whatever he’s been working on and The White Elephant Gift Exchange will be happening again. So come prepared for a good time. For more on the Christmas Party, see the article on Page 13.

January 18, 1999, 6:30 PM, Miriam Liskin. Miriam is extremely well-known for her contributions to the FoxPro community. She writes a regular column for FoxPro Advisor and has authored many books on the subject of FoxPro application development. Her most recent books are Miriam Liskin’s Visual FoxPro Expert Solutions (Que) and PC Magazine Programming FoxPro 2.5 (Ziff-Davis). Miriam’s presentation on Builders was one of the highlights of the August conference. This night, to paraphrase Monty Python, she’ll be presenting something completely different. You don’t want to miss this one.


Elsewhere
VISUAL FOXPRO DEVCON 99, June 6-10 Palm Springs.
The Tenth Anniversary of Microsoft Visual FoxPro and DevCon! Don’t miss Tenth Anniversary VISUAL FOXPRO DEVELOPER CONFERENCE 1999, the annual gathering of FoxPro developers from around the world. VISUAL FOXPRO DEVCON is essential technical education for serious FoxPro developers.
(Con’t, page 2)

Page 3
Page 5
Page 8
and much more!
Out and About
by Barry R. Lee
The December meeting of LA Fox will be held on Dec. 21, 1998, at 6:30 PM at our regular meeting place (the Torrance Airport, 3301 Airport Drive, in Torrance). For details on how to get there, see the map on the back page.

1