Jump to content

InverseText ( text )


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

Recommended Posts

I am hoping someone has a simple solution to this problem I have been working on for a while now.

I am trying to create a Cost Code for our barcode labels that will show the item cost but not be so obvious to the customer.

Ex: 08995205

08= year

9952= item cost of 25.99

05= month

I can get the year and month right but the item cost to inverse aludes me.

I'm trying to use the InverseText ( text )custom function in Brian Dunnings list of custom functions. Unfortunately when I add this custom function it has an error here

InverseText ( text3 ) ) It needs an operation at the 1st parenthesis.

Sample Input:InverseText ( "Goodmorning" )

Sample Output:gninromdooG

Let (

[

text2 = Right ( text ; 1 ) ;

text3 = Left ( text ; Length ( text ) - 1 )

] ;

text2 & If ( Length ( text3 ) ≥ 1 ; InverseText ( text3 ) )

)

If there is a better solution or can figure out the error in this function to inverse text I would be very greatful.

Link to comment
Share on other sites

If the price shouldn't be obvious to the User, why have it on there? Or does it need to be obvious to SOMEONE when glancing at the product? If you want to hide the price but must have it on the label, use a good encryption using Base64 or something.

It kinda feels like you are wanting to create a unique ID by using parts of information that mean something. If so, please don't go that way. Can you say a bit more about what you need and why?

Upon re-read, bar code labels should be unique and not be comprised of meaningful data.

Edited by Guest
Link to comment
Share on other sites

I don't see a problem with the quoted function. I don't understand what you mean by "It needs an operation at the 1st parenthesis."

Do you know how to install the function? It should look like this (attached).

Note that you will need to pass an integer (cost *100) to the function, to eliminate a decimal point and to make sure you can tell 25.99 apart from 259.90.

Screenshot_1.gif

Link to comment
Share on other sites

bar code labels should be unique

I am not aware of such requirement. Barcode labels are just labels - they can have any content you like, just like text labels.

I do agree the proposed scheme is not much of an encryption, but one needs also to consider what's on the receiving end.

Link to comment
Share on other sites

I know, I wasn't specific enough. Of course they are just labels. And you can have the same label plastered on 100 of the same product. The attempt is to track a product cost on a per product basis. But with databases we can do that anyway! We track a product by using a database! Coming from recent highly competitive manufacturing world, I would not want MY cost plastered on the product - never on your life. Even encrypted! Batch number - yes, product ID - yes. Production date - sure. My cost would be the most closely guarded aspect of the product.

brnmore, I might suggest reading up on the barcode industry to be sure you don't end up throwing away thousands of labels or having duplicate cost codes. Sorry, Michael, but sirens fly on this one.

Link to comment
Share on other sites

Well, I don't know what this is about, so either brnmore does or he/she better listen up.

BTW, Base64 is not an encryption, it's an encoding. It requires the full character set, so it wouldn't fit if the barcode needs to be numeric only.

Link to comment
Share on other sites

I might have come on a bit strong. Barcodes are preassigned and I had to look it up to see whether we were then free to put text under it. The answer is no. It's controlled by the Uniform Code Council. I knew we as manufactures were GIVEN a barcode when we created a new product and it was unique in the world (I think) to our product. The number that is displayed should be the product ID or whatever the cashier can type into the computer to also bring up the price of the product.

If the barcode is only going to be used within the company then fine. But if it goes out the door, you need to be sure it is consistent with standards. I found this basic and quite humorous piece of mis-use of barcodes. It's a rather old article but I know formatting barcodes is still quite strict.

Link to comment
Share on other sites

Barcodes are preassigned and I had to look it up to see whether we were then free to put text under it. The answer is no. It's controlled by the Uniform Code Council.

Code dependent - there are dozens of bar code formats, and some include a textual representation (3of9 for example, requires an asterisk at the beginning and end, and displays the text/numbers below the code). We use the IDAutomationHC39 free font, and generate the barcode from a unique ID, directly from FMPro.

Link to comment
Share on other sites

In case this is about how to reverse the Price, I borrowed a Custom Function from queue, at Brian Dunning's Site Here to deal with the Reverse. I know that you don't show Advance as your version of FileMaker, so that you can create Custom Functions (might be a good reason to upgrade) however, take a look and see if this is what you meant.

HTH

Lee

brnmoore.fp7.zip

Link to comment
Share on other sites

LOL,

I read that, but then promptly forgot about it while I was looking for an alternative to the Custom Function.

Thanks for changing the file.

Lee

