Re: [Gambas-user] ambiguous help

2009-08-19 Thread Doriano Blengino
Jean-Yves F. Barbier ha scritto:
 Hi list,

 I made a test as: A=B=C=5, the non-clear error msg is: 
 Ambiguous expression. Please use braces
 does it mean: {curly braces}, (round brackets / parenthesis) or [square 
 brackets]?
 (as many people improperly use the 2nd one with this name)

 JY
   
As this is basic (well, Almost Basic), normal parenthesis (-) should 
be used...
Are you trying to test for B equals C and assign the result to A? Or 
whatever? The gambas parser is not the most intelligent I've seen, but 
the expression is truely ambiguous, so the reply of the parser is 
'correctly' ambiguous too... :-)

Regards,
Doriano


--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ambiguous help

2009-08-19 Thread Benoît Minisini
 Jean-Yves F. Barbier ha scritto:
  Hi list,
 
  I made a test as: A=B=C=5, the non-clear error msg is:
  Ambiguous expression. Please use braces
  does it mean: {curly braces}, (round brackets / parenthesis) or [square
  brackets]? (as many people improperly use the 2nd one with this name)
 
  JY

 As this is basic (well, Almost Basic), normal parenthesis (-) should
 be used...
 Are you trying to test for B equals C and assign the result to A? Or
 whatever? The gambas parser is not the most intelligent I've seen, but
 the expression is truely ambiguous, so the reply of the parser is
 'correctly' ambiguous too... :-)

 Regards,
 Doriano


The '=' operator is binary and not associative, so your expression is 
ambiguous.

What you want to achieve is that:

(A = B) And (B = C) And (C = 5)

Regards,

-- 
Benoît

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ambiguous help

2009-08-19 Thread Jean-Yves F. Barbier
Doriano Blengino a écrit :
 Jean-Yves F. Barbier ha scritto:
 Hi list,

 I made a test as: A=B=C=5, the non-clear error msg is: 
 Ambiguous expression. Please use braces
 does it mean: {curly braces}, (round brackets / parenthesis) or [square 
 brackets]?
 (as many people improperly use the 2nd one with this name)

 JY
   
 As this is basic (well, Almost Basic), normal parenthesis (-) should 
 be used...

so, its brackets, not braces

 Are you trying to test for B equals C and assign the result to A? Or 
 whatever? The gambas parser is not the most intelligent I've seen, but 
 the expression is truely ambiguous, so the reply of the parser is 
 'correctly' ambiguous too... :-)

no, I don't wanna make a comparison, I just wanna have A=5, B=5  C=5
(did that in C if I remember well), as normally, the rightmost operande
should propagate to the left.
That's not SO important: I was just making small test to see if it was possible,
this is a very common writing in Python too.

-- 
Hear about...
the absent minded sculptor who put his model to bed and
started chiseling on his wife?

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ambiguous help

2009-08-19 Thread Benoît Minisini
 Doriano Blengino a écrit :
  Jean-Yves F. Barbier ha scritto:
  Hi list,
 
  I made a test as: A=B=C=5, the non-clear error msg is:
  Ambiguous expression. Please use braces
  does it mean: {curly braces}, (round brackets / parenthesis) or [square
  brackets]? (as many people improperly use the 2nd one with this name)
 
  JY
 
  As this is basic (well, Almost Basic), normal parenthesis (-) should
  be used...

 so, its brackets, not braces


You're right, I will fix that.

  Are you trying to test for B equals C and assign the result to A? Or
  whatever? The gambas parser is not the most intelligent I've seen, but
  the expression is truely ambiguous, so the reply of the parser is
  'correctly' ambiguous too... :-)

 no, I don't wanna make a comparison, I just wanna have A=5, B=5  C=5
 (did that in C if I remember well), as normally, the rightmost operande
 should propagate to the left.
 That's not SO important: I was just making small test to see if it was
 possible, this is a very common writing in Python too.

You must each assignment on its own line:

A = 5
B = 5
C = 5

Because of the BASIC syntax, '=' is the assignment operator *and* the equality 
comparison operator, and so the C-like syntax cannot be implemented.

Regards,

-- 
Benoît

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user


Re: [Gambas-user] ambiguous help

2009-08-19 Thread Jean-Yves F. Barbier
Benoît Minisini a écrit :
...
 You must each assignment on its own line:
 
 A = 5
 B = 5
 C = 5
 
 Because of the BASIC syntax, '=' is the assignment operator *and* the 
 equality 
 comparison operator, and so the C-like syntax cannot be implemented.

ok that's clear now :)

JY
-- 
I know why the sun never sets on the British Empire -- God wouldn't trust
an Englishman in the dark.
-- Duncan Spaeth

--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
___
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user