Codea 3.8 (375)

@sim Loaded latest version of Codea 3.8 (372) and it crashes without even getting to the project screen. Sent a crash report. Powered iPad off/on but that didn’t help.

Sorry! Apple approves betas while I am asleep and does not allow one to replace a beta that is in-review with a fixed one. So I was aware of this problem but had to wait until they approved the first beta before I could submit the fixed one. Should be fixed now!

1 Like

ok came here to say same thing, will wait for next update

the latest version373 will not allow to type into the editor, will crash shortly after trying to place a cursor

i can run a project and the new console looks nice, i wish we could drag and extend its width

@sim @John @dave1707 - loaded the new version, ran a few demos in V3 version. Seemed slicker graphically than some of the recent precursors. Changing orientations was also notably quicker. On the demos I tried in V3 no crashes.

V4 - again slicker, interesting mods to the gui. Ran a couple of demos, no crash. Then a more involved one crashed. Posted a crash report.

@sim @john @dave1707 - just confirmed @skar ’s post on problem with editing. Also, after failing to edit I tapped on the second tab in my template and Codea crashed. Posted a crash report.

Not sure if it was trying to switch tabs or hitting the OS control at the centre top of the screen that caused the crash. Will check it out again.

Edit: Crashed 38 by loading a template, which contains 3 tabs. Changing tabs worked if done straight away but if you then tap to edit and then tap to change tabs Codea crashed.

Signing off now - need some sleep.

Thanks @skar! Looking into it

Sorry everyone, it was a very stupid bug down to a last-minute late-night crash fix which I did just before the build.

Generating a new build now which restores editing behaviour

@sim The editor now works.

@sim Not sure what’s happening here. There’s a big gap between “start” and the string str and “next print line”. Also if you change the for loop to 7990, the string no longer prints.

I ran into this when I ran my pi program to check timing. The last version would let me print a string of 100,000+ digits.

function setup()
    str=""
    for z=1,7989 do     -- 7990 prints blank
        str=str.."a"
    end
    str=str.."end"
    print(#str)
    print("start\n"..str)
    print("next print line")
end
1 Like

Changing to 7990 prints for me, but you are absolutely right that something is off about the sizing. Thank you for catching this! Will look into it

@sim - can you explain what the new icon in the error reporting window (far right one) is for - does it offer paging? Error reports still seem to scroll and are formatted differently. I like the clear output option - this looks like it’s for your own printed messages.

Ah that will be used to open the output pane in a new window (not hooked up yet)

@sim Something else I ran into with the new print area. Tapping a line doesn’t move the text to pasteboard.text. When I run the below code on a previous version, ‘qwert’ shows in the print area. If I tap ‘qwert’, it prints ‘qwert’ from pasteboard.text. With the new version, nothing happens. I have programs that use the print area and pasteboard.text.

function setup()
    pasteboard.text=""
    print("qwert")   
end

function draw()
    background(0)
    if pasteboard.text~="" then
        print(pasteboard.text)
        pasteboard.text=""
    end
end

You should be able to long press and select text in that area, but the tap feature was quite good too, will see if we can bring it back.

@sim The long press doesn’t work to replace the tap. If there’s no spaces in what’s printed on each line, the long press will copy the whole print area. If there’s spaces in what’s printed, then the long press will copy from the nearest space above and below the long press area.

Run the below code and long press/copy on the word “line” of line 6. It prints “5line”. Change the code and remove the space after “line” in the for loop. Again, long press on “line6” and it prints every entry.

function setup()
    pasteboard.text=""
    for z=1,10 do
        print("line "..z)
    end    
end

function draw()
    background(0)
    if pasteboard.text~="" then
        print(pasteboard.text)
        pasteboard.text=""
    end
end

using math.tointeger() doesn’t work with a float like it should, it returns nil and only works if you pass it an integer

math.tointeger(0.9) -- nil

math.tointeger(1) -- 1

@skar - I didn’t know there was a math.tointeger() function. I tend to use math floor() or something like

Int = real//1

I think there was a change from Lua 5.2 to. 5.3 when Lua incorporated true integers, before that I think all numbers were real.

i have my own

-- works with negative numbers
function Util:round(num, numDecimalPlaces)
  local mult = 10^(numDecimalPlaces or 0)
  local res
  if num > 0 then 
    res = math.floor(num * mult + 0.5) / mult
    if mult == 1 then res = math.floor(res) end
  else
    res = math.ceil(num * mult - 0.5) / mult
    if mult == 1 then res = math.ceil(res) end
  end
  return res
end

Love the new counters for multiple identical outputs!