August 3, 200421 yr I have a field which contains a number."Number" I have a global in which I would like to translate that number into the number of times I display the letter x. So if the number field contains "7" I would like the global field to calculate this "xxxxxxx" So if the number field contains "13" I would like the global field to calculate this "xxxxxxxxxxxxx" Thanks Dave
August 3, 200421 yr Hi, Dave. Try creating a second global field called Counter and then using this script: If [ "Number <= 0" ]
August 3, 200421 yr Well, it would be a calculation field, since a global calculation won't auto-update the same way. Assuming you can have up to 100 in the number field, your calculation field would be Left( number, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ). Change the comma to a semi-colon for version 7. If using Developer, you could also create a Custom Function that would do it without hard-coding 100 or more xes.
August 3, 200421 yr Jerry's script is more dynamic than my calculation. However, it will require users to click a button to update the field after 'number' is changed.
August 3, 200421 yr Hello Stann, Whether by script or by calculation, I suggest that you use the formula: Substitute(Right(10^Number, Number), "0", "x") - which will produce the desired number of 'x' characters for 'Number' values in the range from 0 to 214. If you need a range that goes beyond 214, a slightly more complex formula will be needed - but nothing that requires you to type a hundred Xs...
August 3, 200421 yr Nice. I've never seen that one before. I thought it could be done, but never had need for it. Thanks, Ray.
August 3, 200421 yr Of course that is for FileMaker v6. For v7, I'd suggest using the following Custom Function: Extrapolate ( String; Number ) with the function definition being: Case( Number > 0; String & Extrapolate ( String; Number - 1 ) ) ...which will be good for value ranges of 'Number' from 0 to 9,999.
August 4, 200421 yr I knew when i was writing my solution that there would be a better one... i didn't think that there would be TWO. J
Create an account or sign in to comment