Jump to content

Add separators; repetitive functions


This topic is 5708 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Our company makes vitamins. We have lots of powders and keep track of the batches used in production.

The idea is that the mixing in charge scans the barcodes of the batches into a field.

Each barcode is always a length of 8 characters.

If he scans 3 barcodes, the field will be 24 characters long. I am trying to create a function that will reformat the text like so from:

xxxxxxxxxxxxxxxxxxxxxxxx

to

xxxxxxxx, xxxxxxxx, xxxxxxxx

I cannot get the function to work. it would be a text field with a calculation to reformat the text.

Any help is appreciated.

Link to comment
Share on other sites

Try:

Replace ( Replace ( text ; 9 ; 0 ; ", " ) ; 19 ; 0 ; ", " )

How come the scanner doesn't tab into next field at the end of a scan?

EDIT:

Wait, you mean the field can contain ANY number of scans? If so, you will need a custom function for this. Once again, it's weird that the scanner cannot at least insert a separator.

Edited by Guest
Link to comment
Share on other sites

yes, it can contain any number of characters, always in groups of 8.

a custom function is exactly what i need.

I made one that works for 2 barcodes or less but after 2, it goes wild.

this is the calculation:

function CommaEight(text)

--------------------------

Let(

length = length(text);

If(

Length(text) > 8;

CommaEight(text) & ", " & Right(text;Length(text) - 8);

text

)

Link to comment
Share on other sites

This topic is 5708 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

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