Codea 2.3 Beta



  • edited March 2015 Posts: 91

    @Saturn031000 @simeon

    This is probably caused by unrecoverable memory overflow during immutable string copying.

    I have also caused the jump out of codea to home screen by trying to edit a very long tab in the editor. I put large outputs in a tab instead of printing it so I can search it with the editor but I cannot edit that tab.

    My suggestion is to handle long strings with only one reference in some way that does not require the copying of the string but doing a classic edit in place.

    Perhaps adding the function string.editLongStringInPlace(string,function doing edit) would be simple enough to do if it is easy to determine if the string has only one reference.

    Lots of my code just adds to the end of a long string: out=out.."add to string"

    This type of action may be the only problem with long immutable strings.

    Perhaps implementing a long string as a userdata with C type processing might help be an easier solution?

  • IgnatzIgnatz Mod
    edited March 2015 Posts: 5,396

    @Bri_G - something I sometimes do when I am printing out long strings is to write them as code, into a code tab, with -[[ and --]] on each end to make it a comment. See the Storage section of the reference for how to do this.

    You will only be able to see the output when you stop your program, but it can be as long as you need.

  • dave1707dave1707 Mod
    Posts: 8,400

    You could saveText to a file. I have several text files greater than 1 meg and don't have any problems with them.

  • edited March 2015 Posts: 91

    no way yet for me to link to pictures this text description is all I can do now

    I think lots of under-text colors get displaced after console or search left side box opened.

    Could the OVERLAY, FULLSCREEN and STANDARD testing be missing at times when lines rewrapped?

    blue bubble on this line
    sprite("Document:xxx",...  on next line 
    happens sometimes when long line becomes two lines when search started.
    May be an editor layout bug when lines wrap.
    note error red arrows often confusing and on wrong line and the error lines don't tell what the error is
  • Posts: 1,729


    Thanks for the feedback, never used it before but saveProjectTab() did the job. In app reference to it better than the webpage reference. Nice way round the problem, but I'm still concerned about the Codea crash on printing big files. I think it needs to be resolved but probably low priority.


  • Jmv38Jmv38 Mod
    edited March 2015 Posts: 3,295

    i've just noticed that putting this outide the draw() function:

        local fs = 14

    will not change current text settings.
    Does that mean that now none of the style parameters can be changed ouside the draw()? Or does this only apply to some parameters, and in that case, which ones?

  • Posts: 688

    @Jvm38 - when you say outside of draw do you mean in the global scope or in a function that's called from setup?

    Does it work if the code is in a function that's ultimately called from within draw() ?

  • IgnatzIgnatz Mod
    Posts: 5,396

    @Jmv38 - quickest way to find out is to test it!

  • dave1707dave1707 Mod
    edited March 2015 Posts: 8,400

    @Ignatz @Jmv38 If either of you were on the Beta version of Codea and you loaded the real Codea 2.3 version, did you reload it from the App Store or from the purchased area (cloud) of the App Store. I don't want to wipe out all of my projects and have to reload them. I'm not sure which is the correct way to update from the beta version.

    EDIT: Nevermind. After looking at the App Store more closely, there wasn't any other choice but to download from the purchased area (cloud). Codea loaded with no problem and all the projects were still there.

  • Jmv38Jmv38 Mod
    Posts: 3,295

    @techDojo i mean from a function inside setup(), not global scope.

  • dave1707dave1707 Mod
    Posts: 8,400

    @Jmv38 I tried your code above and what I got is: It works inside setup(), and in a function called from setup(). If it's outside of any function (global to the code), then it doesn't work. There are other things like this that don't work and Simeon is looking into it.

  • edited March 2015 Posts: 1,976

    I ran into a pretty crazy bug that I have no idea how to recreate. I was in the editor and somehow the keyboard got closed, leaving the extra buttons that Codea adds at the bottom of the screen, as if I was using a Bluetooth keyboard.

    Screenshot of the editor:

    Image 1

    I pressed the run button, and when the project started the extra keyboard buttons stayed at the bottom of the screen.

    Screenshot of the extra buttons in my project:

    Image 2

    I pressed them a bunch, and that made my project freeze.

    I selected the textbox in the output window, which made the extra buttons disappear and the keyboard show up. When I went back to my project, I had found that all the buttons I had been pressing had changed the code of the project, which had caused my project to freeze because of a syntax error.

    Screenshot of the editor right after I closed my project:

    Image 3

  • dave1707dave1707 Mod
    Posts: 8,400

    @SkyTheCoder I've seen similar. I also get autocomplete words at the bottom of the screen that end up in my code when I exit a running program.

  • SimeonSimeon Admin Mod
    Posts: 5,364

    @SkyTheCoder thanks for that report. @dave1707 I will add that issue to the tracker, I find the autocomplete getting stuck to be very annoying.

  • toffertoffer Mod
    Posts: 151

    I experience some strange behavior. It's the second time Codea refuse to start, the first one, I've been able to re-install from Tesflight, but since Teslflight provision is expired and all app like iExplorer can't access document's app from ios 8.3, I can't make a backup and remove/install from the AppStore. Is there any workarround to force install from the AppStore without to have to delete the app before ?

  • Posts: 688

    You should be able to just run the app store app on your ipad and then find Codea in your purchase list and press the download icon.

  • toffertoffer Mod
    Posts: 151

    @TechDojo - Unfortunatly, nop there is only an "open" button, I have to delete Codea before...

  • SimeonSimeon Admin Mod
    Posts: 5,364

    @toffer do you have the yellow dot on the Codea icon? (Indicating it is beta.)

    When you see the "open" button on the App Store is that on the Codea app's page, or in your "purchased" list?

  • toffertoffer Mod
    Posts: 151

    @Simeon - nop I no longer have the yellow dot since the last problem, but I'm sure I've used only the beta builds, I've never re-installed from AppStore, but maybe the os have done some changes in my back :s ? The open button is on both AppStore pages

  • edited April 2015 Posts: 688

    The one thing you can do is copy each project and then send it via email to yourself, if you then open the email on your ipad you should be able to copy each project back in using a long press on the + button.

    Only just found out about iExplorer (3.7) not working with iOS 8.3 - that sucks :(

  • SimeonSimeon Admin Mod
    Posts: 5,364

    @toffer there will be a new beta soon, that should install over the top and preserve your projects.

  • toffertoffer Mod
    Posts: 151

    @Simeon - Oh yes ! please master, bring me back my precious... :)

  • Posts: 688

    @Simeon - I know this has been discussed to death before, but...
    Given that we can sync text files to dropbox, is there any reason that projects can't be synced to dropbox as well? It's not quite code sharing (as per Apple's rules) but it would allow us to get .codea folders on and off easily - even if they're zipped up (which is almost, pretty much, kinda like what the export function does).

    Ps. Looking forward to the 2.4 beta as well :)

  • dave1707dave1707 Mod
    Posts: 8,400

    @Simeon Do you have any plans to create a function that returns a table of project names and a function that will create new projects. Those will allow an easy way to create backup and restore programs. Or are you going to create something to allow backup and restore of projects.

  • SimeonSimeon Admin Mod
    edited April 2015 Posts: 5,364

    @toffer 2.3.1 beta is waiting for Apple's beta review

    @TechDojo next beta will be 2.3.1 (mostly addressing bugs and the recently discovered iOS 8.3 status bar issue). 2.4 is quite a large update. I think the actual policy refers to any code "downloaded or installed from the Internet". Unfortunately Dropbox (and even iCloud sync) would fit under that policy.

    @dave1707 let's look at the possible APIs here. I'm not against a project creation API.

    Adding some global functions:

    listProjects() -- return a table of tables, containing sections and projects, e.g. returns { "documents" = { "projectA", "projectB" }, "examples" = { "project1", "project2" }, } 
    listProjects("examples") -- return table of just the projects in the "examples" collection
    newProject("ProjectName") -- returns true if project was created (you can only create new projects in the documents collection?)

    Refactoring the existing readProjectTab et. al. API into its own section:

    project (type) String
    project.buffers: Array of "buffer" types
    project.dependencies: Array of "project" types Dictionary
    buffer (type)
    buffer.contents: String String
    project.collections() -- get list of available collection names
    project.list(collectionName) -- get list of project names in collection
    project.create(projectName[, collectionName]) -- returns empty project or nil, project)
    -- Reading, modifying and saving a tab
    local p ="HelloWorld")
    local b = p:bufferNamed("Main")
    b.contents = "some lua code", p)


  • Jmv38Jmv38 Mod
    Posts: 3,295

    looks great.
    Just make sure we can manage the tabs order too. That's a recurrent problem.

  • dave1707dave1707 Mod
    Posts: 8,400

    @Simeon Looks good to me. I'm looking for an easy way to reload all of my projects. If I look at Usage, Manage Storage for Codea from the iPad settings, I show 126 MB of Documents & Data. It needs to be cleaned out, but the only way to delete the Data area is to delete Codea and reload it. I don't want to manually reload 400+ projects. I did that once when I deleted Codea by mistake and it took hours to reload all of my projects one by one. A program will be able to reload everything in a few seconds.

  • Posts: 2,043

    @Simeon, I like the new project API as opposed to adding newProject et. al. Seems nicer to have them all grouped together.

Sign In or Register to comment.