[JW Lua] New sample script: Search Text Expressions

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Tue Nov 26 22:28:54 CET 2013


On 2013-11-26 21:43, Charles O. Lawrence wrote:
> I had not seen your previous reply.  Can you give an example of how to do
> the mapping you refer to?

A simple approach would be like this:
1. Check if the expression string (after the Enigma commands has been 
trimmed) is exactly 1 character long
2. If #1, get the character number by using GetItemAt(0) on the string 
object.
3. Map the character number to a table, such as "mappedtable[charnumber]".
4. If step #3 is non-nil, set the text object to the mapped string

The table could look something like this:
mappedtable =
{
    [70] = "mf",
    [80] = "mp",
    [83] = "sf",
    [90] = "fz",
    [102] = "f",
    [167] = "sfz",
...and so on...
}



Best regards,

Jari Williamsson





More information about the JWLua mailing list