Hi, I need to assign variables dynamically as below. I will get the variable Name and Variable value in 2 different parameters and need to assign the value accordingly.
Autoprompt will want to know about &VAR_VALUE_Fruit though...
WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010 : Member of User Group Benelux :
Hi Don , I duno the parameter name at all since thats dynamic then how do I set the below -DEFAULTH &Fruit = '_FOC_NULL'
WebFOCUS 8
Windows, All Outputs
March 28, 2018, 02:37 PM
FP Mod Chuck
SridharLakshmipathy
It is confusing as to where this parameter name is being set dynamically. Is it in a html form or where does this happen. Parameter names should not be set dynamically, the values they contain can be but not the actual parameter name itself.
Thank you for using Focal Point!
Chuck Wolff - Focal Point Moderator WebFOCUS 7x and 8x, Windows, Linux All output Formats
March 29, 2018, 01:19 AM
SridharLakshmipathy
quote:
Originally posted by FP Mod Chuck: SridharLakshmipathy
It is confusing as to where this parameter name is being set dynamically. Is it in a html form or where does this happen. Parameter names should not be set dynamically, the values they contain can be but not the actual parameter name itself.
FP Mod Chuck, If you look at my example , you can see &VAR_NAME ='Fruit' i.e. the parameter name is Fruit which will come in VAR_NAME variable.
The real question is : Why do you need this? It will be almost impossible to write code for variables with variable names.
What are you trying to achieve?
Hi Dave, Thank you, but I need to do without auto prompting. Below is the example of what I want to achieve. I will get the dynamic request parameters from java like below. so I need to read variable values from the request params only.
As far as I can see you don't need different variable's name.
Each Appx.fex can use the same variable's name, only the assigned value is important. It doesn't matter that a variable named &MY_VAR contains either a fruit's name, an animal's name or a bird's name. You're making your request too complicated for nothing. If you need to know the content "type" then have one variable to receive the type (VAR_TYPE : fruit, animal, bird) and one for the kind (VAR_VALUE : apple, tiger, pigeon).
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
March 29, 2018, 08:20 AM
Don Garland
It looks like you need to determine the "category" of &VAR_NAME before you launch a procedure? Why is that? Not knowing why you want to do this, but here is what I would to with your traffic control logic.
Originally posted by MartinY: As far as I can see you don't need different variable's name.
Each Appx.fex can use the same variable's name, only the assigned value is important. It doesn't matter that a variable named &MY_VAR contains either a fruit's name, an animal's name or a bird's name. You're making your request too complicated for nothing. If you need to know the content "type" then have one variable to receive the type (VAR_TYPE : fruit, animal, bird) and one for the kind (VAR_VALUE : apple, tiger, pigeon).
Hi Martin, I agree but the APP1, APP2 and APP3 applications already built and we have more than 1000 lines of code. I dont want to revisit the 1000 lines of code again to have unique variable name..
Thanks,
WebFOCUS 8
Windows, All Outputs
March 29, 2018, 08:31 AM
SridharLakshmipathy
quote:
Originally posted by Don Garland: It looks like you need to determine the "category" of &VAR_NAME before you launch a procedure? Why is that? Not knowing why you want to do this, but here is what I would to with your traffic control logic.
general.fex ################
-GOTO &VAR_NAME
-APP1 -INCLUDE APP1 -GOTO ENDAPP
-APP2 -INCLUDE APP2 -GOTO ENDAPP
-APP3 -INCLUDE APP3
-ENDAPP
Hi Don, We are not only routing the fex traffic based on the category, we need to assign the variable values dynamically
WebFOCUS 8
Windows, All Outputs
March 29, 2018, 08:42 AM
dbeagan
Maybe this will work for you. I tested the following code in WebFOCUS 8.2.x
Hi Don, We are not only routing the fex traffic based on the category, we need to assign the variable values dynamically
Right, but isn't it true, that once you've determined the category (app name) then you know what variable names must exist to make that work?
Hi Don, Yes, we shall be able to identify the category and list of variables used in it . if so we need use -SET DEFAULTH for all variables used in all apps .
WebFOCUS 8
Windows, All Outputs
March 29, 2018, 10:11 AM
Don Garland
quote:
-SET DEFAULTH for all variables used in all apps .
There are couple of ways to approach the DEFAULT(H) issue.
1. Right click on the procedures and set the Prompt for Parameters to 'NO'.
2. If you need default values for your parameters, then create an include file that has all of the variable names and their defaults and add that to the top of your procedures. You can set defaults for all the variables you want, even if you don't use them and it's a great way to keep track of all the variables that you create.