Jump to content
Sign in to follow this  
serp

Substitute just ONE from a list

Recommended Posts

I have a text field. 20 users.

Each time a guy is looking one branch we paste the branch's id, per.ex, 010062.

So if a second guy go to the same branch:

010062

010062

040033

etc

Also I have a script if (Patterncount (x;010062) > 2; block entrance; allow entrance)

I would like to remove this "id branch" after 1 guy "leaves" the branch, but just ONE "010062" not all. So 2 guys in 010062, after 1 goes out, there is still ONE 010062, not two!!

How I can manage that?

Share this post


Link to post
Share on other sites

Set Field [textfield; Replace( textfield; Position( textfield; "010062"; 0; 1 ); 7; "" )]

Share this post


Link to post
Share on other sites

Set Field [textfield; Replace( textfield; Position( textfield; "010062"; 0; 1 ); 7; "" )]

Thanks Queue

Share this post


Link to post
Share on other sites

Look in the online help for information regarding the Replace and Position functions. You'll see that since Position has an occurrence parameter of 1, it will find and replace only the first instance of "010062" in textfield. Replacing 7 characters allows the trailing

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.