FBA The Creator
http://www.fbacreator.com/fbaforum/

FBA 0.2.0.135 long brackets comments are executed
http://www.fbacreator.com/fbaforum/viewtopic.php?f=2&t=194
Page 1 of 1

Author:  Birger [ Mon Jun 08, 2009 9:16 pm ]
Post subject:  FBA 0.2.0.135 long brackets comments are executed

--[[
The long brackets comments are very helpfull to temporaly exclude code from execution.
a single space character between -- [[ or -- ]] switches the comment block off
-- ]]
BE AWARE: this line is a comment in the Editor but would be executed in FBA (or LUA)
--]]

Code:
function onmainloop()
        clear(0,0,0)
       
        -- draw counter
        drawgfxtext(font, 10, 10, count)
       
--[[       
       
        -- get text width and draw a number aligned to right
        width = gfxtextwidth(font, 9)       
        drawgfxtext(font, screenwidth() - width , 200, 9)
-- ]]
        -- get text width and draw a number aligned to center
        width = gfxtextwidth(font, 69)       
        drawgfxtext(font, screenwidth()/2 - width/2 , 100, 69)
--]]       
        count = count + 1
       
end

function onstylusdown(x,y)
        quit()
end


Insert the "--", "[[" and "]]" into the tutorial 09b gfx.font code as shown above. Then run the app.
:? :?:

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Limited
https://www.phpbb.com/