LassoApp bug when using Math_ tags

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

LassoApp bug when using Math_ tags

Michael Coninx
Tested with LP 7.1.3. on Mac OS 10.3.x

When compiling the following code, the output is wrong (and not when
just running the code in a format file).

[Variable: 'intCorrect'=2]Correct: [$intCorrect]<br>
[Variable: 'intIncorrect'=1]Incorrect: [$intIncorrect]<br>

[Variable: 'intTotal'=(Math_Add: $intCorrect, $intIncorrect)]Total:
[$intTotal]<br>
<p>
<b>No Explicit Casting:</b><br>
[Variable: 'decCorrect'=(Math_Mult: $intCorrect, 1.00)]
[Variable: 'intScore'=(Math_Mult: (Math_Div: $decCorrect, $intTotal), 100)]
[Variable: 'intPercent'=(Math_Round: $intScore, 1)]

Correct Decimal: [$decCorrect] (Correct * 1.00)<br>
Score: [$intScore] ((Correct Decimal / Total) * 100)<br>
Percentage: [$intPercent]% (Rounded Score)<br>
<p>
<b>No Explicit Casting and No Math_ functions:</b><br>
[Variable: 'decCorrect'=$intCorrect * 1.00]
[Variable: 'intScore'=($decCorrect / $intTotal) * 100]
[Variable: 'intPercent'=(Math_Round: $intScore, 1)]

Correct Decimal: [$decCorrect] (Correct * 1.00)<br>
Score: [$intScore] ((Correct Decimal / Total) * 100)<br>
Percentage: [$intPercent]% (Rounded Score)<br>
<p>
<b>With Explicit Casting:</b><br>
[Variable: 'decCorrect'=(Math_Mult: $intCorrect, 1.00)]
[Variable: 'intScore'=(Math_Mult: (Math_Div: (Decimal: $decCorrect),
$intTotal), 100)]
[Variable: 'intPercent'=(Math_Round: $intScore, 1)]

Correct Decimal: [Decimal: $decCorrect] (Correct * 1.00)<br>
Score: [$intScore] ((Correct Decimal / Total) * 100)<br>
Percentage: [$intPercent]% (Rounded Score)<br>
<p>
<b>With Explicit Casting and No Math_ functions:</b><br>
[Variable: 'decCorrect'=$intCorrect * 1.00]
[Variable: 'intScore'=((Decimal: $decCorrect) / $intTotal) * 100]
[Variable: 'intPercent'=(Math_Round: $intScore, 1)]

Correct Decimal: [Decimal: $decCorrect] (Correct * 1.00)<br>
Score: [$intScore] ((Correct Decimal / Total) * 100)<br>
Percentage: [$intPercent]% (Rounded Score)<br>


Output Format File:

Correct: 2
Incorrect: 1
Total: 3

No Explicit Casting:
Correct Decimal: 2.00 (Correct * 1.00)
Score: 67.00 ((Correct Decimal / Total) * 100)
Percentage: 67% (Rounded Score)

No Explicit Casting and No Math_ functions:
Correct Decimal: 2 (Correct * 1.00)
Score: 66.6667 ((Correct Decimal / Total) * 100)
Percentage: 67% (Rounded Score)

With Explicit Casting:
Correct Decimal: 2.00 (Correct * 1.00)
Score: 67.00 ((Correct Decimal / Total) * 100)
Percentage: 67% (Rounded Score)

With Explicit Casting and No Math_ functions:
Correct Decimal: 2 (Correct * 1.00)
Score: 66.6667 ((Correct Decimal / Total) * 100)
Percentage: 67% (Rounded Score)


Output LassoApp

Correct: 2
Incorrect: 1
Total: 3

No Explicit Casting:
Correct Decimal: 2 (Correct * 1.00)
Score: 0 ((Correct Decimal / Total) * 100)
Percentage: 0% (Rounded Score)

No Explicit Casting and No Math_ functions:
Correct Decimal: 2 (Correct * 1.00)
Score: 66.6667 ((Correct Decimal / Total) * 100)
Percentage: 67% (Rounded Score)

With Explicit Casting:
Correct Decimal: 2 (Correct * 1.00)
Score: 0 ((Correct Decimal / Total) * 100)
Percentage: 0% (Rounded Score)

With Explicit Casting and No Math_ functions:
Correct Decimal: 2 (Correct * 1.00)
Score: 66.6667 ((Correct Decimal / Total) * 100)
Percentage: 67% (Rounded Score)


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage
Reply | Threaded
Open this post in threaded view
|

Re: LassoApp bug when using Math_ tags

Adam Randall
The math_add, math_div, math_mult, math_mod, math_round and math_sub  
tags are extremely old, and you should be using the their  
equivalents: +, /, *, %, decimal->setformat and - respectively.

What seems to be going on is that the math tags are casting  
themselves differently inside of lassoapps as compared to the format  
files. The work around is to change your code to current tags.

As a note, the behavior of the math_... tags in 8 have not changed  
from 7, so this particular behavior is still present in Lasso Pro 8.

Regards,

Adam.

--
Adam Randall <[hidden email]>
http://www.omnipilot.com/
(954) 874-3100
AIM/iChat: adamomni

