Focal Point
repeating user input

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/4201001822

May 15, 2007, 02:15 PM
FrankDutch
repeating user input
I have an application that where my users have to enter one or more StockID (numeric) to get a mail address list.
Now they send me a list of stockid, I put them in a small txt file, copy the file to the baseapp and then I can run the report.

But I would like to give the users the application so they can type in the stockID(s) and run the report themself.

I have the application but it allows only one stockID.
How can I loop that prompt to get a second (and third and....)

The result must be something like

"WHERE STOCKID EQ Number1 OR Number2 OR Numberx"

I'm sure this was somewhere on focalpoint, but I can not find it anymore

Thanks for the help.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

May 15, 2007, 02:29 PM
Tom Flynn
Frank,

Expand your input box and teach the users to input:

'123456','654321','111111','222222'

then

WHERE STOCKID IN (&VARIABLE_NAME);

OR

have then input a different way and use GETTOK, POSIT, etc..

Many other ideas will be coming, I'm sure, this is just 1...


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
May 15, 2007, 03:06 PM
<Tim Howard_ABCBS>
You can also use the following code to allow the user to input there value delimited by commas. (ex: 123,345,567,678):


-SET &TSTVAR = '121,232,343,454,565,676';

-DEFAULT &NEWVAR='111111111111111111111111111111111111111111111111111111111111111111111111'
-SET &NEWVAR = STRREP(&TSTVAR.LENGTH,&TSTVAR,1,',',6,''' OR ''',4095,&NEWVAR);
-SET &NEWVAR = '''' || &NEWVAR || '''';
-TYPE &NEWVAR

TABLE FILE TBLNAME
PRINT *
WHERE VARIABLE EQ &NEWVAR
END



Tim H.
May 16, 2007, 05:51 AM
Alan B
Frank

Is something like this what you want:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>My selection</title>
<script type="text/javascript">
function processForm() {
var t=escape(document.getElementById("country").value);
var u=t.split('%0A')
for (i in u){
 if (i==0){
 document.getElementById("screen").value =u[i];
  } else {
 document.getElementById("screen").value =document.getElementById("screen").value+" OR "+u[i];
  }
}
document.getElementById("runForm").submit();
}
</script>
</head>
<body>
<div>
<form method="post" name="runForm" id="runForm" action="/ibi_apps/WFServlet">
<input type="hidden" name="IBIF_focexec" id="IBIF_focexec" value="myFex">
<input type="hidden" name="screen" id="screen" value="">
</form>
<p>
<label for="country">Add countries, one per line </label>
</p>
<p>
<textarea name="country" id="country" size="3">
</textarea>
<input type="button" name="button1" id="button1" value="run report" onclick="processForm()">
</p>
</div>
</body>
</html>

with fex
TABLE FILE CAR
PRINT COUNTRY
IF COUNTRY EQ &screen
END



Alan.
WF 7.705/8.007
May 17, 2007, 01:49 PM
FrankDutch
Tom, Tim an Alan
thanks for the nice and sometimes obvious simple solutons.
I will give them a try (after the Summit)




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

May 17, 2007, 03:40 PM
<Tim Howard_ABCBS>
I am right there with you. I'm trying to get things in line myself to be out for a week.

I'm planning on attending the Focal Point meeting and hopefully meeting some of the people that I've learned so much from.

See ya in Vegas.

Tim H.