dbTalk Databases Forums  

Software for Humans Eventscript

comp.databases.filemaker comp.databases.filemaker


Discuss Software for Humans Eventscript in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tony Bowles
 
Posts: n/a

Default Software for Humans Eventscript - 05-31-2007 , 09:44 AM






I have been using this plug-in for about a year in just a single
instance up to now but have a need to make fiurther use of it.

The first use of it has been performing as intended, but looking at the
code to refresh my memoey on how to set it up, it seems that this has
been working in spite of my coding rather than because of it. In this
case it is being used to change the current data input layout if the
type of records being input changes. I have 5 different types of record
with small differences in the fields used, each being maintained by a
separate layout, but all applying records to a single data table. There
is a record type field on all the layouts and the script called by
Eventscript checks whether this field still matches the layout name
after the entry of a new record and if necessary switches to the
appropriate layout.

The coding set up & functioning OK in its key respect is as follows:

If (IsEmpty (organisation_type);

0 & S4HU_Eventscript (Get (FileName); "NotAllowed" ; "");

1 & S4HU_Eventscript (Get (FileName); organisation_type ; "");

As you can probably guess my understanding of calculation formulae is
somewhat lacking at the moment , all I know that the script "NotAllowed"
intended to be run to prevent the record type field being blanked is
never called. In deliberately blanking the field, the coding just lets
it happen.

Any help that anyone can offer would be appreciated

Thanks

Tony

Reply With Quote
  #2  
Old   
Matt WIlls
 
Posts: n/a

Default Re: Software for Humans Eventscript - 05-31-2007 , 10:47 AM






In article <E4GdnajhSoyjfcPbRVnyjAA (AT) bt (DOT) com> Tony
Bowles<anthony.bowles (AT) btinternet (DOT) com> wrote:

Quote:
I have been using this plug-in for about a year in just a single
instance up to now but have a need to make fiurther use of it.

The first use of it has been performing as intended, but looking at
the code to refresh my memoey on how to set it up, it seems that this
has been working in spite of my coding rather than because of it. In
this case it is being used to change the current data input layout if
the type of records being input changes. I have 5 different types of
record with small differences in the fields used, each being
maintained by a separate layout, but all applying records to a single
data table. There is a record type field on all the layouts and the
script called by Eventscript checks whether this field still matches
the layout name after the entry of a new record and if necessary
switches to the appropriate layout.

The coding set up & functioning OK in its key respect is as follows:

If (IsEmpty (organisation_type);

0 & S4HU_Eventscript (Get (FileName); "NotAllowed" ; "");

1 & S4HU_Eventscript (Get (FileName); organisation_type ; "");

As you can probably guess my understanding of calculation formulae
is somewhat lacking at the moment , all I know that the script
"NotAllowed" intended to be run to prevent the record type field
being blanked is never called. In deliberately blanking the field,
the coding just lets it happen.

Any help that anyone can offer would be appreciated

If you look at the function itself (in the Specify Calculation dialog,
as if you were adding it to a calc), you'll see that the syntax is
S4HU_EventScript ( Get ( FileName ) ; YourScriptName ;
{OptionalScriptParameters} )
Thus, your calc says

If organisation_type is empty
make the value 0 and run the script "NotAllowed"
otherwise
make the value 1, but instead of a script name you have
organisation_type, which is the name of the field.
The thing is, whenever you change the value of the field, it will then
cause EventScript to run the script again no matter what. So, in the
above, if organisation_type is empty, you change it to 0 (script is
run), otherwise change it to 1 (script is run again). Activate Script
Debugger and watch it happen.
Alter the scheme so that a change to the field runs the script, but
make the script itself do the evaluation. Put a trap at the beginning
of the script to exit if the value of organisation_type is such that
the script should not continue.
Matt




--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo



Reply With Quote
  #3  
Old   
Matt WIlls
 
Posts: n/a

Default Re: Software for Humans Eventscript - 05-31-2007 , 10:52 AM



In article <E4GdnajhSoyjfcPbRVnyjAA (AT) bt (DOT) com> Tony
Bowles<anthony.bowles (AT) btinternet (DOT) com> wrote:

Quote:
I have been using this plug-in for about a year in just a single
instance up to now but have a need to make fiurther use of it.

The first use of it has been performing as intended, but looking at
the code to refresh my memoey on how to set it up, it seems that this
has been working in spite of my coding rather than because of it. In
this case it is being used to change the current data input layout if
the type of records being input changes. I have 5 different types of
record with small differences in the fields used, each being
maintained by a separate layout, but all applying records to a single
data table. There is a record type field on all the layouts and the
script called by Eventscript checks whether this field still matches
the layout name after the entry of a new record and if necessary
switches to the appropriate layout.

The coding set up & functioning OK in its key respect is as follows:

If (IsEmpty (organisation_type);

0 & S4HU_Eventscript (Get (FileName); "NotAllowed" ; "");

1 & S4HU_Eventscript (Get (FileName); organisation_type ; "");

As you can probably guess my understanding of calculation formulae
is somewhat lacking at the moment , all I know that the script
"NotAllowed" intended to be run to prevent the record type field
being blanked is never called. In deliberately blanking the field,
the coding just lets it happen.

Any help that anyone can offer would be appreciated

Thanks

Tony

If you look at the function itself (in the Specify Calculation dialog,
as if you were adding it to a calc), you'll see that the syntax is
S4HU_EventScript ( Get ( FileName ) ; YourScriptName
;{OptionalScriptParameters} )

Thus, your calc says

If organisation_type is empty
make the value 0 and run the script "NotAllowed"
otherwise
make the value 1, but instead of a script name you
haveorganisation_type, which is the name of the field.

The thing is, whenever you change the value of the field, it will then
cause EventScript to run the script again no matter what. So, in the
above, if organisation_type is empty, you change it to 0 (script is
run), otherwise change it to 1 (script is run again). Activate
ScriptDebugger and watch it happen.

Alter the scheme so that a change to the field runs the script, but
make the script itself do the evaluation. Put a trap at the beginning
of the script to exit if the value of organisation_type is such
thatthe script should not continue.
Matt

--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo



Reply With Quote
  #4  
Old   
Matt WIlls
 
Posts: n/a

Default Re: Software for Humans Eventscript - 05-31-2007 , 10:58 AM



In article <nemoThu053107115207 (AT) alphaone (DOT) com> Matt WIlls <Im (AT) Witz (DOT) End>
wrote:

Quote:
In article <E4GdnajhSoyjfcPbRVnyjAA (AT) bt (DOT) com
TonyBowles<anthony.bowles (AT) btinternet (DOT) com> wrote:

I have been using this plug-in for about a year in just a single
instance up to now but have a need to make fiurther use of it.

The first use of it has been performing as intended, but looking
at the code to refresh my memoey on how to set it up, it seems that
this has been working in spite of my coding rather than because of
it. In this case it is being used to change the current data input
layout if the type of records being input changes. I have 5
different types of record with small differences in the fields used,
each being maintained by a separate layout, but all applying records
to a single data table. There is a record type field on all the
layouts and the script called by Eventscript checks whether this
field still matches the layout name after the entry of a new record
and if necessary switches to the appropriate layout.

The coding set up & functioning OK in its key respect is as
follows:
If (IsEmpty (organisation_type);

0 & S4HU_Eventscript (Get (FileName); "NotAllowed" ; "");

1 & S4HU_Eventscript (Get (FileName); organisation_type ;
"");
As you can probably guess my understanding of calculation
formulae is somewhat lacking at the moment , all I know that the
script "NotAllowed" intended to be run to prevent the record type
field being blanked is never called. In deliberately blanking the
field, the coding just lets it happen.

Any help that anyone can offer would be appreciated

Thanks

Tony

If you look at the function itself (in the Specify Calculation
dialog, as if you were adding it to a calc), you'll see that the
syntax is S4HU_EventScript ( Get ( FileName ) ;
YourScriptName;{OptionalScriptParameters} )

Thus, your calc says

If organisation_type is empty
make the value 0 and run the script "NotAllowed"
otherwise
make the value 1, but instead of a script name
youhaveorganisation_type, which is the name of the field.

The thing is, whenever you change the value of the field, it will
then cause EventScript to run the script again no matter what. So, in
the above, if organisation_type is empty, you change it to 0 (script
is run), otherwise change it to 1 (script is run again).
ActivateScriptDebugger and watch it happen.

Alter the scheme so that a change to the field runs the script, but
make the script itself do the evaluation. Put a trap at the beginning
of the script to exit if the value of organisation_type is
suchthatthe script should not continue.
Matt

I'm sorry, I must have been thinking of a different post when I
suggested you activate Script Debugger. You didn't say you were using
Advanced.
Next best thing: put a pause or a Custom Dialog in the script and
watch how many times you hit that step.
Matt

--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo



Reply With Quote
  #5  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: Software for Humans Eventscript - 05-31-2007 , 11:09 AM



Tony Bowles wrote:

Quote:
The coding set up & functioning OK in its key respect is as follows:

If (IsEmpty (organisation_type);

0 & S4HU_Eventscript (Get (FileName); "NotAllowed" ; "");

1 & S4HU_Eventscript (Get (FileName); organisation_type ; "");

As you can probably guess my understanding of calculation formulae is
somewhat lacking at the moment , all I know that the script "NotAllowed"
intended to be run to prevent the record type field being blanked is
never called. In deliberately blanking the field, the coding just lets
it happen.
Assuming this calc resides as a field validation, is there a reason you
need a script called 'NotAllowed' to run? Why not just use FileMaker's
built in validation to prevent blank entries? Something like:

Case (IsEmpty (organisation_type); 0;
1 & S4HU_Eventscript (Get (FileName); Change_Layout_by_org_type ; "");


Reply With Quote
  #6  
Old   
Tony Bowles
 
Posts: n/a

Default Re: Software for Humans Eventscript - 05-31-2007 , 05:55 PM



Howard Schlossberg wrote:
Quote:
Assuming this calc resides as a field validation, is there a reason you
need a script called 'NotAllowed' to run? Why not just use FileMaker's
built in validation to prevent blank entries? Something like:

Case (IsEmpty (organisation_type); 0;
1 & S4HU_Eventscript (Get (FileName); Change_Layout_by_org_type ; "");
Howard & Matt

Thanks for your suggestions - I forgot to mention that it is FMP 7
Developer that I am using, so I do have a script debugger.& have watched
it through as you suggested.
I have tidied up up the script along the lines suggested above

Thanks again

Tony


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.