Time passed:

What will you be learning?

We're getting ready for Summer School 2! Our experienced development team are working hard to create the type of content that would get them signing up to this course. Some of your instructors would like to share some tips with you to give you a taster.

In Depth Unicode - A tip from Fraser Gordon

Sometimes you need to handle letters such as the Turkish İ. This has a dot over it in uppercase and not in lowercase, unlike the English i.
The LiveCode "toUpper" and "toLower" functions are language-neutral and designed for parsing. This means they sometimes do the wrong thing for human-readable text - and they won't get the Turkish i you were looking for

Here is how you can define a function that will handle this in LiveCode

  function uppercase pText, pIsTurkish
  local tOutput
  repeat for each codepoint c in pText
  local tUpper
  if pIsTurkish is true and c is "i" then
   -- Dotted i
   put "İ" into tUpper
  else if pIsTurkish is true and c is "ı" then
   -- Dotless i
   put "I" into tUpper
   put codepointProperty(c, "Uppercase Mapping") into tUpper
  end if
   put tUpper after tOutput
  end repeat
   return tOutput
end uppercase

Fraser Gordon

Fraser is a LiveCode Software engineer and has played a crucial part in delivering the following projects. Have a question about UniCode? Fraser is your guy.

  • Unicode refactoring
  • Engine restructuring
  • Right to left language support
  • Unicode ICU library integration
  • Rasberry PI port
Blog URL:

Learn more about unicode and more by signing up to Summer School 2

Unicode Best Practice - A tip from Ali Lloyd

You may know that processing Unicode is expensive in terms of engine time and resources. If you have a string with unicode in it and a bunch of native characters at the end such as "Snežana Rodić 2385762738", speed up access to the native characters by using the codepoint chunk and a negative index:

So if you wanted to get all the ID numbers from this list

Snežana Rodić 2385762738
Snežana Rodić 9487421094
Snežana Rodić 7652496092
Snežana Rodić 7653432890

without the performance hit of resolving the unicode names you could use:

local tIdList
repeat for each line tLine in tUserData
put codeunit -10 to -1 of tLine & return after  tIdList end repeat

Ali Lloyd

Ali is a LiveCode Software developer and has worked extensively on the restructuing of the LiveCode engine following the KickStarter campaign. Ali is also very heavily involved in the LiveCode 7 project.

  • Engine restructure
  • Unicode support
  • Unicode performance optimisation
  • Release note generation
Blog URL:

Learn more about Unicode Best Practice and more by signing up to Summer School 2

App Structure - A tip from Michael McCreary

Problem: I have a good grasp on the basics of programming with LiveCode but don't know how to structure larger projects. I often find that as soon as I'm doing something that is non-trivial, my code quickly becomes confusing and hard to maintain.

Solution: A good starting point is to utilise the LiveCode message path. Try to split up your app into layers, and then use each level of the message path to implement one of those layers. A good example of this is separating out UI code from the code that does the processing. Consider a simple login interface. Maybe you have various custom controls - buttons with hover states, password fields that obfuscate user entry, auto-complete username fields. Keep the code for these operations at the control/group level. The next layer would be the extraction of data from the UI - pulling out the user name and password along with feeding back the result of the login process. Have the code for this at the group/card level. Finally, the actual login process. Again, keep this a separate process, possibly at the card/stack level.

Michael McCreary

Michael is one of our most senior LiveCode developers and has been involved in delivering some of the features that make LiveCode what it is today. Michael's projects include:

  • Rewriting of the LiveCode graphics layer
  • Implementing of graphics effects
  • Optimising the LiveCode engine
  • Proxy support
  • Secure sockets
  • Implementing a number of iOS / Android features
  • Writing of the build system.
Blog URL:

Learn more about App structure and more by signing up to Summer School 2

Resolution Independance - A tip from Ben Beaumont

The resolution independence features allow LiveCode developers to create apps at a specific size and instruct LiveCode on how to display that on a target device. This allows developers to quickly develop apps by removing the need to write code to resize all the UI for a particular device.
LiveCode is cleverly working behind the scenes to scale everything in your application and choose the best assets for the target system screen size and pixel density. For best results in terms of both performance and appearance we recommend following a few rules.

For example, when using images, you can provide the same image at a variety of sizes and LiveCode will choose the best one to use for the target device. If running on a mobile with a small screen, LiveCode will select a smaller asset increasing performance. If running on a device high resolution screen, LiveCode will select a larger asset making your app look beautiful and crisp.

Ben Beaumont

Ben is the LiveCode Product Manager and he plans and designs LiveCode development with the technical team. Ben is involved in every step of delivering LiveCode and has a variety of tasks including:

  • Writing requirements docs
  • Prototyping ideas
  • Visual design of new product features
  • Planning projects with the tech team
  • Planning product direction
  • Supporting the marketing team
  • Supporting the web team
  • Developing strategies to improve the quality and robustness of the product.
  • Planning the workload of the development team to ensure we get the best out of our talented dev team.
Blog URL:

Learn more about Resolution Independance and more by signing up to Summer School 2

Integrating LiveCode and JavaScript using the new WebKit browser - A tip from Ian Macphail

If you want to handle events - such as a button click - within an embedded web browser you can make a LiveCode handler callable from the JavaScript environment of that browser:

revBrowserAddJavaScriptHandler sBrowserID, "browserButtonClick" This will make the "browserButtonClick" handler accessible to JS scripts in the browser.

Let's say your html defines an input button with the following code:

<input id="clickMe" type="button" value="clickme" onclick="liveCode.browserButtonClick("Hello, world!");" />

Any time you click the button, the JavaScript code will be executed - in this case calling our LiveCode handler with one argument - the text string "Hello, world!"

You can then catch the button click in LiveCode with the handler:

on browserButtonClick pBrowser, pArg
   answer "Button click on browser" && pBrowser && "with message:" && pArg end browserButtonClick

Ian Macphail

Ian is a LiveCode Senior Developer and was very heavily involved in delivering the resolution independence project. Ian's projects include:

  • Resolution independence
  • Stack scaling
  • Fullscreen scale mode
  • Image caching
  • Webkit browser
Blog URL:

Learn more about Webkit Browser and more by signing up to Summer School 2

Keep Learning

For more in depth learning on these topics and many many more sign up for our New Summer School now!

Packed with new topics and delivered by our expert development team.

Join our live, hands on, online Summer School and learn how to use and get the best from many new features in LiveCode. An intermediate to advanced Live Online Summer School that will include topics such as

  • App structure – Managing assets, writing libraries (on/function/getprop/setprop) and using behaviors to create code that lasts
  • Using Version Control – best practice on structuring and managing your individual (or team) LiveCode project using lcVCS and GitHub
  • Error handling & testing – best practice on building more reliable apps
  • Optimizing graphic performance – principles and tips for faster display performance
  • Optimizing code performance – things to look out for in speeding up your code with examples
  • Using resolution independence effectively on all platforms – create modern looking apps with ease
  • Scripting Geometry for multiple platforms – get to grips with creating and managing complex layouts on multiple devices
  • Get the most out of Arrays – a complete primer on nested arrays. Process large or complex data sets efficiently
  • Unicode 101 – everything you need to know to support international characters with ease - including the new LiveCode 7.0 feature set
  • How to get the best from DataGrid – an in depth look at how to get the most out of the data grid
  • Integrating LiveCode and JavaScript using the new WebKit browser – integrate web programming into your apps
  • Using LiveCode server – use the language you already know on you back end server

View The Full Schedule