View Full Version : LUA and Continuation Lines
kweatherhead
10-24-2007, 02:20 PM
Greetings,
Does the scripting tool in SUF 7.0 allow you to have Continuation Lines for long command lines? I hate how laser printers just chop off the right hand end of a line and I prefer to see the entire command on the screen without scrolling anyway.
Regards,
Keith
instead of
myCmd = "some long string";
you may use
myCmd = "some ";
myCmd = myCmd .. "long ";
myCmd = myCmd .. "string";
Brett
10-25-2007, 12:14 AM
or...
myCmd = [[some
long
string]];
kweatherhead
10-25-2007, 11:56 AM
or...
myCmd = [[some
long
string]];
The previous answer was what I would consider as concatenation...
are you saying that a single command line can span multiple physical lines if enclosed with "[[" and "]]" ?
For example... Registry.SetValue ... Example 1 .. SUF 7.0 Help
Where the following is really one long line...
Registry.SetValue (HKEY_LOCAL_MACHINE, "Software\\My Application", "InstallPath", _ProgramFilesFolder .. "\\My Application", 1);
could be coded as 2 physical lines via:
[[ Registry.SetValue (HKEY_LOCAL_MACHINE, "Software\\My Application",
"InstallPath", _ProgramFilesFolder .. "\\My Application", 1)]];
Correct?
Regards,
Keith
kweatherhead
10-25-2007, 12:20 PM
or...
myCmd = [[some
long
string]];
In addition, to clarify, if a return value is part of the command, would the format then be like this?
is_there = [[Registry.DoesKeyExist (HKEY_LOCAL_MACHINE,
"Software\\My Application")]];
Regards,
Keith
Brett
10-25-2007, 02:41 PM
Sorry, I misunderstood your question. The [[...]] formatting if for strings only. If you are taking about breaking function calls onto separate lines, that is fine as long as you break them between arguments:
is_there = Registry.DoesKeyExist (HKEY_LOCAL_MACHINE,
"Software\\My Application");
kweatherhead
10-25-2007, 02:47 PM
Sorry, I misunderstood your question. The [[...]] formatting if for strings only. If you are taking about breaking function calls onto separate lines, that is fine as long as you break them between arguments:
is_there = Registry.DoesKeyExist (HKEY_LOCAL_MACHINE,
"Software\\My Application");
Brett,
Thanx for the clarification. Yes I was talking about functions and the likes, however, knowing the string option is nice, too !!
Regards,
Keith
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.