kodama Posted September 26, 2007 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!
bcooney Posted September 26, 2007 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..."
kodama Posted September 26, 2007 Author 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?
Anuviel Posted September 26, 2007 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.
kodama Posted September 26, 2007 Author 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
kodama Posted September 26, 2007 Author Posted September 26, 2007 No, I am crazy, that didn't work. On to plan b (not the pill)....
Raybaudi Posted September 26, 2007 Posted September 26, 2007 What about to place ONLY the first two fields ( and STOP ) on your layout ?
Anuviel Posted September 26, 2007 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.
comment Posted September 26, 2007 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.
kodama Posted September 26, 2007 Author 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...
kodama Posted September 27, 2007 Author 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
Recommended Posts
This topic is 6327 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