Jump to content
Server Maintenance This Week. ×

Data Viewer misrepresents trailing returns


LaRetta

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

Recommended Posts

I had never noticed this before.  I am not sure I would consider it a bug ... okay yes I would ... but regardless I thought others might be tripped by it.

 

I google searched and I've found no other discussions about it so I decided to make it obvious to FMI and post it here as well.

 

http://forums.filemaker.com/posts/2332acad8b

 

Link to comment
Share on other sites

I don't think this is a Data Viewer issue, but something deeper. Either a field display issue or a List() with trailing pilcrow issue.

 

ValueCount ( List ( "abc" ; "¶" ) ) = 2 in both the data viewer and a field calculation (even though the text box is displaying as 3 values).

 

Also ValueCount ( List ( "abc" ; "¶1" ) = 3.

Link to comment
Share on other sites

I think the example chosen might be distracting from the real issue. To put is simply, if a field contains a single word "abc" and you click into it and select the entire contents, the entire row is highlighted . OTOH, the Data Viewer highlights only the resulting word.

 

Since the same principle is applied to empty rows, it's easy to misinterpret the result obtained in Data Viewer.

Link to comment
Share on other sites

Except that's not necessarily accurate. I can select whole rows in the data viewer, and LaRetta's screen shot shows that.

 

I think the real issue is how List() handles "¶" as a standalone parameter and how FileMaker itself displays the result. Nothing to do with the Data Viewer, which I think it actually returning the correct result.

 

List ( "abc" ; "¶" ) has a valueCount() of 2 but looks like 3 values when displayed. See attached.


Except that's not necessarily accurate. I can select whole rows in the data viewer, and LaRetta's screen shot shows that.

 

I think the real issue is how List() handles "¶" as a standalone parameter and how FileMaker itself displays the result. Nothing to do with the Data Viewer, which I think it actually returning the correct result.

 

post-78393-0-97654500-1389202363_thumb.p

post-78393-0-83185200-1389202371_thumb.p

post-78393-0-88717500-1389202202_thumb.p

post-78393-0-53845500-1389202209_thumb.p

Link to comment
Share on other sites

I very-much appreciate both your inputs.   :laugh2:

 

Same thing happens, David, when you use "abc" & ¶ so List() itself makes no difference.  Your first example (in post #4) shows (to me) TWO carriage returns which is accurate.  The second image (Data Viewer) shows only one. 

 

So here is the real test to me ... use regular field.  Type abc then hit return ONCE.  Now drag down from immediately after the 'c'.  What do you see?  You will see two highlighted lines (the one with the text and one more).  This properly displays ONE carriage return.  Now do same in Data Viewer.  It will act like there is NONE ... this is Michael's example.  

 

So when working in Calculations in Data Viewer, I might think there are NO carriage returns and that I have success in the calculation when in fact it might have a trailing return still existing.  It is confusing and not with standard behaviours and expectations.  I used example of two returns (how first example properly displays two but second with DV only displays one).

 

And it DOES produce the correct results in the field if you set a field with its value ... and you can then drag in the field and get the correct results; it is only in the data viewer itself that it does not display properly.  It is quite disquieting to me.

 

edited:  Added portion in red for clarity

Edited by LaRetta
Link to comment
Share on other sites

I can select whole rows in the data viewer
 
Not really. If the formula used is "abc", then you cannot select the entire row in the Data Viewer - but you CAN do so in a calculation field (or in any field, for that matter).  This is also why List ( "abc" ; "¶" ) looks like 3 values when displayed in a field where Select All has been applied.
 
Compare also TextEdit with TextWrangler or BBEdit - you will see a similar difference (if that's a permissible phrase).
Link to comment
Share on other sites

Not at all ... it caught me during testing which is why I noticed the inconsistency.  

 

List ( "abc" ; "¶" ) should return 3 ... the abc, a carriage return inserted by List() and then another carriage return.  

Link to comment
Share on other sites

LOL, all I know is that it throws me and that I expect Data Viewer to show a highlighted row below the text if there is a trailing return and it doesn't.   

 

In reviewing all the solutions I've written back over the past few years, luckily none were caught by this issue but there could have been since I would trust DV.  I won't any more; at least not with trailing returns.   :hairy:  nope, never would be safer.

Edited by LaRetta
Link to comment
Share on other sites

 

List ( "abc" ; "¶" ) should return 3 ... the abc, a carriage return inserted by List() and then another carriage return.  

 

Except it doesn't...it returns 2. Because FileMaker doesn't consider a trailing pilcrow a "value". Even though you can select two lines in field display.

 

"abc¶¶123¶" counts as 3 values...the empty pilcrow in the middle counts as a value, but not the trailing one. That strikes me as odd. But an empty field counts (understandably) as 0 so maybe it's related to that?

Link to comment
Share on other sites

I am not sure we should think in terms of values but rather that a carriage return is a pattern; at least that is my latest take on it but that can change again any minute:

 

Compare this:
 
PatternCount ( List ( "abc" ; "¶" ) ; ¶ ) = 2
ValueCount ( List ( "abc" ; "¶" ) ) = 2
 
To this:
 
PatternCount (  List ( "abc" ; "¶" ;  "xyz" )  ; "¶" ) = 3
ValueCount (  List ( "abc" ; "¶" ; "xyz" ) ) = 4
 
:jester:
 
Well now I know that the entire row highlights after the end of text if there is a trailing return and if not there isn't (in Data Viewer).

Sorry, I removed the concatenation I had used while testing.  Post corrected.

Link to comment
Share on other sites

 

ValueCount (  List ( "abc" ; "¶" ; "xyz" ) )

 

returns 4, so it's not quite clear how to append a single value in order to get the count to 3.

 

 

How did I get 3?  I had a calculation:  List  ( "abc" ; "¶" ) and placed field on layout then drag-selected past the 'c' downward and saw 3 values (highlighted rows).  And because of similar tests as yours, I made an incorrect conclusion.

 

If we type abc into a field then hit return twice ... both PatternCount() and ValueCount() indicate two carriage returns (with value count calling it two values) but if you drag-select, it shows 3 lines.  Maybe Data Viewer is the one that is right ... maybe the FIELD display is what is wrong and it should not highlight the third row.   I should have used simple concatenation instead of bring in List() since it seems to add it's own twist. 

 

I sure love oddities.  Speaking of which, where is Daniele?  :laugh2:

Link to comment
Share on other sites

Maybe Data Viewer is the one that is right ...
 
Maybe, but then an awful lot of applications are wrong. I was actually surprised to see that TextEdit, Apple's showcase application, is also behaving like Data Viewer. OTOH Mail, coming from the same stable, behaves "normally" (i.e. according to what I consider normal behavior).
 
 
 
I sure love oddities.  Speaking of which, where is Daniele?  :laugh2:

 

LOL, that sure can be read in a number of ways...

Link to comment
Share on other sites

This topic is 3766 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.