Project

General

Profile

Bug #58

Right$()=, Left$()= and Mid$()= Causing transpiler problem when used within Procedures

Added by David Baldwin over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Target version:
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.

#1

Updated by Francois Lionet over 2 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... ;)

#2

Updated by Anonymous over 2 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
#3

Updated by David Baldwin over 2 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.
    };
};
#4

Updated by Baptiste Pillot over 2 years ago

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
#5

Updated by Baptiste Pillot over 2 years ago

  • Due date set to 01/31/2020
  • Status changed from Feedback to Closed

The js error is now resolved, that's ok.

Also available in: Atom PDF