Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 6653 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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!

Posted

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 )

Posted (edited)

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 by Guest
Posted (edited)

Case ( LeftValues ( HTML ; 1 ) = "¶"; MiddleValues ( HTML ; 2 ;ValueCount ( HTML ) ); HTML )

Basically, It will return everything starting with the second line.

Edited by Guest
Changed title field to HTML
Posted (edited)

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 by Guest
Posted

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

This topic is 6653 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.