I created a script to count the number of characters in a double quoted string and return the value to the user with a messageBox call.
When I execute the script, I get nothing but a very brief dialog box about pressing cancel to abort the current operation.
But a test script I created to test the messageBox operation works just fine.
Can anyone explain to me what is going on and what the problem might be?
From a code logic standpoint, there is no reason why the messageBox call in my string length script should not execute.
Regards, Brian
Code: Select all
// string length calculator
var len = 0;
var startFound = false;
var endFound = false;
var msg = "Initial Message";
while (!UltraEdit.activeDocument.isChar('"') && UltraEdit.activeDocument.isColNumGt(1))
{
UltraEdit.activeDocument.key("LEFT ARROW");
}
if (UltraEdit.activeDocument.isChar('"')
{
startFound = true;
}
if (startFound)
{
UltraEdit.activeDocument.key("RIGHT ARROW");
while (!UltraEdit.activeDocument.isChar('"'))
{
len++;
UltraEdit.activeDocument.key("RIGHT ARROW");
}
if (UltraEdit.activeDocument.isChar('"')
{
endFound = true;
}
if (endFound)
{
msg = "String Length = " + len;
}
else
{
msg = "ERROR: No end of string found!";
}
}
else
{
msg = "ERROR: No starting double quote found!";
}
UltraEdit.messageBox(msg, "String Length");
But a test script I created to test the messageBox operation works just fine.
Code: Select all
// messageBox test
UltraEdit.messageBox("Message Box Test", "Message Box Title");
From a code logic standpoint, there is no reason why the messageBox call in my string length script should not execute.
Regards, Brian