kodama Posted September 26, 2007 Share Posted September 26, 2007 Hello! So I have a calc that creates a calc. For example, the results can be: "Hello, " & FirstName and I need to somewhere actually get the "rendered" results of this result, as in: Hello, John Thanks! Link to comment Share on other sites More sharing options...
bcooney Posted September 26, 2007 Share Posted September 26, 2007 It would help to know where you are stuck. There really is no need for a calc that creates, "Hello, " & FirstName. If you plan to use this text in a Send Mail script step, you might create a calc field "EmailText" and have it be something like, "Hello " & FirstName & "," & & "Thank you for contacting our company. Blah..." Link to comment Share on other sites More sharing options...
kodama Posted September 26, 2007 Author Share Posted September 26, 2007 The actual project is more complex than my example, I just wanted to keep my question more simple. I really do need the generated calc to be actually read as a calc. I know that I could just make a text object on a layout like: Hello, <> And get: Hello, John But, how can you actually get FMP to parse text like this into a calc? Link to comment Share on other sites More sharing options...
Anuviel Posted September 26, 2007 Share Posted September 26, 2007 If I get the question correctly. You have a field called Name. You want to do a calculation that outputs Hello John when John is entered into the field called Name. You can do that like this: Field called Name - under the options for the field select Auto-enter calc and enter this as a calculation: "Hello" & Name Un-tick do not replace existing value. The above calculation, once you enter John into the field called Name will replace John with Hello John or you could do it like this: Create a new field called Name_Calc for example. Set the field type to calculation and result to text. As a calculation enter "Hello" & Name and that will yield Hello John as a result when John is entered into field called name. Place the field Name_Calc on your layout where you want it to appear. Hope this was what you were looking for. Link to comment Share on other sites More sharing options...
kodama Posted September 26, 2007 Author Share Posted September 26, 2007 (edited) I think I found a solution (Please tell me if there is a better way, I'm always doing 5000 things at work & feel like I'm taking crazy pills!) Fields: Name - Just text, set to john NameCalc - Set to "Hello ," & Name Create a layout text object: nameText (contents are just <>) Create another calc field: HelloCalc - Set to: GetLayoutObjectAttribute("nameText";"content") Edited September 26, 2007 by Guest Link to comment Share on other sites More sharing options...
kodama Posted September 26, 2007 Author Share Posted September 26, 2007 No, I am crazy, that didn't work. On to plan b (not the pill).... Link to comment Share on other sites More sharing options...
Raybaudi Posted September 26, 2007 Share Posted September 26, 2007 What about to place ONLY the first two fields ( and STOP ) on your layout ? Link to comment Share on other sites More sharing options...
Anuviel Posted September 26, 2007 Share Posted September 26, 2007 Are you trying to display the actual calculation syntax on your layout and the result it gives as in: Field A will display on the layout: "Hello ," & Name Field B will display Hello John provided that Name contains value John ? Or are you simply trying to display Hello John - if later then you can use either of the two examples given. Link to comment Share on other sites More sharing options...
comment Posted September 26, 2007 Share Posted September 26, 2007 It would be easier if you explained better what you're after. I guess you want to look at the Substitute() function - this can take text entered by a user (into a field!), and substitute fieldname codes with field contents. Also check out the Evaluate() function, that enables user to enter a calculation formula (in correct Filemaker syntax), and calculates the formula's result. Link to comment Share on other sites More sharing options...
kodama Posted September 26, 2007 Author Share Posted September 26, 2007 I'm so busy at wotk right now, I can't give a proper reply, must create a website and fix the backup system and other things within 1.5 hours. Yay! Basically, I was working with html, using substitute to take when someone types "maintitle" in an html page (for instance) and turn that into <> and piece together all the field definitions and bits of html code to make a calc that basically outputs an html page for an email template from a calc. I got FMP to perfectly construct the calc to output the html, but the result is never actually recognized as a calc by FMP... Link to comment Share on other sites More sharing options...
kodama Posted September 27, 2007 Author Share Posted September 27, 2007 FYI - I'll be doing this by just concat - ing all the code pieces & keywords with a function to find text between keywords (hopefully it works!). Thanks again for the replies and interest, people are great here! -D Link to comment Share on other sites More sharing options...
Recommended Posts
This topic is 6190 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 accountSign in
Already have an account? Sign in here.
Sign In Now