Runtime input list
-
- Posts: 37
- Joined: Tue Oct 10, 2017 12:44 pm
Runtime input list
Hi... is there any way to have the user enter a list of values at run time? I know how to have the RRS file prompt for a single value, but I need the user to be able to enter a list of customer numbers.____Thanks
=> RE: Runtime input list
You could have them enter a list as a string of values separated by commas and then use that string in an inlist() calculation.____Kathleen__R&R Support
-
- Posts: 37
- Joined: Tue Oct 10, 2017 12:44 pm
==> RE: Runtime input list
I tried that and I think I have a type problem. The CUSTNUM field in the table is numeric.____Here^s my calculated field:____inlist(CUSTNUM, custlist) > 0__... with custlist being the string entered in by the user____That obviously won^t work because they are two different types. So I tried:____inlist(str(CUSTNUM), custlist) > 0____That didn^t work either, even when I tried entering the customer numbers enclosed in single quotes. So then I tried:____inlist(CUSTNUM, val(custlist)) > 0____Surprisingly, that DID work, except it would only accept the first customer number in the string.____How can I make this work? Help! Help! =)____Thanks__
===> RE: Runtime input list
Try this:__Make the CUSTNUM a string and removing any leading or trailing spaces. This should allow it to match the entry.____inlist(Trim(ltrim(str(CUSTNUM))), custlist) > 0____Kathleen__R&R Support
-
- Posts: 37
- Joined: Tue Oct 10, 2017 12:44 pm
====> RE: Runtime input list
That^s closer, but it^s still not working... now it will accept a single customer number, but not multiple.____So if I enter ^100^, it will give the records for customer 100. If I enter ^200^, it will give the records for customer 200. However, if I enter ^100^, ^200^ (or 100, 200) I get no records.____The reason why, I believe, is because I am passing it ONE string parameter (custlist), whereas the help file specifies the syntax as INLIST(value,list-value-1,...,list-value-n). In other words, each list value is a separate string. See what I^m saying?____How can I make it work...? It seems to me that INLIST won^t work at all.____I can^t be the only one who has needed to pass a list for a parameter... any more ideas?____Thanks__Miken
-
- Posts: 37
- Joined: Tue Oct 10, 2017 12:44 pm
====> RE: Runtime input list
**BUMP____Sorry... any more ideas? Is it not do-able?____Thanks__Miken
=====> RE: Runtime input list
Try:____Trim(ltrim(str(CUSTNUM)))$custlist____This should return true whenever a custnum is contained in the custlist.____Kathleen__R&R Support
-
- Posts: 37
- Joined: Tue Oct 10, 2017 12:44 pm
======> RE: Runtime input list
Hmm, this sorta works. If give 1624,18595 as the custlist, grabs records for 2, 18, 1624, 18595. What happened?____Can you explain that syntax? I tried looking for it in the help file and didn^t see anything...____Thanks__Miken
=======> RE: Runtime input list
The $ is the contained in operator. It returns true when the string on the left is contained in the string on the right.__What I failed to consider was just the situation you desribed.__2 is contained in 1624,18595 but it is not one of its members.____Let me think some more and see if I can come up with a better solution!____Regards,__Kathleen__R&R Support____
========> RE: Runtime input list
Try this!____Create a calculated field called LOOKFOR with the expression:__" "+trim(ltrim(str(CUSTNUM)))+" ,"____then create LOOKIN with the expression:__" "+STRREP(custlist,","," , ")+" ,"____Finally create FOUND with the expression:__LOOKFOR$LOOKIN____This should be true when the customer number has an exact match in the customer list.____Kathleen__R&R Support__