You cant define proc inside another proc.
Anyway, in your journey to simplfying the button code you seem to take a direction that look really more difficult than using a sub-button class or putting all the code in the click <g>
:-)
>Hi Hilmar,
>This thread and the other one about the .h file definitions being used only once gave me an idea.
>What do you think of this?
>
>Define class _cmdBase as CommandButton
> Procedure Click1
> EndProc
> Procedure Click2
> EndProc
> Procedure Click3
> EndProc
> Procedure Click4
> EndProc
>Enddefine
>
>then inside the button:
>button.Click()
> #DEFINE get_window 'Click1'
> #DEFINE check_status 'Click2'
> #DEFINE change_status 'Click3'
> with this
> lo = .get_window(p1,p2)
> .check_status(lo)
> .change_status(lo)
> endwith
>
>button.Click1()
> ......
>
>button.Click2()
> ......
>
>button.Click3()
> ......
>
>
>Do you think it would work?
>
>Maybe even figure out a way to have properties hold the definitions, so I wouldn't even have to have the #DEFINE .... in the Click().
>Maybe have the Error() trap for them.
>Or maybe somehow have the project.build() create .h files for each button in the project and just #Include it in the Click().
If we exchange an apple, we both get an apple.
But if we exchange an idea, we both get 2 ideas, cool...Gérald Santerre
Independant programmer - internet or intranet stuff - always looking for contracts big or small :)
http://www.siteintranet.qc.ca