revUp - Updates and news for the Revolution community
Issue 100 | Nov 18th 2010 Contact the Editor | How to Contribute

4.5.1 Features
Some useful new features in 4.5.1, as well as overall quality enhancement

by Mark Waddingham

Version 4.5.1 of LiveCode is more than just a bug fix. We've spent a considerable amount of time and effort on polishing up the engine and IDE for you in this release, and added a handful of new features which while they are not big headline features, will make a difference to significant numbers of you, the users. As well as addressing a slew of bugs and issues which you told us mattered to you, we've added the following enhancements to this release.

XML Namespace support
By default, revXML will process XML Namespace related tags and attributes in a way that is inaccessible to revXML. This can cause problems when a script needs to process the namespaces itself. To resolve this issue two additional functions mimicking the behavior of revCreateXMLTree and revCreateXMLTreeFromFile have been added to revXML. These functions are:

revCreateXMLTreeWithNamespaces
revCreateXMLTreeFromFileWithNamespaces

The difference between these and the originals is that these two functions ignore namespace tags
and attributes, and instead return them as part of the tree without doing any processing.
For example, consider the following XML tree:

<db> 
<bb:record> 
<bb:firstname>Bugs</bb:firstname> 
<bb:lastname>Bunny</bb:lastname> 
<zz:zip>10101</zz:zip> 
</bb:record> 
<xx:record> 
<xx:firstname>Bugs</xx:firstname> 
<xx:lastname>Bunny</xx:lastname> 
<xx:zip>10101</xx:zip> 
</xx:record> 
</db> 

Will get interpreted as follows:

revCreateXMLTree revCreateXMLTreeWithNamespaces
db 
record[1] 
record[1]/firstname 
record[1]/lastname 
record[1]/zip 
record[2] 
record[2]/firstname 
record[2]/lastname 
record[2]/zip 
db 
bb:record[1] 
bb:record[1]/bb:firstname 
bb:record[1]/bb:lastname 
bb:record[1]/zz:zip 
xx:record[2] 
xx:record[2]/xx:firstname 
xx:record[2]/xx:lastname 
xx:record[2]/xx:zip 

The latter form is more appropriate in the case that an application needs the namespace information to perform correctly.

Runtime execution stack configuration
Have you ever suffered from runaway recursion? In order to be able to more reliably control the maximum level of recursion, a new global property stackLimit has been introduced. This property allows a script to set (in bytes) the maximum size of the (runtime) stack the engine uses for recursive computation. A change in the setting will only take effect when all currently executing handlers complete, and at this time the stack size limit will be reconfigured to the given limit, or the nearest amount to it depending on available memory. The stackLimit currently in effect can be fetched using the effective stackLimit. The recursionLimit property is now bounded by the stackLimit – attempts to set the recursionLimit greater than the stackLimit will see it downwardly adjusted to the maximum current size allowed.

These changes to the recursionLimit property and the new stackLimit property are only implemented on Windows at present.

This feature at the moment is described as "experimental". What does this mean? Well, we use this categorisation for features that we think will be useful, and users have asked us to try, but we're not absolutely certain yet that there will not be some unexpected consequences from implementation. It may not be complete, or may fail in some circumstances that you would expect it to work. There may be situations we haven't thought of where using it could cause problems. Please do not be afraid to try these features out as we need feedback to develop them further. If the feature passes the "Real World Use" test, it will become a standard part of the engine in a future release. Just be a little careful when you implement experimental features. Make a backup, keep an eye out for results, and be aware that the feature may change in the future.

Keyboard layout syncing
The field object will no longer attempt to sync the keyboard to the current text. This brings LiveCode (and applications built with it) inline with modern practice on both Windows and Mac (the Linux engine has never tried to do this synching).

Standalone allowInterrupts default
The default setting for the allowInterrupts property is now false in standalones. This change has been made to ensure that user's cannot inadvertently interrupt scripts in built applications.

MySQL driver improvements
The MySQL client library has been updated to the latest version (6.0.0). In particular, this fixes a long standing issue with connection timeouts. Additionally, SSL support now works correctly on all platforms (this requires the 'SSL & Encryption' support be included in the standalone settings when deploying).

revBrowser improvements
There is a long standing issue with revBrowser that causes browser instances to be lost whenever the stack it is attached to has its window re-created. Previously, cases where this would occur had to be avoided when a browser was present on a stack. To resolve this problem a new property has been added to browser instances - windowId. The windowId property allows the stack to which a browser instance is attached to be changed after it has been created. If the windowId is set to 0, the browser instance is temporary hidden. If the windowId is set to a valid stack windowId, the browser instance will move to that stack.

For example, to toggle the resizable property of a stack hosting a browser use the following code:

revBrowserSet pBrowserId, "windowId", 0 
set the resizable of stack pBrowserStack to pNewResizeableValue 
revBrowserSet pBrowserId, "windowId", the windowId of stack \
       pBrowserStack
This feature is currently experimental.

Windows - SSL improvements
The SSL libraries required for encryption and HTTPS on Windows have been updated to use
OpenSSL 1.0.0a and have been compiled into a single DLL - revsecurity.dll. This DLL must be present in the same folder as the (standalone) engine for these features to work (note the standalone builder automatically includes this library if the appropriate inclusion is set).

I hope you find these new features useful, and look forward to bringing you the next release!

About the Author

Mark Waddingham is CTO for Runtime Revolution Ltd.

 

Main Menu

What's New

Get your RunRevLive.11 Ticket Today