Issue if using the same input variable multiple times

User-to-User discussion about the PhraseExpress macro programming.
Post Reply
marcmaurer
Posts: 4
Joined: 14 Jul 19, 22:22

Issue if using the same input variable multiple times

Post by marcmaurer » 15 Jul 19, 15:12

Hello everybody,

I would like to do a more complex calculation that requires different inputs from the user and then a text with the results should be displayed.

The first formula requires the inputs A, B, C which I have also all stored in the variables manager. So that the first result can be calculated, I defined an output variable X (also stored in the variable manager) as follows (with a calculation):

(({{Variable A}} * 1000) / {{variable B}}) / ({{variable B}} * 8 * {{variable C}})

so far so good.

In the same text sentence, however, a second result should then be calculated, Output Variable Y. Now it is the case that this output partly requires the same input variables as before:

({{Variable A}} * 1000) / {{Variable B}}

It is very unfortunate that phraseexpress therefore asks twice for variable A and variable B.

What am I doing wrong here or how should I reroll this, that only once after each variable is asked?

Many thanks for your help,

Marc

PicOlio
Posts: 3
Joined: 28 Jul 19, 18:10

Post by PicOlio » 28 Jul 19, 19:03

I just want to piggy back on this post as I have the same/similar issue.
I am using PhraseExpress v.14

I, for example, have a phrase that asks for me to input NAME

NAME was in a good mood.

And then in the same form have a drop down that may include something like
checkbox: NAME had a soda.
checkbox: Name had a carrot.
checkbox: NAME starved.

The result is, PhraseExpress asks me for NAME again to fill in the checkbox form inputs....

I have an enormous amount of phrases that require me to input the same data over and over.

Very appreciative of anyone who may have a solution... thanks ahead of time!

Technical Support
Posts: 2241
Joined: 10 Feb 06, 22:23

Post by Technical Support » 29 Jul 19, 16:00

Store the values themselves in variables and not the input macros.

PicOlio
Posts: 3
Joined: 28 Jul 19, 18:10

Post by PicOlio » 03 Aug 19, 14:44

Maybe I am not understanding correctly. In my example, NAME is always changing, so I want to "input" the NAME each time I call a phrase but once inputted, I would like to not have to input it again for PhraseExpress to fill in the other pieces of the total phrase... (e.g., when it is calling phrases from other folders to finish the document).

For example:

{{Gender}}

D: {{Name}} blah blah. {{Name}} stated "blah blah" Integrating {{Modalities}} techniques, this session addressed objectives: {{Objectives Addressed}}. This session focused on but was not limited to {#formphrasecombo -text Process and Explore -hint Process and Explore -source ##ProcessExplore -variablename Process and Explore} {#formphrasecombo -text ACT -hint ACT -source ##ACTWo_75688 -variablename ACT Interventions} {#formphrasecombo -text Interpersonal Relations -hint Interpersonal Relations -source ##Interp_77312 -variablename Relationship Interventions} etc etc...

I enter a person's name and everywhere {{Name}} variable appears it is filled in correctly BUT when {formphrasecombo ... source ##ProcessExplore - variablename...} is used PhraseExpress will then ask for Name again because I use the Name variable in those phrases that are stored in another folder as well.

Does this make sense? Is there a way to have PhraseExpress use the {{Name}} variable all of the way through?

Technical Support
Posts: 2241
Joined: 10 Feb 06, 22:23

Post by Technical Support » 05 Aug 19, 08:56

If the variable {{NAME}} has only the name and NOT a macro as value (the value was set using #set Maacro or in the macro dialog: process output -> set variable) and is it already filled before #formphrasecombo is executed, then it will work like you want it to.

Post Reply