Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Illegal Redefinition of Variable???
Message
From
23/03/2002 15:59:22
Henry Ravichander
RC Management Systems Inc.
Saskatchewan, Canada
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00636472
Message ID:
00636504
Views:
20
>Hi, Ravi!
>
>>>
>No, I tie textboxes to varaiables
><<
>
>Why do you do this this way?
>
>The better way to encapsulate all storage (means also all variables) of a form is to store it within the form itself:
>
>- mMedName is declared as property of the form
>- ThisForm.mMedName is the ControlSource for Text1.
>- If the user enters a new value into Text1, this new value is then inserted into the Prescriptions table, when the Save button is clicked.
>
>
INSERT INTO Prescriptions(PresRef, MedName, orderdate, healthnum,;
>docnum, docname, physref,PatientNam) ;
>VALUES (mTabRef, <b>ThisForm</b>.mMedName, mdate, mHealthNum, mDocnum, mDoctor, mPhysRef,;
>	mPatientName)
>
>* Clear the contents of the variable to hold new info
>ThisForm.mMedName = ""
>
>
>The result is the same, but no conflicts with other forms!
>

>BTW: Using such possibilities of encapsulation is one of the important issues of OOP!
>From here comes the "Golden Rule" of OOP in VFP: Never more than one PUBLIC variable is allowed, and this one is used for goApp - all other stuff is stored in properties!


I'll give it a shot Sebastian.

- Ravi
- Ravi

True greatness consists in being great in little things.
- Charles Simmons
Previous
Reply
Map
View

Click here to load this message in the networking platform