>Dear Experts
>
>There are more than 100 Forms in my Project.
>I want to use following codes in the INIT event of some 50 Forms.
>I want to ask:
>Should I use CLASS or some Procedure and how?
>
>Please help
>
>
>select u_right
>locate for usno=m.usno and uname= juststem(sys(1271,thisform))
>if found()
> allow_rights= rights
> if allow_rights=0
> messagebox("Not Allowed",0+16+512,"No Permission")
> return.f.
> endif
>else
> messagebox("Not Allowed",0+16+512,"No Permission")
> return.f.
>endif
>
Have you already made these forms and now you find you need to add this extra functionality to them?
If that is the case then you may have to edit your forms' as tables, eg:
Use MyForm.scx
Browse
Then change the Class, Classloc and maybe BaseClass fields to those of your new class.
Then USE to close the form "table"
Then you can edit the form in the normal way and it will have inherited all the class's methods, properties etc.
WARNING: Make a back up of the forms before you do this.
But, by the time you've done this to 50 forms it might be just as quick, and less trouble, to edit each form and put that code snippet in the .Init, but not as OO-encapsulated as it should be. :-)
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.