Proper Way To Programmatically Push a Button Displayed On

John Baughman (3/27/14 6:32AM)
Kirk Brooks (3/27/14 9:53AM)
Arnaud de Montard (3/27/14 7:08PM)


John Baughman (3/27/14 6:32 AM)

Screen

Kirk,

color><param>00000,0000,DDEE/param>II find things like this are easier
if you place all of the form's code in a
process method and then call that method from form objects.
/color>
I have not thought your suggestion through yet, but at first
glance... what a concept! Something I never thought of, and never
heard anybody else suggest it. Your suggestion also folds nicely into
the discussion of whether to use variables or object names in forms....

color><param>00000,0000,DDEE/param>IIf (Count parameters=0) ` called
by a form object

$action:=OBJECT Get name(Object current)

Else ` can be called programmatically

$action:=$1

End if
/color>
Until now, I have not read anything that would compel me to
spend
time giving objects meaningful names unless the situation required it.
I think I am going to give your suggestion a try on the next form I
create. Off the top of my head I see a couple of other advantages...

1. Sometimes the situation calls for an on timer call
instead of a
post key. This fits in really nicely for that.
2. You can easily force a "psudo" form event using your
method, ie.
to run your on load code again. I think this would be useful??


Thanks,

John

John Baughman
Kailua, Hawaii
(808) 262-0328
johnbdh@...

Kirk Brooks (3/27/14 9:53 AM)

Screen

<CAHY=XkuwFzAGF+9vyydak-=8ABONxdxqdZxiz7fRtXGRTKeHpg@mail.gmail.com>

Hi John,
Thanks for the vote up but I can't take credit for the idea. The
technique
has been talked about for a long time. When the object names became so
much
more robust, v13 for me, all the pieces fell into place - primarily the
part you quote about the call from the object being able to identify
itself. Suddenly it was possible to deal with form elements more or
less
independently of the code. Improved user feedback is a bonus too.

I completely agree with you this is a fabulous use of object names.

On Thu, Mar 27, 2014 at 9:32 AM, John Baughman
<johnbdh@...

color><param>00000,0000,DDEE/param>II have not thought your suggestion
through yet, but at first glance...
what a concept! Something I never thought of, and never heard anybody
else
suggest it. Your suggestion also folds nicely into the discussion of
whether to use variables or object names in forms....

--
/color>KKirk Brooks
San Francisco, CA
==3D==3D==3D==3D==3D==3D==3D==3D==3D==3D==3D=

Arnaud de Montard (3/27/14 7:08 PM)

Screen

Le 27 mars 2014 &yacute; 17:32, John Baughman a &Egrave;crit :

color><param>00000,0000,DDEE/param>11. Sometimes the
situation calls
for an on timer call instead of a post key. This fits in really nicely
for that.
2. You can easily force a "psudo" form event using your
method, ie.
to run your on load code again. I think this would be useful??
/color>
I use this in v12-13:

+++
?//formManager (text;long;pointer) -> error
?//read default
C_TEXT($0)
C_TEXT($1)
C_LONGINT($2)
C_POINTER($3)

$error_t:="" ?//will be filled if an error occurs
$par_t:=OBJECT Get name
$par_l:=Form event
$par_p:=OBJECT Get pointer
If (Count parameters>0)
$par_t:=$1
If (Count parameters>1)
$par_l:=$2
If (Count parameters>2)
$par_p:=$3
End if
End if
End if
Case of
: ($par_t=$formName_t) | ($par_t=($formName_t+" (@...
?//formulaire
Case of
: ($par_l=On Load)
: ($par_l=On Unload)
End case
: ($par_t="inputName")
: ($par_t="btPrint")
If ($par_l=On Data Change)
End if
End case
If (Length($error_t)>0) ?//alert or return text error
ALERT($error_t)
$0:=$error_t
End if
+++

Calling from&Ouml;
method object:
?formManager ?//without parameter
method form:
?formManager(current method name)
other:
?formManager(whatYouWant_text {;whatYouWant_long
{;->whatYouWant_pointer)

In v14, I think $3 will turn to an object.

--
Arnaud de Montard

Reply to this message

Summary created 3/27/14 at 1:13PM by Intellex Corporation

Comments welcome at: feedback@intellexcorp.com