July 8, 201015 yr 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 ??
July 8, 201015 yr Author WOW ! That easy - magic, is it possible to change the size and make it bold too ? Thanks
July 8, 201015 yr Author 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 )
July 8, 201015 yr 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 July 8, 201015 yr by Guest
July 8, 201015 yr Author 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
July 8, 201015 yr '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 July 8, 201015 yr by Guest
July 8, 201015 yr Author 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.
July 8, 201015 yr 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 July 8, 201015 yr by Guest
July 8, 201015 yr Right("*****"; STARS) To not hard-coding the text string: Substitute ( 10 ^ stars - 1 ; 9 ; "*" )
July 8, 201015 yr Author Aaaaargh ! I am not on the very latest version of 8.5 Will do an update to get the list function Thanks
July 8, 201015 yr 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.
July 8, 201015 yr Author 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 !
July 8, 201015 yr Author 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 ??
July 8, 201015 yr Author 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 :?
July 8, 201015 yr Author Tested what ? It was my database that crashed the programs - how can I test to see what is wrong ??
July 8, 201015 yr sorry, I meant that I tested the calculation. If you want the file test, then Attach it to a Reply. Lee
July 8, 201015 yr Author What ? I loaded FM8.5 then FM 9.0 and it crashed both - admittedly I was using the trial versions :-)
July 8, 201015 yr Author 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 .....
July 8, 201015 yr 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
July 8, 201015 yr Author Hi Yes [email protected] - I am on now. The 'no star' entry returns a zero - use the Line Entry layout to see the zero
July 8, 201015 yr Author WOW ! You are a star :-)) Thanks - very subtle changes there - like it - not sure I understand completely but it is elegant
July 9, 201015 yr Author 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.
July 9, 201015 yr Author Would be great to learn some more :-) Why are they unnecessary and why should they be stored ??
July 9, 201015 yr 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.
July 10, 201015 yr Author 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 July 10, 201015 yr by Guest
July 10, 201015 yr 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 ?
July 10, 201015 yr Author 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 July 10, 201015 yr by Guest
July 10, 201015 yr You missed to SET that field with the appropriate picture using the same script ( with another SetField [ ] or a modified one ) that you are now using for set a field to 0/1
July 10, 201015 yr Author I see, but SetField doesn't allow for an either or - does it ? I tried with an If and that seems to work. See attached ??
Create an account or sign in to comment