Start a new topic
Solved

A number of potential bugs

There seem to be a number of bugs in the Nextion code.  Some of these may turn out to be something else but here goes:


1. If I try to send a number to a text box,the compiler does not object - but the number does not appear in the text box? How do we show numbers in text boxes?


2. If you swap from one page to another, say from p0 to p1, the timer stops working.... which makes repeating screen timeouts for every page awkward?


3. Variables cannot have names which start with the same letters as internal variables - so for example a variable DIMSUM will fail because there is an internal variable called DIM.. surely that can't be right?


4. The IF logic seems to have a problem.... I have seen "if a>10" fail.... See this example...


if (dtimer.val<0)

{

dtimer.val=2

}

if(dtimer.val>=10)

{

dim=100

}

if(dtimer.val==9)

{

dim=dtimer.val*10

}

if(dtimer.val==8)

{

dim=dtimer.val*10

}

if(dtimer.val==7)

{

dim=dtimer.val*10

}

if(dtimer.val==6)

{

dim=dtimer.val*10

}

if(dtimer.val==5)

{

dim=dtimer.val*10

}

if(dtimer.val==4)

{

dim=dtimer.val*10

}

if(dtimer.val==3)

{

dim=dtimer.val*10

}

if(dtimer.val==2)

{

dim=dtimer.val*10

}

if (dtimer.val!=0)

{

dtimer.val=dtimer.val-1

}

 

The above example FAILS  to stop negative numbers even though the first statement should correct that.


5. This code on a button - continues over 100 if you keep pressing the button


if (page0.va0.val<=90)

{

page0.va0.val=page0.va0.val+10

}

j0.val=page0.va0.val

 

Finally - we REALLY need an ELSE statement...


1 person has this problem
1 Comment

These issues are no longer a problem in the current Nextion Editor.

These have been tested on v0.38 of the Nextion Editor on 10/31/2016


1) the cov command is now used to display a numeric value in a Text component.  A Number component has also been added.

2) Timers from one page stopping when switching pages should be deemed the default and expected behaviour as page is not in memory.  Global attribute is to store values and not whole components.

3) declaring dimsum variable no longer does not create an error

4) testing the code in 4 with a value of -40 returns a dim value of 20 - as per the logic

5) testing the code from 5, j0.val increases by 10 until over 90 and holds


As this is a historic issue, it will now be marked as solved.