Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

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.

Posted (edited)

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
Posted

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

)

Posted

Try it this way:

Let ( [

this = Left ( text ; 8 ) ;

len = Length ( text ) ;

rest = Middle ( text ; 9 ; len - 8 )

] ;

this &

Case ( len > 8 ; ", " & CommaEight ( rest ) )

)

This topic is 6558 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
×
×
  • Create New...

Important Information

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