Jump to content

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

Recommended Posts

Posted

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

Posted

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.

Posted

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.

Posted

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... wink.gif

Posted

Nice. I've never seen that one before. I thought it could be done, but never had need for it. Thanks, Ray.

Posted

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. cool.gif

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