[color:red]also, the calculation needs to result as text

:

Edited by Guest
Link to comment
Share on other sites

...that will show the item cost but not be so obvious to the customer.

Another not so obvious method to show the item cost is its nine's complement.

So, for an item cost of 25.99 you'll have 7400 and the calculation doesn't require a recursive CF; it is simply:

10 ^ Length ( item cost * 100 ) - 1 - item cost * 100

Link to comment
Share on other sites

Sorry my question wasn't more specific.

I was trying to create a code to put the item cost on the lower right corner of a barcode label. This would let my employees know the item cost without going to a PC to check the price just in case there was some bardering on the sale. I run a Gun Shop. I didn't want to make it to complicated, just not obviuosly simply like backwards, but not in code. Let me demostrate.

It need last 2 digits of the year purchased,

Item price inversed 25.99 becomes 9952, no decimal

purchased month in 2 digits.

Example:

Purchased date - 02/12/08

Item Cost - 25.99

Results = 08995202

I figured out the solution soon after posting this. This forum is awesome by the way.

I used the Inverse(text) & Reverse custom function in Brian's list in a Let function as a auto calculated field (costcode).

I am sure there is an easier or more effecent way to write this, but it does work 100%. I would be curious on the idea's you guys have.

My solution

Let(

[

now = Date Added ;

year = Right( Year ( now ) ; 2 ) ;

month = Right( "000" & Month ( now ) ; 2 ) ;

filter = Filter ( Item Cost ; "0123456789" ) ;

reverse = Reverse ( filter ) ;

itemcost = reverse ;

Cost Code = month & itemcost & year

];

Cost Code

)

Sorry for the slow reply and bad question. still a 2 month noob!. Thanks for all the input.

Link to comment
Share on other sites

As I said twice already, Filter ( Item Cost ; "0123456789" ) will not work here.

I didn't want to make it to complicated, just not obviuosly simply

Well, it's your call. But now that you have explained, I must agree with LaRetta. Quite a few people are ingenious enough to hack into secure sites, solve Sudoku puzzles, or even write a Filemaker calculation. I wonder how long it will take before everyone knows how to read your code.

Link to comment
Share on other sites

We have been using the code for 10 years now. Now that we are using FM. I wanted Filemaker to auto calcutate it. We use it only in the store.

I understand why (0123456789) wont work and I should use the *100 method. I wish I was smart like you in FM so I could belittle those that are reaching out to those with more experience. Oops did I say that out loud? Just kidding, I know you post a lot here and I do get many great ideas and help. By the way I can't do sudoki.

Link to comment
Share on other sites

Well, goodness ... I truly can't believe you said that.

I wish I was smart like you in FM so I could belittle those that are reaching out to those with more experience. Oops did I say that out loud? Just kidding,

It is amazing how people think they can say something rude under the guise of 'just kidding' and feel covered behind niceties. You are not.

And then to say, "ooops did I say that out loud?" as if it was impossible for you to delete your words; good grief. It wasn't like you SAID them and couldn't take them back. I am truly amazed how someone can absorb the knowledge of others without having to do the same work to GET that knowledge and then make statements like that.

There was no belittling here until you opened YOUR mouth. I wouldn't blame Michael for blowing you off completely in future. It would serve you right. I'm close to deleting your words but I shall leave them ... I want others to see how, those who spend HOURS AND HOURS helping others on this site, are often then spit upon for it. Shame on you ... for unappreciating your assistance; for thinking you can add 'just joking' and make it okay; and particularly for thinking we are dumb enough to think that you typed something you couldn't take back.

Link to comment
Share on other sites

  • 2 weeks later...

I don't think that would work very well here

yes, I see...

So this is better:

Substitute (

Substitute ( item cost ; [ "," ; "" ] ; [ "." ; "" ]

; [ 0 ; "a" ] ; [ 1 ; "b" ] ; [ 2 ; "c" ] ; [ 3 ; "d" ] ; [ 4 ; "e" ] ; [ 5 ; "f" ] ; [ 6 ; "g" ] ; [ 7 ; "h" ] ; [ 8 ; "j" ] ; [ 9 ; "k" ]

)

; [ "a" ; 9 ] ; [ "b" ; 8 ] ; [ "c" ; 7 ] ; [ "d" ; 6 ] ; [ "e" ; 5 ] ; [ "f" ; 4 ] ; ["g" ; 3 ] ; [ "h" ; 2 ] ; [ "j" ; 1 ] ; [ "k" ; 0 ]

)

Link to comment
Share on other sites

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