Rafael Copquin wrote on 2013-12-10:
> I am creating a class that adds a commandgroup to a form, with a
> quantity of buttons and their captions that are given to the class as
> parameters.
>
> However, I also want to send the code the click events of the buttons
> should fire
>
> I would put the code in an array or a string and send it to the class.
> Then the class would create the command group with as many buttons as
> sent as parameters and the class would then read the array or the string
> with the commands and place those commands in the click events of the
> buttons.
>
> Like
>
> cCommands= [do form one,do form two, do form three,.......]
>
> for i = 1 to nButtonsQty
> click event of command i
> getwordnum(cCommands,i,[,])
> endfor
>
> Since the number of buttons varies the class does not know what code to
> put in the click events of the buttons.
>
> I thought about the writemethod, which I never used, but am very
> confused on how to use it
> I read the Hacker's guide but the light it shed seems to be black light,
> because I can't make any sense of it.
>
> Can anyone help on this?
>
> Rafael Copquin
>
>
>
Rafael,
The WriteMethod Method is available at design time only.
Is this for a Builder?
Here's how I've used it in the past
With a form/class open for editing place the mouse pointer above the form.
In the command window (with the mouse still over the form)
OO = SYS(1270)
oo.WriteMethod("Click", "* Test Code")
It writes the code into the method. If you have multiple lines for the code,
you put the CHR(13)+CHR(10) in yourself.
HTH,
Tracy
Tracy Pearson
PowerChurch Software
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.