Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Local/Global Variable Help

Status
Not open for further replies.

wgechter

MIS
Jul 24, 2002
85
US
I have three formulas:
{@rx1}
local stringvar rx1 := {MRRV99.LAB_RESULT};
If {MRRV99.LAB_NAME} = "Long Term Rx1"
then
rx1;
{@rx2}
local stringvar rx1 := {MRRV99.LAB_RESULT};
If {MRRV99.LAB_NAME} = "Long Term Rx2"
then
rx2;
{@rx3}
local stringvar rx1 := {MRRV99.LAB_RESULT};
If {MRRV99.LAB_NAME} = "Long Term Rx3"
then
rx3;
Why is it that the first formula will pull up the correct information but the other formulas pull up nothing. If I make it a global variable, the data is very incorrect and pulls from previous records. What am I doing wrong? Thanks
 
You don't neeed variables at all, try:

{@rx1}
If {MRRV99.LAB_NAME} = "Long Term Rx1"
then
{MRRV99.LAB_RESULT}

{@rx2}
If {MRRV99.LAB_NAME} = "Long Term Rx2"
then
{MRRV99.LAB_RESULT}

{@rx3}
If {MRRV99.LAB_NAME} = "Long Term Rx3"
then
{MRRV99.LAB_RESULT}

or you can combine these all in one formula since they return the same thing:

If {MRRV99.LAB_NAME} in ["Long Term Rx1","Long Term Rx2","Long Term Rx3"]
then
{MRRV99.LAB_RESULT}


-k
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top