> In the main PRG, declare a public variable.
>
>
> Public pRights
>
>
>
> Now in your LOG IN form, assign a value to it accordingly.
>
>
> pRights = UserTable.URights && can be logical or numeric
>
>
>
> In your menu, you can use Skip For pRights = [logical or numeric]
You are right, that would work.
As for the Public declaration itself - as you know, there have been a few public discussions already here and elsewhere and many people say "Public variables are bad".
Why do they say so? Long story of course - often Public variables are misused when form.properties would be better. That's not the case here of course.
Another point is that when in your example you'd create an undeclared variable in "main.prg" instead of the Public one, and additionally use the Private keyword, you would be able to do an Do your.EXE inside your.EXE itself (rare requirement).
My personal reason not to use Public here would be that when we need an m.pRights variable, we may also want an pUserName and perhaps a pUserID, and perhaps even a NewUserLogin() procedure, and in other contexts we might need other variables and would end up with 10 or 30 of them, and they would be created and assigned and accessed all over all project files and it would get difficult to maintain them.
That's why the OOP concept would suggest using classes and create objects at runtime. Such an object would be a "boxed" module with an easy "interface", hiding all complexity so that it's easy to use.
Still that object, say goApp, would need to be in scope for the entire application - so you can again use the "Private" keyword and createobject() it in an undeclared variable in main.prg
Afterwards, in the menu, you can use Skip For ( Type("m.goApp.nUserLevel")<>'N' OR m.goApp.nUserLevel < 5 )
hth
-Stefan