View Single Post
Old 08-11-2018, 04:00 AM   #267
tompad
Human being with feelings
 
Join Date: Jan 2010
Location: Fjugesta, Sweden
Posts: 813
Default

Quote:
Originally Posted by Lokasenna View Post

- To save yourself some time and typing, you could make a function for setting the frame's text.

Code:
function set_frm_details()
    GUI.Val("frm_details", items[1][2]
end

function set_initial_state()
    -- If you don't specify any keys, Lua will just start the 
    -- table at 1 for you
    GUI.Val("lst_tasks", {true})
end

set_initial_state()
set_frm_details()
GUI.Init()
GUI.Main()
Works like a charm!! Thanks
Quote:
Spaghetti code is something everyone does, especially when learning - it can take a lot of practice to stop doing it. If you're interested, I highly recommend these books:

Refactoring - Martin Fowler - Even if you just read the example where he tidies up a video store's software.

Clean Code - Robert C. Martin

Or just Google "refactoring" and "clean code", find some sites that actually show examples rather than telling you "don't do this", watch a video or two, etc.
Will order books, starting with Refactoring.

Just Googled and have already put away some bad smell :-)

Thanks for the recommendation!
__________________
ToDoList Obliques MusicMath Donation Some of mine and my friends music projects on Spotify
tompad is offline   Reply With Quote