Jump to content

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

Recommended Posts

Posted

For info, feedback welcome: I'm posting my calc (FM7 only) to clean up ISBN data entry. It adds dashes and verifies checksum. ISBN dash formatting is highly conditional -- and useful because the publisher code is the sequence up to second dash. Assume you have an isbn text field (must be text so as not to lose initial "0"), and you're working with English-language origin presses (though you can modify this for other ISBN standards). Have its auto-enter calc REPLACE existing value (uncheck DO NOT replace), and paste the following:

Let(F=Filter(isbn;1234567890)&Case(Right(isbn;1)="x";"X");

If(Length(F)<>10;"10 digits req'd ";

Case(Mod(Left(F;1)+2*Middle(F;2;1)+3*Middle(F;3;1)+

4*Middle(F;4;1)+5*Middle(F;5;1)+6*Middle(F;6;1)+

7*Middle(F;7;1)+8*Middle(F;8;1)+9*Middle(F;9;1);11)

<>If(Right(F;1)="x";10;Right(F;1));"Checksum FAILS "))

&

Left(F;1)&"-"&

Case(F<"020";Middle(F;2;2)&"-"&Middle(F;4;6);

F<"070";Middle(F;2;3)&"-"&Middle(F;5;5);

F<"085";Middle(F;2;4)&"-"&Middle(F;6;4);

F<"090";Middle(F;2;5)&"-"&Middle(F;7;3);

F<"095";Middle(F;2;6)&"-"&Middle(F;8;2);

F<"100";Middle(F;2;7)&"-"&Middle(F;9;1);

F<"186";Middle(F;2;5)&"-"&Middle(F;7;3);

F<"1999";Middle(F;2;6)&"-"&Middle(F;8;2);

F<"2000";Middle(F;2;7)&"-"&Middle(F;9;1); "INVALID?")

&"-"&Right(F;1)

)

This topic is 7513 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.