Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
_Assign method works like a _Access method
Message
From
06/01/2000 03:21:55
 
 
To
05/01/2000 21:08:32
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00313402
Message ID:
00313776
Views:
61
Hi Erik,
Put the following code into a .PRG and run it, click on the button.

**********************************************************
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN

*-- Form: form1 (d:\test\form_assign.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 01/06/00 10:13:09 AM
*
DEFINE CLASS form1 AS form


DoCreate = .T.
Caption = "Form1"
Name = "Form1"


ADD OBJECT command1 AS commandbutton WITH ;
Top = 84, ;
Left = 252, ;
Height = 49, ;
Width = 61, ;
Caption = "Command1", ;
Name = "Command1"


PROCEDURE width_assign
LPARAMETERS vNewVal
*To do: Modify this routine for the Assign method
THIS.WIDTH = m.vNewVal
wait window 'width_assign fired:' + ALLT(STR(m.vNewVal))
ENDPROC


PROCEDURE command1.Click
local lnWidth
lnWidth = thisform.Width
ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************

These are the steps produced that code:
1.Open a new form
2.Add to it Width_Assign method
3.Go to the newly created method and add the following line at the bottom:

wait window 'width_assign fired:' + ALLT(STR(m.vNewVal))

4.Add a button to the form and in its Click event put the following code:

local lnWidth
lnWidth = thisform.Width

(5.Save the form, close it, open it in the class browser)

Thanks for your interest!
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform