pjohns
17th November 2010, 17:27
Hello,

I have a series of item codes that end in any of the following

R11 through to R91 (R11, R12, R13, R14 etc. etc. etc
R

I want to filter on item codes and select those items that end in Rxx

I could create a long 'if' statement such as -

if tiitm001.item(14;2) = "R1" or tiitm001.item(14;2) = "R2" or if tiitm001.item(14;2) = "R3" or tiitm001.item(14;2) = "R4" etc etc etc then

But I think it's fair to say this is not very efficient and rather messy.

Is there a better way to select those items that end in Rxx but ignore those that end just in R.

R will always be at position 14.

Thanks in advance.

PJ

bdittmar
17th November 2010, 19:02
Hello,

I have a series of item codes that end in any of the following

R11 through to R91 (R11, R12, R13, R14 etc. etc. etc
R

I want to filter on item codes and select those items that end in Rxx

I could create a long 'if' statement such as -

if tiitm001.item(14;2) = "R1" or tiitm001.item(14;2) = "R2" or if tiitm001.item(14;2) = "R3" or tiitm001.item(14;2) = "R4" etc etc etc then

But I think it's fair to say this is not very efficient and rather messy.

Is there a better way to select those items that end in Rxx but ignore those that end just in R.

R will always be at position 14.

Thanks in advance.

PJ

Hello,

try (maybe it works, not tested):


if (item(14;1) = "R" and isdigit(item(15;2))) then
.....

will take all items with "R" on position 14
and number at position 15 and 16

regards

pjohns
18th November 2010, 16:10
Thank you Bernd,

This worked just fine.

Regards

PJ