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 5308 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hi

I have a calculation field returning text of several fields and I would like to add a star rating to the end of the list of text. I have a field called STARS which has a number (1-5 entered), how can I force the calculation to return an asterisk for the number of stars equivalent to the number in the STARS field ??

Posted

Here is my script - I am trying to append fields with a comma to separate them, but I would like a full stop after the address before the Postcode. I cannot see how to do this without getting a comma before the full stop if the preceeding field is empty ??

Case ( not IsEmpty ( Main::Title) ; Main::Title) & ", " & (Main::Address1) & ", " & (Main::Address2) & ", " & Case ( not IsEmpty ( Main::Address3 ) ; Main::Address3) & ", " &

Case ( not IsEmpty ( Main::Address4 ) ; Main::Address4 ) &

Case ( not IsEmpty ( Main::Address5 ) ; Main::Address5) & ". " & (Postcode) & " " & "Tel: " & (Tel) & " " & Right("*****"; STARS )

Posted (edited)

I am trying to append fields with a comma to separate them, but I would like a full stop after the address before the Postcode. I cannot see how to do this without getting a comma before the full stop if the preceeding field is empty ??

The List() function will take any number of arguments and separate them by "¶". It will gracefully omit blank arguments. Replace the "¶" with a comma and you're done.

Substitute(

List(

Main::Title;

Main::Address1;

Main::Address2;

Main::Address3;

Main::Address4;

Main::Address5

); "¶"; ",")

& "." &

& Postcode & " " & "Tel: " & Tel & " " &

Right("*****"; STARS)

Edited by Guest
Posted

Thanks for all your help - really good to be able to get somewhere when you cannot see the wood f t t ettc.

BUT ! 'List' seems to return an 'unknown function' in my calculation setup dialogue box - I am using FM 8.5

Posted (edited)

'List' seems to return an 'unknown function' in my calculation setup dialogue box - I am using FM 8.5

List() should be available to you. I see it in my v8.5 Advanced.

Edited by Guest
Posted

Hi

All I did was to copy the posted reply, into my calculation field and it highlighted the word 'List' and said unknown function. I just assumed that the post was a direct replacement for my 'Case' calculation.

If not please advise.

Posted (edited)

There are two [color:red]& in a row. Remove the [color:red]& before [color:blue] Postcode

i.e.

& "." &

[color:red]& Postcode & " " & "Tel: " & Tel & " " &

Lee

Edited by Guest
Posted

I think they just want to hide 1 to 5 number that would appear in STARS.

i.e. 12345 would equal ***** not 12,345 Stars.

Posted

Oh dear - now the database will not load into FM 9.0 and FM 8.5v2 - crashes app :?

I have managed by trial and error to get the calculation to add a comma if the field after it has data and to add a full stop if not. Perseverence !

Posted

No, the data in the field is a single number from 1- 5, so the Substitute ( 10 ^ stars - 1 ; 9 ; "*" ) works fine - both solutions work fine in fact.

Great help - is there anyway to test my build to see why it won't load in later versions ??

Posted

Hmmmm, just noticed a problem - if the entry does not have a star rating i.e., number = '0' then it shows an actual zero instead of stars. How can I get it to display nothing :?

Posted

sorry, I meant that I tested the calculation.

If you want the file test, then Attach it to a Reply.

Lee

Posted

Try the '0' entry in the STARS field - it returns a zero - would be great if it returned nothing (you need to be in the layout called LINE ENTRY .....

Posted

I don't follow?

If I put a 0 in the Star field, it show nothing as the result. What did you want it to show?

BTW, do you have iChat, we could probably walk you through this easier using it.

Lee

Posted

WOW !

You are a star :-))

Thanks - very subtle changes there - like it - not sure I understand completely but it is elegant

Posted

I have no idea - I thought they were necessary ! Most are to get nice looking tick boxes to display, whilst still keeping a data value.

Posted

Unstored calculations slow down the program.

I do not know if those field are necessary...

I meant that you make them uselessly UNSTORED, while they can be stored.

Sometimes we need to have an unstored calculation ( for example a calculation based on a Get( ) function ) but none of your needs to be.

Posted (edited)

Thanks for the reply - I will look into that - I had noticed that it had gone slow :-)

Well 15 of them cannot be stored - as they reference the global tick box graphic - unless of course you have a much more elegant solution ??

example If(Laundry data= 1; Global::Tick; Global::Cross)

Edited by Guest
Posted

Well 15 of them cannot be stored - as they reference the global tick box graphic

In fact those calculated fields may well not exist, would be enough of simple fields of type container.

Didn't you scripted each tick ?

Posted (edited)

OK - I will have a go - sounds cool! Having less is always better.

Well I did have a chance to change one file to a container and deleted the unstored calculation, which didn't work - there is nothing now that tells the data box which graphic to use in each state (that was what the calculation was for ) ??

Or am I missing something ?

Edited by Guest

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