V3.4.3 (298) (299) (300)

All - just a point of clarification, the freezing point I described previously, was after the initial Codea. There were two steps - the first I described, the second was when the collection headings were added before the projects were added to the projects page. I’ve attached two images that may make it clearer.

Note: this was before I started having problems with Dropbox. Cleaning Dropbox up, removing many unused files etc and the new betas made the loading time much better - but still a bit slow. The delay now seems to be in the initial Codea loading screen.

P.s. anyone know how to shrink images instead of cropping on an iPad photo app.?

@dave1707 I’ve made it possible to open the assets from the editor. Select Do → Assets to show them in the side bar

@skar I totally agree on the need for folders. This is something we’re supporting from the start in Codea 4. I looked at the effort of including it in Codea 3.x and it’s a bit big to put in as a new feature right now. I’ll keep thinking about it

@Simeon The new Assets shows all the assets, but there’s no way to select something from it and paste it in the editor. For instance, if you place the cursor between the () of sprite(), it brings up a list. You can select something from that list and it’s placed between the (). Need a way to select something from the list and paste it.

@dave1707 good point. I could make selecting something in the assetlist automatically insert its corresponding asset key in the editor text? Or maybe have an option on long press or a button to insert asset key? Need to think about the options

@Simeon Version 296. I running into a really strange problem. I have a 17 line program with 3 blank lines at the end. I can delete lines 15 and 16, but when I try to delete line 17, which is now line 15, Codea crashes. When I get back into the project, lines 15, 16, and 17 are there. If I tap line 17 at the second space it’s OK, but if I tap line 17 at the first space, Codea crashes. There were also times when I would go back into Codea, but instead of going to the project list, it was taking me right into the editor for that program. I’m not sure if there are unusual character in that line or what’s going on. I sent a crash report when I tapped line 17 at the first space.

It isn’t happening with other projects.

Here’s the code. Not sure if it will happen for you. Try to copy all the blank lines.


viewer.mode=FULLSCREEN

function setup()
    textMode(CORNER)
    fill(255)
    fontSize(25)
    str="abcdefghijklmnopqrstuvwxyz 1234567890"
end

function draw()
    background()
    text(string.sub(str,1,ElapsedTime//1),100,HEIGHT/2)
end


I tried to copy the above code, but I’m not getting the problem when I paste it into a new project.

@Simeon The above problem also happens with version 295. I’ll try other previous versions.

It also happened with version 294.

If you want, I should be able to do a hex dump of the project and see what’s at the end.

@dave1707 that’s strange, perhaps you could share the zipped Codea project? I pasted your code and couldn’t recreate the issue. Maybe the forums is converting an invisible character somewhere

@dave1707 I think i’ve found the bug from the crash log you submitted. Thank you for sending that through. Next build will have a fix

@UberGoober have you run into any issues in the latest builds with losing code like you did before?

@Simeon Tried the program that was causing the crashes and I couldn’t get Codea to crash. Looks like it’s fixed.

@dave1707 - that sounds like a weird issue. I note that your post is properly tilded but not formatted in the forum correctly - is it related ? Were you using an external keyboard ?

@Simeon - just out of interest - what caused the crash ?

@Bri_G an out-of-bounds exception when parsing a string to track how many spaces are in it for handling whether to show the “jump to next symbol” key or the regular “tab” key

    while([[NSCharacterSet whitespaceCharacterSet] characterIsMember:[line.line characterAtIndex:iterIndex]]) {
        iterIndex++;
    }

The fix

    while(iterIndex < line.line.length && [[NSCharacterSet whitespaceCharacterSet] characterIsMember:[line.line characterAtIndex:iterIndex]]) {
        iterIndex++;
    }

@Bri_G Not sure why it’s not formatted right. All I know is that I was having a lot of trouble with that project. If I copied the code without including the 3 blank lines at the end and pasted it into a new project, I didn’t have any trouble with it.

@Simeon I haven’t yet noticed any code losses for sure—I thought I did once but since I am now using Working Copy on my current project, and I couldn’t confirm that code had changed, I can’t swear to it.

I also want to say thanks for going above and beyond on the asset displayer from the project menu! I thought it was just gonna display that project’s assets, it’s even better that it shows them all. @dave1707’s idea is way rad too, but even just this is a huge new convenience.

@Simeon The new asset routine works great. Easy to copy/paste into the code.

I have an extremely odd bug which I can’t imagine being anything other than a flaw in the lua interpreter. I am trying to write simple code to isolate the problem, but so far I can’t do it; it only happens in the far more complex code that I am running.

The behavior is basically that I create a class that takes up to three initialization parameters, and then I call it a series of times, almost always with three parameters, but once with two. On the call with only two parameters, unless I explicitly place “nil” in the third parameter, it gets something else (I think the third value somehow “left over” from the prior call to the constructor).

Unfortunately, the code is complex (it’s an expression parser/compiler, that displays inputs and outputs on the screen, computing the results based on the compiled expressions, and the bug happens inside the compiler, a simple shunt-yard implementation). But the behavior is very simple: call the constructor with two arguments, and in this one situation it gets three instead.

I hate reporting bugs like this, because in my 50 years of programming experience, it’s always turned out to be something “on my end”, but in this case, I just can’t think of anything I’d be doing that would cause this behavior.

For now, I have a few easy workarounds (one of which actually structures my code better), so there’s no hurry, but if you want to look at it, I’ll have to send you a zipped copy of the entire project, with comments as to where to look for the issue.

@blacatena - Codea used to have a useful parameter filter (…) Which allowed you to vary the parameters passed. I think it was removed, possibly with a Lia upgrade

An alternative would be to set a parameter block in a table and pass that changing only the variables you need and building code in the receiver function to filter that out.

@Bri_G, thanks, but as I said, I found a way around the problem that actually structures my code better. I’m reporting it more because it’s a dangerous bug to have in existence (although it’s not urgent to fix; I’m sure it’s an edge case on the edge of an edge case).

[Separately, I have my own special classes that I usually use to allow me to do what you describe, but in this case, I was doing something simple that I built with pure Codea toolkit elements. When I finish that project (building out those classes) I intend to post it as a general framework for others to use, if they wish.]

@blacatena Try this for variable parameters.

function setup()
    parms(1)
    parms(2,3)
    parms(3,4,5)
    
end

function parms(...)
    arg={...}
    print("======")
    for a,b in pairs(arg) do
        print(b)        
    end
end

@blacatena I would be interested to take a look at the issue. It could definitely be a bug on our end