Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi
Tinderbox Users >> Questions and Answers >> Lots of problems with TBX 6.5 (fixed)
http://www.eastgate.com/Tinderbox/forum//YaBB.cgi?num=1461165127

Message started by B.Moreira on Apr 20th, 2016, 11:12am

Title: Lots of problems with TBX 6.5 (fixed)
Post by B.Moreira on Apr 20th, 2016, 11:12am

Hi,
I am having lots of problems when trying to open some notes ... I am at a point where I have information on the file that I can't access.

Can TBX team give me a link to 6.4 version of TBX?

Thanks.

Title: Re: Lots of problems with TBX 6.5 (can't open notes)
Post by Desalegn on Apr 20th, 2016, 11:19am

I think this is 6.4

http://bit.ly/1VC4n3g

Title: Re: Lots of problems with TBX 6.5 (can't open notes)
Post by B.Moreira on Apr 20th, 2016, 11:22am

Thanks! Been searching the site with no luck.

Title: Re: Lots of problems with TBX 6.5 (can't open notes)
Post by B.Moreira on Apr 20th, 2016, 11:28am

Now I'm at peace. The file and content is fine in TBX6.4.
I will try to understand why I can't open some notes on 6.5. I'll post here if I find the reason.

Title: Re: Lots of problems with TBX 6.5 (can't open notes)
Post by B.Moreira on Apr 20th, 2016, 11:36am

For this particular note, the problem was the $Rule:


Code:
if ($HasMapView = "true") {
$DisplayExpression = $Name + " [MAP]"
};
$DisplayExpression = uppercase($Name) + " [TOP]";


crashes on TBX6.5 when selecting the note that has the above rule; but opens fine on TBX6.4.



Code:
if ($HasMapView = "true") {
$DisplayExpression = $Name + " [MAP]"
};


works fine on both 6.4 and 6.5

Title: Re: Lots of problems with TBX 6.5 (can't open notes)
Post by Mark Anderson on Apr 20th, 2016, 12:41pm

Let's assume $Name is 'Project X'. Your code (working or not) is setting the code of $DisplayExpression to literal strings like:

"PROJECT X"

and not action code like:

uppercase($Name) + " [TOP]"

If you're trying to set $DisplayExpression, you must pass the code as a string, like so:

$DisplayExpression = 'uppercase($Name) + " [TOP]"';

Note the extra single quotes around the code - I put them in red - which stop the code being evaluated before it is stored in $DisplayExpression. The single quotes are needed as the code contains double quotes.

Title: Re: Lots of problems with TBX 6.5 (can't open notes)
Post by B.Moreira on Apr 20th, 2016, 1:42pm

Thank you for the clarification Mark. So, v6.4 was being permissive on this.

Title: Re: Lots of problems with TBX 6.5 (fixed)
Post by Mark Bernstein on Apr 20th, 2016, 7:54pm

It would help if you'd send one of the crash logs to info@eastgate.com .

Title: Re: Lots of problems with TBX 6.5 (fixed)
Post by Mark Anderson on Apr 21st, 2016, 3:50am

Other things I missed which may be a incidental factor (i.e. some things for others not avoid), are
  • quoting a Boolean
  • the use of the legacy form of equality test
Boolean values in Tinderbox are written case-sensitively all-lowercase: true and false. Do not place quotes around Boolean values, as then you're telling Tinderbox that it is a literal string. When parsing a query Tinderbox may guess correctly the meaning of bad syntax but it may give an unexpected result (worst case, a crash).

The second issue is your use of 'X = Y' in a query. Since v4 era that syntax has meant. 'set the value of X to the value of Y'. †To test equality use '==' as in 'X==Y'. The old form should still work in existing docs but it's deprecated for new use.

You wanted to test is the values of a (presumed) Boolean-type attribute $HasMapView was true. You actually wrote code to set the value to the Boolean attribute to a literal string "true".

if ($HasMapView = "true") { † <== Do not use this syntax!

Instead use this form:

if ($HasMapView == true) { † <== CORRECT

White space around the '==' or inside the '()" doesn't matter.

More on:

Title: Re: Lots of problems with TBX 6.5 (fixed)
Post by Mark Bernstein on Apr 21st, 2016, 10:57am

Mark Andersonís points are good, though I suspect there's something else amiss in this document. The logs will likely tell us.

But itís good to remember the difference between the keywords true and false and the strings "true" and "false".  Tinderbox automatically coerces data types to be true or false when testing conditions; for example, we can write

    if($MyString) {.....}
or
    if($MyNumber) {....}

The number zero is treated as false, and all other values are true. The empty string is treated as false, and all other strings are treated as true.

This means, ironically, the the string "false" is true!

Title: Re: Lots of problems with TBX 6.5 (fixed)
Post by Michael Bywater on Apr 22nd, 2016, 1:50pm


Quote:
This means, ironically, the the string "false" is true!


Ha! I knew it! That Cretan WAS a liar!

Title: Re: Lots of problems with TBX 6.5 (fixed)
Post by B.Moreira on May 12th, 2016, 4:36am

 :D

Tinderbox User-to-User Forum (for formal tech support please email: info@eastgate.com) » Powered by YaBB 2.2.1!
YaBB © 2000-2008. All Rights Reserved.