Welcome, Guest. Please Login
Tinderbox
  News:
IMPORTANT MESSAGE! This forum has now been replaced by a new forum at http://forum.eastgate.com and no further posting or member registration is allowed. The forum is still accessible via read-only access for reference purposes. If you wish to discuss content here, please use the new forum. N.B. - posting in the new forum requires a fresh registration in the new forum (sorry - member data can't be ported).
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Lots of problems with TBX 6.5 (fixed) (Read 1902 times)
B.Moreira
Full Member
*
Offline



Posts: 71

Lots of problems with TBX 6.5 (fixed)
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.
Back to top
 
« Last Edit: Apr 20th, 2016, 7:54pm by Mark Bernstein »  
  IP Logged
Desalegn
Full Member
*
Offline



Posts: 78
Norway
Re: Lots of problems with TBX 6.5 (can't open notes)
Reply #1 - Apr 20th, 2016, 11:19am
 
I think this is 6.4

http://bit.ly/1VC4n3g
Back to top
 
« Last Edit: Apr 20th, 2016, 11:23am by Desalegn »  
  IP Logged
B.Moreira
Full Member
*
Offline



Posts: 71

Re: Lots of problems with TBX 6.5 (can't open notes)
Reply #2 - Apr 20th, 2016, 11:22am
 
Thanks! Been searching the site with no luck.
Back to top
 
 
  IP Logged
B.Moreira
Full Member
*
Offline



Posts: 71

Re: Lots of problems with TBX 6.5 (can't open notes)
Reply #3 - 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.
Back to top
 
 
  IP Logged
B.Moreira
Full Member
*
Offline



Posts: 71

Re: Lots of problems with TBX 6.5 (can't open notes)
Reply #4 - 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
Back to top
 
 
  IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Lots of problems with TBX 6.5 (can't open notes)
Reply #5 - 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.
Back to top
 
 

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
B.Moreira
Full Member
*
Offline



Posts: 71

Re: Lots of problems with TBX 6.5 (can't open notes)
Reply #6 - Apr 20th, 2016, 1:42pm
 
Thank you for the clarification Mark. So, v6.4 was being permissive on this.
Back to top
 
 
  IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Lots of problems with TBX 6.5 (fixed)
Reply #7 - Apr 20th, 2016, 7:54pm
 
It would help if you'd send one of the crash logs to info@eastgate.com .
Back to top
 
 
WWW   IP Logged
Mark Anderson
YaBB Administrator
*
Offline

User - not staff!

Posts: 5689
Southsea, UK
Re: Lots of problems with TBX 6.5 (fixed)
Reply #8 - 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:
Back to top
 
« Last Edit: Apr 21st, 2016, 10:51am by Mark Bernstein »  

--
Mark Anderson
TB user and Wiki Gardener
aTbRef v6
(TB consulting - email me)
WWW shoantel   IP Logged
Mark Bernstein
YaBB Administrator
*
Offline

designer of
Tinderbox

Posts: 2871
Eastgate Systems, Inc.
Re: Lots of problems with TBX 6.5 (fixed)
Reply #9 - 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!
Back to top
 
 
WWW   IP Logged
Michael Bywater
Full Member
*
Offline



Posts: 9

Re: Lots of problems with TBX 6.5 (fixed)
Reply #10 - Apr 22nd, 2016, 1:50pm
 
Quote:
This means, ironically, the the string "false" is true!


Ha! I knew it! That Cretan WAS a liar!
Back to top
 
 
  IP Logged
B.Moreira
Full Member
*
Offline



Posts: 71

Re: Lots of problems with TBX 6.5 (fixed)
Reply #11 - May 12th, 2016, 4:36am
 
 Cheesy
Back to top
 
 
  IP Logged
Pages: 1
Send Topic Print