Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Calling LotusScript from a @formular

189 views
Skip to first unread message

Andy Goodchild

unread,
Oct 13, 2000, 3:00:00 AM10/13/00
to
Hi,

I've written a function in LotusScript which returns a value and works
great. Unfortunately I need to get this value in a Field (which only works
with @formulas). Does anyone know of a way of calling a LotusScript
function from an @function?
I'm using R5.

Many thanks in advanced...

Andy Goodchild

unread,
Oct 13, 2000, 3:00:00 AM10/13/00
to
Thanks, but I needed it the other way round, I need to run a LotusScript function in an @formula, not an @formula from within LotusScript!
 
Thanks anyway!
 

With Evaluate you can call @function from lotus script. Just type evaluate
in searching the help and look at the samples.

Tomsky

Philippe Lauwers

unread,
Oct 13, 2000, 3:00:00 AM10/13/00
to Andy Goodchild
The only way I know to call a script from formulas is to use
@Command([ToolsRunMacro];...), but you can't use that in a value-formula.
Is there really no way to program this using @Formulas ?

W.Flamme

unread,
Oct 14, 2000, 3:00:00 AM10/14/00
to
Andy Goodchild <andrew.g...@NOSPAMcelestion.com>
schrieb in im Newsbeitrag:
39e6d...@nnrp1.news.uk.psi.net...

> I've written a function in LotusScript which returns a
value and works
> great. Unfortunately I need to get this value in a Field
(which only works
> with @formulas). Does anyone know of a way of calling a
LotusScript
> function from an @function?
> I'm using R5.

I'm afraid there is no way to extend Formula Language with
LS.
The main reason Lotus/Iris prevented this might be that the
behaviour/performance/reliability of formulas is predictable
whereas in LS it's not. Since views and view indexing relies
haevily upon formula language they don't want to tempt
developers to de-stable basic functionality or performance.
So the only way to insert LS results into a form is
event-driven (agent, action, change-focus aso). Maybe that's
the way to go..

--

Wolfgang Flamme
wfl...@mainz-online.de

Andy Goodchild

unread,
Oct 16, 2000, 3:00:00 AM10/16/00
to
> The only way I know to call a script from formulas is to use
> @Command([ToolsRunMacro];...), but you can't use that in a value-formula.
> Is there really no way to program this using @Formulas ?

Well, there is (I'm using a view with a @dblookup statement) but when
documents are created and saved, the @dblookup formula with the view doesn't
seem to be refreshing properly, where as the LotusScript function is.

Any ideas why the @dblookup/view is not refreshing? I'm using the "NoCache"
feature of DB lookup!

CWorf

unread,
Oct 17, 2000, 3:00:00 AM10/17/00
to Andy Goodchild
Hi Andy,
what are the properties for the view index for your dblookup view? Is the index
updated automatically?
Or use @command([viewRefreshFields])?
Christina

Andy Goodchild schrieb:

Pete Barrie

unread,
Oct 17, 2000, 3:00:00 AM10/17/00
to

"Andy Goodchild" <andrew.g...@NOSPAMcelestion.com> wrote in message
news:39e6d...@nnrp1.news.uk.psi.net...
> Hi,

>
> I've written a function in LotusScript which returns a value and works
> great. Unfortunately I need to get this value in a Field (which only
works
> with @formulas). Does anyone know of a way of calling a LotusScript
> function from an @function?
> I'm using R5.
>
> Many thanks in advanced...
>
>

Here's how you do my workaround for this...

In Formula you trigger your script code this way:

scriptCode is a hidden text field with default value "N"

FIELD scriptCode := "Y";
REM " \'ViewRefreshFields\' use line below to trigger PostRecalc event" ;
REM " The PostRecalc event is simply convenient to use since it can be
triggered by ViewRefreshFields" ;
@Command([ViewRefreshFields]);
FIELD scriptCode := "N";
REM " Now the code will not be triggered on any other refresh ";

In the form postRecalc() event you use a conditional statement:
' source is current uidoc
If source.FieldGetText("scriptCode") = "Y" Then
returnVal$ = yourFunction(params)
Call source.FieldSetText("yourField" ,returnVal$ )
End If


now you have the return value in a form field (yourField) ready
to use in the next formula statement.

Simple but functional. Well used in my systems.


Pete


0 new messages