rellis32 Posted January 10, 2006 Posted January 10, 2006 I am working on a database that will send meeting requests in the icalendar format. I have had great success, mostly, but i am having problems with the DESCRIPTION part of the ical. The ical standards state that the DESCRIPTION must only be 75 characters long at a time, meaning i need a return after 75 bytes of data, wether it be spaces, numbers whatever. Is it possible to have filemaker do this? Meaning count 75 characters insert the carriage return, cout 75 more, etc... Any help would be greatly appreciated, I'm beating my head against a wall here. TIA Bob
Lee Smith Posted January 10, 2006 Posted January 10, 2006 Take a look at these files: By Bob Weaver and this one iCal filter HTH Lee
Ender Posted January 10, 2006 Posted January 10, 2006 Welcome Bob, How about something like: case(length(Description) > 75; left(Description;75) & ¶ & right(Description; length(Description) - 75); Description) Although, there are a couple limitations: First, the line breaks at the 75th character, even if it's in the middle of a word. Second, it doesn't solve the problem for lines over 150 characters. If these are problems, then a custom function may be required. Let us know.
rellis32 Posted January 11, 2006 Author Posted January 11, 2006 Thank you all for your input. After roughly 50 tries I came up with this Let( [ tf = Substitute(Event_Description;¶;"n") & "n"; //Change to whatever text field being used len = Length (tf)]; Case ( len ≤ 75 ; tf; len ≤ 150 ; Left (tf ; 75) & "¶" & Middle (tf ; 76 ; len - 75) ; len ≤ 225 ; Left (tf ; 75)& "¶" & Middle (tf ; 76 ; 75) & "¶" & Right (tf ; len - 150) ; len ≤ 300 ; Left (tf ; 75)& "¶" & Middle (tf ; 76 ; 75 )&"¶" & Middle (tf ; 151 ; 75 )& "¶" & Right (tf ; len -225) It seems outlook needs a hard carriage return to accept any data over 75 characters long, and it needs an n to format a return. this somewhat limits me to what i can put in the text field, unless i want to keep going with the calculation. I am curious if the aformentioned custom function could be changed to give the hard carriage return. I'm not sure if this is even allowed, changing someones function, if it isn't, please forgive me for asking. If it's ok, could i get some input on what i might need to change? Thank You! Bob
Søren Dyhr Posted January 11, 2006 Posted January 11, 2006 I'm not sure if this is even allowed, changing someones function, if it isn't, please forgive me for asking. It's actually a very good question since nothing like this is mentioned on Brian Dunnings site: http://www.gnu.org/philosophy/free-sw.html ...however would I be honest to admit that I make changes in them if I feel the urge for it. Before we dig deeper in your customization, should you perhaps read this thread as well: http://clevelandconsulting.com/support/viewtopic.php?t=230&sid=d469894e090792b0464088f8121482b6 Due to the different aspects they're debating! --sd
rellis32 Posted January 11, 2006 Author Posted January 11, 2006 That's the first time I have seen that Free Software Definition! Good Stuff! As far as the Cleveland Consulting function, it looks like that may work, I am assuming I can assign a "?" ? being a carriage return, to the Prefix ?? Thank you for your help! Bob
Lee Smith Posted January 11, 2006 Posted January 11, 2006 I'm sure that the author used /? because the ¶ (Pilcrow) doesn't always show as expected in the forums. Why not just run it through a text editor and replace the /? with the ¶ (Pilcrow) and then paste it into the Custom Function? HTH Lee
comment Posted January 11, 2006 Posted January 11, 2006 The custom functions mentioned here are attempting to hard wrap text at appropriate break points (with varying degrees of success...). It seems you are more interested in forcing a new line after exactly 75 characters, no matter what - so you can make it much simpler: ForceWrap ( text ; columnWidth ) Let ( [ line = Left ( text ; columnWidth ) ; nextText = Right ( text ; Length ( text ) - columnWidth ) ] ; line & Case ( Length ( nextText ) ; ¶ & ForceWrap ( nextText ; columnWidth ) ) ) Replace the paragraph symbol ¶ with whatever string you need as line delimiter.
rellis32 Posted January 11, 2006 Author Posted January 11, 2006 I gave this a shot, this is what outlook received Notes:n----------------------------------------nOn 1/10/2006 = at 10:=B6 14:18 PM - Adminn this is a testn the = and =B6 are where the carriage returns should be, i can't figure out why it is formating them like this??? This is the Function being used for this data: Let ( [ line = Left ( text ; columnWidth ) ; nextText = Right ( text ; Length ( text ) - columnWidth ) ] ; line & Case ( Length ( nextText ) ; "¶ " & Forcewrap ( nextText ; columnWidth ) ) ) I have tried with quotes, without quotes.... It looks exactly like the output from the calculation above in filemaker, it is just being sent diffrently. confused.... Bob
comment Posted January 11, 2006 Posted January 11, 2006 Why don't you give us the entire chain from input to output (Outlook?)? I am guessing the problem is in between applications - Filemaker uses a special symbol for in-field paragraph breaks. You can verify this by trying with a regular text field containing multiple lines, each no more that 75 characters.
rellis32 Posted January 11, 2006 Author Posted January 11, 2006 Ok, here goes: When i pre call a customer i put the notes in the notes field. This is the field i'm working with. I am using SMTPit pro to send Content-Type=text/calendar to the installer using the icalendar format, so the field that i am using as the email body looks like this; BEGIN:VCALENDAR PRODID:-//Microsoft Corporation//outlook 11.0 MIMEDIR//EN VERSION:2.0 METHOD:REQUEST BEGIN:VEVENT ATTENDEE;CN="()";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO: ORGANIZER:MAILTO:[email protected] DTSTART:600220T760000Z DTEND:600220T760000Z LOCATION:edited TRANSP:OPAQUE SEQUENCE:0 UID:1032839 DTSTAMP:20060111T193839Z DESCRIPTION: Notes:n----------------------------------------nOn 1/10/2006 at 10:14:18¶ PM - Adminn this is a testn SUMMARY:edited PRIORITY:3 X-MICROSOFT-CDO-IMPORTANCE:1 CLASS:PUBLIC END:VEVENT END:VCALENDAR The problem child is the DESCRIPTION part. Some of these are formatted dynamically and some are constant, depending on the information. But, the DESCRIPTION, and I quote, Lines of text SHOULD NOT be longer than 75 octets, excluding the line break. Long content lines SHOULD be split into a multiple line representations using a line "folding" technique. That is, a long line can be split between any two characters by inserting a CRLF immediately followed by a single linear white space character (i.e., SPACE, US-ASCII decimal 32 or HTAB, US-ASCII decimal 9). Any sequence of CRLF followed immediately by a single linear white space character is ignored (i.e., removed) when processing the content type. So basically, as long as i keep the description to under 75, all is well, but in reallity, these will often times be over 1000 characters long. If you look at the calculation above, i think my second post, this works, for information under 300 characters long. I can continue the calculation, make it as long as I want, I guess, I just didn't think this was a very efficient way of doing it. I am somewhat confused by the fact that this calculation works, but the custom function above did not, when put side by side in seperate fields, they look identical, but obviously they're not. Thank you all for your time and effort in this! Bob
comment Posted January 11, 2006 Posted January 11, 2006 I used the calc in your post #189673 above for one field. In the other field, I have this: ForceWrap ( Substitute ( Text ; ¶ ; "n" ) & "n" ; 75 ) The Forcewrap CF is modified to use "¶" (as in your post #189755 above). Using the Exact() function for comparison, the two results are identical.
rellis32 Posted January 11, 2006 Author Posted January 11, 2006 This is GREAT! It works perfectly, I can't believe I didn't try this combination, but no matter, it works now. Thank you all for your help, much appreciated! Bob
rellis32 Posted January 12, 2006 Author Posted January 12, 2006 (edited) false alarm,user error :B Edited January 12, 2006 by Guest
Recommended Posts
This topic is 6955 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