Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Member Login

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Eng-Tips
*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Thanks a lot Mate! I can't tell you how many times your site has saved my "rear". hehe..."

Geography

Where in the world do Eng-Tips members come from?
Keyser520 (Aerospace)
18 Jul 12 11:39
If I want to use a wildcard in a rule, such as :

If PartName==*bolt* Then

How would I do that?

Does it use regular expressions?
DBezaire (Automotive)
19 Jul 12 13:26
The wildcard * will not work as it is a valid string character. You can create a reaction to do what you ask.

You need to create a String Parameter String.1 and a Boolean parameter Boolean.1
Create a reaction to fire on ValueChange of String.1

let Name (string)
let Name_len (integer)
let Item (string)
let Result (string)
let Item_len (integer)
let len_diff (integer)
let i (integer)

/* Output */
Boolean.1 = false

/* Assignment */

Name = String.1
Name_len = Name->Length()
Item = "bolt"
Item_len = Item->Length()
len_diff = Name_len - Item_len + 1
i = 0

if Name_len >= Item_len
{
for i while i < len_diff
{
Result = Name->Extract(i,Item_len)
if Result == Item
Boolean.1 = true
i = i + 1
}

}




Regards,
Derek


Win XP64
R20/21, 3DVIA Composer 2012, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!

Back To Forum

Close Box

Join Eng-Tips® Today!

Join your peers on the Internet's largest technical engineering professional community.
It's easy to join and it's free.

Here's Why Members Love Eng-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close