Category: <span>Radio Tips</span>

Phil wrote, “No arrays in UserTalk?”

We have arrays. We call them lists. Here’s a list of integers:

{1, 2, 3, 4, 5}

You can add lists together if you want:

{1, 2, 3} + {4, 5} == {1, 2, 3, 4, 5}

You can reference them by index:

local (aList = {1, 2, 3});<br /> aList[2] = 4;

After running the above, aList will contain {1, 4, 3}.

You can also mix types:

{1, "two", 0x03}

And you can nest lists:

nestedList = {1, 2, {3.0, 3.5}, 4}

In the above example, nestedList[2][1] has a value of 3.0.

Jake's Radio 'Blog Radio Tips

Comments closed

Gartk Kidd: “I used to be phytoplankton. Now I’m either big phytoplankton, or krill. Either way, I’m whale-food. :)”

Garth: Brent has written up a bunch of tips for Frontier developers, most of which apply to Radio as well. This one in particular may be of use to you.

Jake's Radio 'Blog Radio Tips

Comments closed

David Davies asked me earlier today, how to get the path to a local file, given the URL for its upstreamed and rendered version. Here’s a code-snippet that does it:

That will work fine for an image file, but if you need the path to a rendered file. If you need to convert an .html url back to the correct filepath. Add this extra step:

radio.file.locateFileIgnoringExtension (f, @f);

Jake's Radio 'Blog Radio Tips

Comments closed