[Gambas-user] enumerate forms

Richard richard.j.walker at ...247...
Mon Jan 28 20:54:16 CET 2008


On Monday 28 January 2008 12:37:39 Steven Lobbezoo wrote:
> Le Sunday 27 January 2008 22:15:39 Benoit Minisini, vous avez écrit :
> > On dimanche 27 janvier 2008, Steven Lobbezoo wrote:
> > > Le Sunday 27 January 2008 15:41:36 Stefano Palmeri, vous avez écrit :
> > > > or better:
> > > >
> > > > DIM sFormName AS String
> > > >
> > > >   FOR EACH sFormName IN Dir(Application.Path, "*.form").Sort()
> > > >     PRINT file.BaseName(sFormName)
> > > >   NEXT
> > > >
> > > > Stefano
> > > >
> > > > ---------------------------------------------------------------------
> > > >-- -- This SF.net email is sponsored by: Microsoft
> > > > Defy all challenges. Microsoft(R) Visual Studio 2008.
> > > > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> > > > _______________________________________________
> > > > Gambas-user mailing list
> > > > Gambas-user at lists.sourceforge.net
> > > > https://lists.sourceforge.net/lists/listinfo/gambas-user
> > >
> > > Thanks Stefano.
> > > I did the same, untill it came to me :-(  that in the execution
> > > environment these files are not there.
> > > So, it can't be done like this.
> > > However, since I can call forms by name (open formname), the data must
> > > be available somewhere in the executable.
> > > I will continue playing detective.
> > >
> > > Thanks,
> > > Steven
> >
> > In the executable, you have only the object files, but you can't know
> > anything about them before loading them. They are loaded the first time
> > the class is used.
> >
> > Please explain why you need to know the forms of your projects at
> > runtime, maybe another way of doing what you want exists.
> >
> > Regards,
>
> I know, but a thought maybe I can scan the executable for a marker, and
> then get the names of the forms. However, I saw that they are mixed with
> other variables in the executable, so it's not possible either.
>
> What I try to do is implement a access rules system in my software.
> The big boss with the user can define (in a Mysql Table) rules for
> read/Update/Delete/Create acces THe rules depend on the table / search ,
> the user (and it's level), the contents of the records and the form name.
>
> Of course, I can just make a formnames array by hand, but I thought it
> would be easy to do it automatically, specially since we're adding forms on
> a day to day basis.
>
> Regards,
> .
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user

Apologies if this sounds naive, but if I were implementing access controls at 
form level in an application I would probably create an access control mask 
property for each form and check it in the form's access methods against the 
user's access rights as obtained/derived from your MySQL table.

I did something like this a few years ago for a college VB project:~(




More information about the User mailing list