Actions
Bug #58
closedRight$()=, Left$()= and Mid$()= Causing transpiler problem when used within Procedures
Start date:
01/21/2020
Due date:
01/31/2020
% Done:
0%
Estimated time:
Affected version:
Description
When used in procedures, the above commands are causing an additional entry to the 'self.vars=' list in the application.js code.
Updated by Francois Lionet almost 5 years ago
- Status changed from New to Feedback
- Target version set to 0.9.3.2
Just checked, cannot see any problem. Please provide example source code, and also the extract of the compiled application's code pointing to what you think is wrong... ;)
Updated by Anonymous almost 5 years ago
Here's the code.
This will compile and run as it is, but causes a runtime error. If you omit the line that starts "Right$", no error.
Screen Open 1,400,300,32,Lowres
Print "Hello World"
Dim SC(6)
Procedure SCOREUPDATE
Shared EXTRAMAN,SCORE,SC(),LIFE
If SCORE/30000>EXTRAMAN
LIFE=LIFE+1
EXTRAMAN=SCORE/30000
// LIFEDISP
End If
If SCORE>1000000 Then SCORE=SCORE-1000000
Autoback 1
SCORE2$="0000000"
SCORE1$=Str$(SCORE)
SCLEN=Len(SCORE1$)-1
SCORE1$=Right$(SCORE1$,SCLEN)
Right$(SCORE2$,SCLEN)=SCORE1$
For N=1 To 6
If SC(N)<>Asc(Mid$(SCORE2$,N+1,1))-48
SC(N)=Asc(Mid$(SCORE2$,N+1,1))-48
Paste Icon 32,160+16*(N-1),SC(N)+31
End If
Next N
Autoback 0
End Proc
Updated by David Baldwin almost 5 years ago
Here's the extract for application.jsvar self=this;
this.reset=function()
{
self.vars=
{
SCORE2$:"",
SCORE1$:"",
SCLEN:0,
N:0,
:"" <<<----- This shouldn't be here.
};
};
Updated by Baptiste Pillot almost 5 years ago
- source : https://aozmine.25.re/issues/58
- run : https://www.amos2.fr/run/tickleman/58/
- console :
SyntaxError: expected property name, got ':' application.js:76:3
ReferenceError: Application is not defined 58:335:5
<anonyme> https://www.amos2.fr/run/tickleman/58/:335
Updated by Baptiste Pillot almost 5 years ago
- Due date set to 01/31/2020
- Status changed from Feedback to Closed
The js error is now resolved, that's ok.
Actions