Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Codea 1.5 bugs

dave1707dave1707 Mod
edited February 2013 in Bugs Posts: 9,459

I'm not able to copy the contents of the output pane. In the previous version, I was able to tap in the output pane, do a select all, copy the contents, and paste it whereever I wanted. Or is there a different way to get at the contents of the output pane.

Comments

  • SimeonSimeon Admin Mod
    Posts: 5,708

    .@dave1707 the output pane contents can be copied — but only one "cell" at a time. If you tap on a printout you will see it darken, that means it has been copied to the pasteboard. Unfortunately as we were rewriting Codea we had to lose the copy all feature due to the new design of the output pane.

    Now that you have saveProjectTab() functionality, a lot of the select-all copy behaviour should be able to be replaced with that. You can write directly into projects instead.

  • dave1707dave1707 Mod
    Posts: 9,459

    .@Simeon Thanks for the quick response about the output pane. I ran into another bug, but I wasn't able to re-create it. I loaded a program, but it wouldn't execute, and I couldn't exit the editor back to Codea. The program wasn't locked up because I could scroll the program up or down in the editor. I tried several times to run the program or exit back to Codea, but nothing happened. I finally exited Codea and re-loaded the program and everything was OK.

  • Jmv38Jmv38 Mod
    Posts: 3,297

    @Dave1707 i've noticed this bug when i update codea without having killed it in the process bar before. it happens only once. Probably a side effect because the old version is still running in memory, but the old code has been suppressed on the disk?

  • Posts: 78

    I found two bugs
    First, I use the parameter.integer that ranges from -2 to 7. I cannot change the parameter to -2. It can set -1 as the lowest number.
    Second, I try the sample project camera. When I used the front camera, It shows in opposite direction. For example, If my pencil is on my left side, the camera will show the pencil on the right side.
    However, Codea 1.5 is fantastic. I likes it very much. Thank you for your hard works.

  • SimeonSimeon Admin Mod
    Posts: 5,708

    Thanks @sanit, first one sounds like a rounding issue. The second is simply the way the front camera stream is designed to come through — for some reason Apple mirrors the front camera, I'll see what our options are regarding this.

  • dave1707dave1707 Mod
    edited February 2013 Posts: 9,459

    ..@Simeon @Jmv38 I'm able to re-create the error where I load a program but it won't execute or allow me to exit the editor back to Codea. The only way out is to kill Codea. I can recreate the error by loading a program from the examples line while at the same time loading a program from the projects line. Touch both programs at the same time. It will show the loading spinner on both programs, but only one will load. The program may or may not run, but I can't exit it without killing Codea.

  • SimeonSimeon Admin Mod
    Posts: 5,708

    .@dave1707 thank you for the steps on how to recreate. I'll try to have this one fixed in 1.5.1.

  • I, too, tend to debug with frequent use of the print function, and valued being able to cut and paste the entire output into something else to read it through or search for key words. The following code is designed to temporarily override the print function, so that output is echoed to a tab in the current project.

    Turn it on with debugOn(), turn it off with debugOff(). These set and unset the print function, but also encapsulate the output in comments (so that Codea doesn't try to interpret its own output). This isn't guaranteed to be clean - if debugOff() isn't called, then the comment may be left hanging, but it should allow repeated uninterrupted runs of code.

    Cheers,
    Richard

    -- DebugPrint
    
    origPrint = print
    
    function debugPrint(...)
        local printResult = readProjectTab("DebugOut")
        if printResult == nil then printResult = "--[[\n" end
        for i,v in ipairs(arg) do
            printResult = printResult .. tostring(v) .. "\t"
          end
          printResult = printResult .. "\n"
        saveProjectTab("DebugOut",printResult)
        origPrint(unpack (arg))
    end
    
    function debugOn()
        local printResult = readProjectTab("DebugOut")
        if printResult == nil then printResult = "" end
        printResult = printResult.."--[[\n"
        saveProjectTab("DebugOut",printResult)
        print = debugPrint
    end
    
    function debugOff()
        local printResult = readProjectTab("DebugOut")
        if printResult == nil then printResult = "" end
        printResult = printResult.."]]--\n"
        saveProjectTab("DebugOut",printResult)
        print = origPrint
    end
    
    -- Use this function to perform your initial setup
    function setup()
        --saveProjectTab("DebugOut","debugging log")
        debugOn()
        print("Hello World!")
        for i=1,10 do
            print("test",i)
        end
        debugOff()
        print("this should only appear in output")
        debugOn()
        print("this should appear in both output and the log")
        debugOff()
        
    end
    
    -- This function gets called once every frame
    function draw()
        -- This sets a dark background color 
        background(40, 40, 50)
    
        -- This sets the line thickness
        strokeWidth(5)
    
        -- Do your drawing here
        
    end
    
    
    
  • dave1707dave1707 Mod
    Posts: 9,459

    ..@RichardMN The way I got around the print going into different cells of the output window was to use table.insert where I would have used a print statement. Since there's only one print statement, everything ends up in the same cell and can be copied all at once. Here is a small example.


    tab={} -- table used for print a=100 str1="qwerty" b=200 str2="asdfg" function setup()     table.insert(tab,a) -- use table.insert instead of a print statement     table.insert(tab,str1)     table.insert(tab,b)     table.insert(tab,str2)     print(table.concat(tab,"\n")) -- prints all entries with a new line in between each entry. end
Sign In or Register to comment.