Comments (5)
That's strange... It seems to work as expected for me!
Have you got any errors in DevTools about it? Do you know if the type conversion error occurs for print array
or just print array[0]+1
?
from atto.
I forgot to mention, yes, the error only occurs at array[0]+1
. What is weird, is that it works on the phone, but both devices keep atto up-to-date. I can't check it on the PC right now, but when I can, I will write more info.
from atto.
What is even weirder is that it still works on my phone, but when it's in this code (it's on the bottom of the comment), it doesn't work on both devices (coord2Array[0] is a normal number). I tried running this code (on the phone) and tried these commands:
dim abc:push 23,abc:print abc[0]+2
(returns 25, works ok)
print coord2Array[0]+2
(Type conversion error
)
Basically, it's like this:
- Works on PC? No
- Works on mobile? Yes
- Works on PC in this code? No
- Works on mobile in this code? No
Even if I am doing something wrong, the simple dim x:push 1,x:print x+1
command returns different results on different devices. I don't think it should have problems converting 2 into a number though.
from atto.
Weirdly, it works on PC now, but not in the code. Here's a DevTools screenshot of running this code on PC. There are no new error messages after the conversion error.
from atto.
It might not seem immediately obvious, but coord2Array
items appear to be strings, which won't work with the +
operator! To get it to work, you'll need to modify your program to be:
304 value0=coord2Array[0]:value1=coord2Array[1]
305 push value0%+sin(goAngle%);";";value1%+cos(goAngle%),snake
At the moment, list items can't be casted to a number like coord2Array[0]%
, so the items must be stored in variables that can then be subsequently casted. It might be worth modifying atto and making the +
operator automatically cast strings to numbers (just like how ;
basically casts numbers to strings when used) to prevent the confusing type conversion error
, so I'll keep the issue open for that.
from atto.
Related Issues (20)
- editor detects and breaks program when reserved words are within variables HOT 1
- gosub does not work as expected not ending nicely the program HOT 1
- sqrt(0) returns Maths error HOT 5
- Unicode support HOT 2
- Add more courses HOT 3
- Add command reference for shell commands
- Allow for boolean variable conditions without equality check in `if` HOT 1
- [Announcement] atto is moving to a new home soon! HOT 2
- Add more functions, and document them
- Docs UX improvements
- Extload doesn't work HOT 9
- "random" in "draw" works incorrectly HOT 3
- Line cursor's position doesn't update sometimes HOT 2
- Can't use `renum` HOT 6
- mid$ doesn't work with 0,0 arguments HOT 2
- Make last argument to `mid$` optional
- Input lag on Firefox HOT 1
- Add how to delete lines for beginner's guide HOT 1
- Add home and close buttons for help, and popout option HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from atto.