On Aug 3, 2005, at 11:31 AM, Michael Coninx wrote:

> Tested with LP 7.1.3. on Mac OS 10.3.x
>
> When compiling the following code, the output is wrong (and not  
> when just running the code in a format file).
>
> [Variable: 'intCorrect'=2]Correct: [$intCorrect]<br>
> [Variable: 'intIncorrect'=1]Incorrect: [$intIncorrect]<br>
>
> [Variable: 'intTotal'=(Math_Add: $intCorrect, $intIncorrect)]Total:  
> [$intTotal]<br>
> <p>
> <b>No Explicit Casting:</b><br>
> [Variable: 'decCorrect'=(Math_Mult: $intCorrect, 1.00)]
> [Variable: 'intScore'=(Math_Mult: (Math_Div: $decCorrect,  
> $intTotal), 100)]
> [Variable: 'intPercent'=(Math_Round: $intScore, 1)]
>
> Correct Decimal: [$decCorrect] (Correct * 1.00)<br>
> Score: [$intScore] ((Correct Decimal / Total) * 100)<br>
> Percentage: [$intPercent]% (Rounded Score)<br>
> <p>
> <b>No Explicit Casting and No Math_ functions:</b><br>
> [Variable: 'decCorrect'=$intCorrect * 1.00]
> [Variable: 'intScore'=($decCorrect / $intTotal) * 100]
> [Variable: 'intPercent'=(Math_Round: $intScore, 1)]
>
> Correct Decimal: [$decCorrect] (Correct * 1.00)<br>
> Score: [$intScore] ((Correct Decimal / Total) * 100)<br>
> Percentage: [$intPercent]% (Rounded Score)<br>
> <p>
> <b>With Explicit Casting:</b><br>
> [Variable: 'decCorrect'=(Math_Mult: $intCorrect, 1.00)]
> [Variable: 'intScore'=(Math_Mult: (Math_Div: (Decimal:  
> $decCorrect), $intTotal), 100)]
> [Variable: 'intPercent'=(Math_Round: $intScore, 1)]
>
> Correct Decimal: [Decimal: $decCorrect] (Correct * 1.00)<br>
> Score: [$intScore] ((Correct Decimal / Total) * 100)<br>
> Percentage: [$intPercent]% (Rounded Score)<br>
> <p>
> <b>With Explicit Casting and No Math_ functions:</b><br>
> [Variable: 'decCorrect'=$intCorrect * 1.00]
> [Variable: 'intScore'=((Decimal: $decCorrect) / $intTotal) * 100]
> [Variable: 'intPercent'=(Math_Round: $intScore, 1)]
>
> Correct Decimal: [Decimal: $decCorrect] (Correct * 1.00)<br>
> Score: [$intScore] ((Correct Decimal / Total) * 100)<br>
> Percentage: [$intPercent]% (Rounded Score)<br>
>
>
> Output Format File:
>
> Correct: 2
> Incorrect: 1
> Total: 3
>
> No Explicit Casting:
> Correct Decimal: 2.00 (Correct * 1.00)
> Score: 67.00 ((Correct Decimal / Total) * 100)
> Percentage: 67% (Rounded Score)
>
> No Explicit Casting and No Math_ functions:
> Correct Decimal: 2 (Correct * 1.00)
> Score: 66.6667 ((Correct Decimal / Total) * 100)
> Percentage: 67% (Rounded Score)
>
> With Explicit Casting:
> Correct Decimal: 2.00 (Correct * 1.00)
> Score: 67.00 ((Correct Decimal / Total) * 100)
> Percentage: 67% (Rounded Score)
>
> With Explicit Casting and No Math_ functions:
> Correct Decimal: 2 (Correct * 1.00)
> Score: 66.6667 ((Correct Decimal / Total) * 100)
> Percentage: 67% (Rounded Score)
>
>
> Output LassoApp
>
> Correct: 2
> Incorrect: 1
> Total: 3
>
> No Explicit Casting:
> Correct Decimal: 2 (Correct * 1.00)
> Score: 0 ((Correct Decimal / Total) * 100)
> Percentage: 0% (Rounded Score)
>
> No Explicit Casting and No Math_ functions:
> Correct Decimal: 2 (Correct * 1.00)
> Score: 66.6667 ((Correct Decimal / Total) * 100)
> Percentage: 67% (Rounded Score)
>
> With Explicit Casting:
> Correct Decimal: 2 (Correct * 1.00)
> Score: 0 ((Correct Decimal / Total) * 100)
> Percentage: 0% (Rounded Score)
>
> With Explicit Casting and No Math_ functions:
> Correct Decimal: 2 (Correct * 1.00)
> Score: 66.6667 ((Correct Decimal / Total) * 100)
> Percentage: 67% (Rounded Score)
>
>
> --
> ------------------------------
> Lasso Support: http://support.omnipilot.com/
> Search the list archives: http://www.listsearch.com/lassotalk.lasso
> Manage your list subscription:  http://www.listsearch.com/ 
> lassotalk.lasso?manage
>


--
------------------------------
Lasso Support: http://support.omnipilot.com/
Search the list archives: http://www.listsearch.com/lassotalk.lasso
Manage your list subscription:  
http://www.listsearch.com/lassotalk.lasso?manage