Code that Crashes Codea

@Simeon not a crash as such, but strange behaviour where assets from previous projects can be accessed from new ones.

To recreate (iPad 3)

  1. Create new project. Add a custom sprite, “test1” to the Project assets using any externally created image
  2. Display sprite on screen
sprite("Project:test1",WIDTH/2,HEIGHT/2)
  1. Run to see the sprite
  2. Exit project
  3. Create new project
  4. Use the same command to display the sprite
  5. Run the project - the sprite appears even though it is not contained in the project assets.

After a while the new project “loses” the reference to the original sprite asset and an error is thrown.

Not a biggie, but has caught me out a couple of times now

@Simeon This doesn’t crash Codea, but I think this should be fixed anyways. It has to do with saveLocalData and readLocalData. The first section saves a string made of just numbers. When that string is read back in, it gets converted to a number instead of remaining a string. The second section saves a string of numbers which contains a decimal point. When that string is read back in, it remains a string. Probably because it’s not all digits. The third section saves a large number and when it’s read back in, it’s a wrong number. Maybe because it’s treated as a 32 bit number instead of a 64 bit number. The same thing happens with Project and Global Data.

function setup()
    print("save a string of just numbers.")
    a="123456"
    print("a= "..a.."  its a "..type(a))
    saveLocalData("val",a)
    print('saveLocalData("val",a)')
    a=readLocalData("val")
    print('a=readLocalData("val")')
    print("a= "..a.."  its NOW a "..type(a))
    print"\
=========================="
    
    print("\
save a string of numbers and a decimal point.")
    
    b="123456."
    print("b= "..b.."  its a "..type(b))
    saveLocalData("val",b)
    print('saveLocalData("val",b)')
    a=readLocalData("val")
    print('b=readLocalData("val")')
    print("b= "..b.."  its STILL a "..type(b))
    print"\
=========================="
    print("\
save a large number.")
    
    a=987654321
    print("a= "..a.."  its a "..type(a))
    saveLocalData("val",a)
    a=readLocalData("val")
    print("a= "..a.."  its a WRONG "..type(a))
end

I have found out a crash. If I put pRect.destroy() (pRect is my physics.body), at a convenient place, (not draw, for example) I run the app, and it crashes. I was pretty puzzled. I may be a bug. You should check that.

It should be with a colon, myBody:destroy()

Oh

I found one! Normally when you’re running code, you can swipe from the left side of the screen to open the code editor. If you set supportedOrientations(PORTRAIT) and hold your iPad in landscape mode, then swipe from the side of the screen (I guess from the bottom) it messes up the orientation

I know a very annoying bug, but not a crash.

Whenever I am coding, I code, run the code, and there is like a 4/10 chance of the keyboard popping up when you open the editor after running the program. (Even if I closed the keyboard before runnIng the code), and whenever I type in the editor, it glitches MAJOR. It puts random symbols everywhere. You can’t get rid of the keyboard unless you exit out of Codea. It’s a bug, for sure

@Simeon

I don’t know of a crash. But my tabs are getting deleted sometimes randomly. It’s the far most right ones too. (I have a lot).

I launched my app then went to edit some code and launched again and two of the tabs to the far right were deleted. This happened once before. It doesn’t reoccur a lot.

This has happened twice and I will keep an eye out for it.

I didn’t’ have an special characters.

Another not a crash but if you use fill emojis get filled, if you want that the emoji won’t be filled noFill will remove colors moment an. How then to get emoji?

I don’t know if it’s a bug, or…

Anyway, if I put:

if Sent and Message == “Destroy” then
Ball:destroy
End
End

If I do that, I run it, AND IT ALWAYS HAS A ERROR.

Hey, guys, this thread is about CRASHING Codea, not causing bugs

Yea, but how do you resolve my question?

Thank you for all the reported issues. I’ll be using this thread as reference while I fix bugs.

@LL_Phoenix456 - put brackets on the end of destroy

I did, it does the same thing, error. :frowning:

@LL_Phoenix456 - post some more code, but not in this thread (it is very likely you have coded something wrong, and it is unlikely to be a problem with Codea, so this is the wrong place to put it).

Ok, I will make a new thread

@simeon, does it mean the post will be stickied? (On top)