November 6, 200619 yr We've got a field in FM that holds HTML used for eBay auction descriptions. This HTML is generated dynamically using an ASP script. The field in FM that holds this is simply a single line that they paste their HTML into. It's not meant to see the entire contents of the field, just so that they have ability to populate it and see that it is populated. So, all you see in this field within FM is the very first line of the pasted HTML. The problem I'm having is that because the HTML is generated from an ASP script, the ASP code at the top of the page gets left out of View Source, and as such, it leaves a blank line at the top of the HTML code. When this is pasted into the field in FM it looks like the field is empty because all you see is the first line...the blank line. Is there a way I can make this field automatically remove that carriage return at the beginning? Any information would be greatly appreciated. Thanks!
November 6, 200619 yr I guess you can try something like this in a calculated field with 'Do not replace existing..." unchecked, or if you do not want to use this then you can use a substitute. Case ( LeftValues ( field ; 1 ) = "¶"; MiddleValues ( field ; 2 ;ValueCount ( field ) ); field )
November 6, 200619 yr Author Ok, I'm following that some-what, but I'm not sure how to tell it to remove only the leading carriage return. Case ( LeftValues ( HTML ; 1) = "¶" ; Remove_That_Carriage_Return ; HTML) What do I replace my placeholder with? If I use substitute it would remove all carriage returns, right? I only want to remove that very first one. Edited November 6, 200619 yr by Guest
November 6, 200619 yr Case ( LeftValues ( HTML ; 1 ) = "¶"; MiddleValues ( HTML ; 2 ;ValueCount ( HTML ) ); HTML ) Basically, It will return everything starting with the second line. Edited November 6, 200619 yr by Guest Changed title field to HTML
November 6, 200619 yr Author Ok, cool, that seems to have worked. I didn't realize that's already what you were showing me. Thanks!! On a side note, is there a difference between the Case function and then If function? Edited November 6, 200619 yr by Guest
November 6, 200619 yr In this case you could interchange the case function with the if function. However, case() and if() are not the same. With the If function, you are basically testing true or false; this or that. With the Case function, it tests the expression in order and you can add a default if none of your tests are matched. Case (y=2; "quick"; x=3; "brown"; y=2; "jumped") will return "quick" if y=2 and x=3 but if y=1 and x=3, then it will return "brown" HTH
Create an account or sign in to comment