Runtime input list

Meeting place for R&R customers and clients to share tips and ideas. Post your questions, messages or problems here.
MikeN_(Guest)
Posts: 37
Joined: Tue Oct 10, 2017 12:44 pm

Runtime input list

Post by MikeN_(Guest) » Tue Jul 28, 2009 4:57 pm

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

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=> RE: Runtime input list

Post by kfleming » Wed Jul 29, 2009 8:49 am

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

MikeN_(Guest)
Posts: 37
Joined: Tue Oct 10, 2017 12:44 pm

==> RE: Runtime input list

Post by MikeN_(Guest) » Wed Jul 29, 2009 5:33 pm

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__

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

===> RE: Runtime input list

Post by kfleming » Thu Jul 30, 2009 9:55 am

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

MikeN_(Guest)
Posts: 37
Joined: Tue Oct 10, 2017 12:44 pm

====> RE: Runtime input list

Post by MikeN_(Guest) » Fri Jul 31, 2009 3:38 pm

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

MikeN_(Guest)
Posts: 37
Joined: Tue Oct 10, 2017 12:44 pm

====> RE: Runtime input list

Post by MikeN_(Guest) » Tue Aug 04, 2009 10:54 am

**BUMP____Sorry... any more ideas? Is it not do-able?____Thanks__Miken

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=====> RE: Runtime input list

Post by kfleming » Tue Aug 04, 2009 11:27 am

Try:____Trim(ltrim(str(CUSTNUM)))$custlist____This should return true whenever a custnum is contained in the custlist.____Kathleen__R&R Support

MikeN_(Guest)
Posts: 37
Joined: Tue Oct 10, 2017 12:44 pm

======> RE: Runtime input list

Post by MikeN_(Guest) » Tue Aug 04, 2009 12:18 pm

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

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

=======> RE: Runtime input list

Post by kfleming » Wed Aug 05, 2009 9:17 am

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____

kfleming
Posts: 5795
Joined: Tue Oct 10, 2017 12:44 pm

========> RE: Runtime input list

Post by kfleming » Wed Aug 05, 2009 3:36 pm

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__

Post Reply