25 April 2014
From the Forum — Issue #17
Welcome to the latest installment of From the Forum. In this series, guest blogger Alex Jackson highlights outstanding threads from the Corona Forum. The goal is to bring attention to the most captivating, interesting, and thought-provoking discussions taking place in our very own backyard.
Please visit the forum to join these conversations or start your own!
1. Lua string searching
Generated Lua strings, whether ad-hoc tables or JSON data, are a great way to index information for easy recall. A more difficult trick, however, is searching through these strings for specific data or inserting data into the strings themselves. The string.gsub() function is a good tool, but what if you want to identify variables by their location in the string?
User guruk has come up with an interesting function that programmatically searches through a Lua string and substitutes pre-determined data for the arguments that a user specifies. string.gsub() does the heavy lifting, but the logic and cleanliness comes from this function.
Ramble over to the original thread to grab this nice little function for yourself:
2. Free push notification service!
Develephant is the developer that keeps on giving. Last time, he hooked us up with an early peek at his Coronium Cloud Platform, written entirely in Lua and scalable to the ceiling. Now, he offers us the amazing Pushbots Corona SDK Module.
What is Pushbots? I’ll let their website do the talking:
“PushBots provides reliable delivery, scalability, and real-time analytics along with flexible APIs that make custom integration a breeze.”
Push notifications is big business these days so it’s always nice to see a free option, however temporary that offer may be. Run over to the original thread to learn more about this module, and don’t forget to thank develephant for all of his amazing work!
3. Handy code snippets
I realize the main intent of “From the Forum” is to alert our development community to new, exciting advances in Corona that are discussed in our very own forum. However, I’m going to veer off course and highlight a “pinned” post which I believe everyone should be aware of: the Handy Snippets thread.
This thread contains a lot of accumulated wisdom from around the Corona-verse, and while other threads may act as a repository of interesting and useful information, few are as visible or frequented by stalwart Corona developers and Corona engineers. This means that the tidbits within are often vetted by management and can be considered to work in the manner intended.
Fly over to the original post and see why the “Handy Snippets” title isn’t just a clever name!
Alex Jackson is an indie developer and the founder of Panc Software, specializing in retro-style gaming. He has created several mobile applications, enjoys long walks on the beach, pixel art, and reading the Corona forums. Contact him by email or follow him on Twitter: @pancsoftware. Check out his new game Crosstown Smash on iOS, Android, and Amazon devices!