Skip to content

Commit 0ff94ad

Browse files
committed
Improved comments for utils.shellexecute
1 parent f77e7ca commit 0ff94ad

File tree

1 file changed

+61
-64
lines changed

1 file changed

+61
-64
lines changed

scripting/lua_utils.cpp

Lines changed: 61 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -1400,7 +1400,7 @@ static int getfontfamilies (lua_State *L)
14001400
14011401
Example:
14021402
1403-
utils.send_to_front ("Crimson Editor")
1403+
utils.sendtofront ("Crimson Editor")
14041404
14051405
*/
14061406

@@ -1412,77 +1412,74 @@ static int send_to_front (lua_State *L)
14121412

14131413
/* Execute an operating-system command:
14141414
1415-
windows_utils.shell_execute (filename, params, defdir, operation, show_command)
1415+
utils.shellexecute (filename, params, defdir, operation, show_command)
14161416
1417-
Only the first argument (filename) is required, the rest are optional.
1417+
Only the first argument (filename) is required, the rest are optional.
14181418
1419-
filename: The file to open or print or the folder to open or explore.
1420-
The function can open an executable file or a document file.
1421-
The function can print a document file.
1419+
filename: The file to open or print or the folder to open or explore.
1420+
The function can open an executable file or a document file.
1421+
The function can print a document file.
14221422
1423-
params: A string that specifies the parameters to be passed to the application.
1424-
If filename specifies a document file, params should be nil or "".
1423+
params: A string that specifies the parameters to be passed to the application.
1424+
If filename specifies a document file, params should be nil or "".
14251425
1426-
defdir: A string that specifies the default directory.
1427-
1428-
operation: The following operation strings are valid:
1429-
"open": The function opens the file specified by the filename parameter.
1430-
The file can be an executable file or a document file. It can also be a folder.
1431-
"print": The function prints the file specified by filename.
1432-
The file should be a document file.
1433-
If the file is an executable file, the function opens the file,
1434-
as if "open" had been specified.
1435-
"explore": The function explores the folder specified by filename.
1426+
defdir: A string that specifies the default directory.
1427+
1428+
operation: The following operation strings are valid:
1429+
"open": The function opens the file specified by the filename parameter.
1430+
The file can be an executable file or a document file. It can also be a folder.
1431+
"print": The function prints the file specified by filename.
1432+
The file should be a document file.
1433+
If the file is an executable file, the function opens the file,
1434+
as if "open" had been specified.
1435+
"explore": The function explores the folder specified by filename.
14361436
1437-
This parameter can be nil or "".
1438-
In that case, the function opens the file specified by filename.
1437+
This parameter can be nil or "".
1438+
In that case, the function opens the file specified by filename.
14391439
1440-
show_command: If filename specifies an executable file, show_command specifies how the
1441-
application is to be shown when it is opened.
1440+
show_command: If filename specifies an executable file, show_command specifies
1441+
how the application is to be shown when it is opened.
14421442
1443-
This parameter can be nil in which case it defaults to 1 - the recommended default.
1444-
1445-
This parameter can be one of the following values:
1443+
This parameter can be nil in which case it defaults to 1 - the recommended default.
1444+
1445+
This parameter can be one of the following values:
14461446
1447-
0: Hides the window and activates another window.
1448-
1: Activates and displays a window.
1449-
If the window is minimized or maximized, Windows restores it to
1450-
its original size and position.
1451-
An application should specify this flag when displaying the window for the first time.
1452-
2: Activates the window and displays it as a minimized window.
1453-
3: Activates the window and displays it as a maximized window.
1454-
4: Displays a window in its most recent size and position.
1455-
The active window remains active.
1456-
5: Activates the window and displays it in its current size and position.
1457-
6: Minimizes the specified window and activates the next top-level window in the z-order.
1458-
7: Displays the window as a minimized window.
1459-
The active window remains active.
1460-
8: Displays the window in its current state.
1461-
The active window remains active.
1462-
9: Activates and displays the window.
1463-
If the window is minimized or maximized, Windows restores it to its original
1464-
size and position.
1465-
An application should specify this flag when restoring a minimized window.
1466-
10: Sets the show state based on the SW_ flag specified in the STARTUPINFO structure
1467-
passed to theCreateProcess function by the program that started the application.
1468-
An application should call ShowWindow with this flag to set the initial show
1469-
state of its main window.
1470-
1471-
1472-
If sucessful, the function returns true.
1473-
If not, it returns nil followed by an error message. You could use "assert" to test for failure.
1474-
1475-
Examples:
1476-
1477-
assert (windows_utils.shell_execute ("c:\\mushclient\\worlds\\SMAUG.MCL")) -- document
1478-
1479-
assert (windows_utils.shell_execute ("http://www.gammon.com.au/")) -- web page
1480-
1481-
assert (windows_utils.shell_execute ("mailto:someone@somewhere.com")) -- open mail client
1482-
1483-
assert (windows_utils.shell_execute ("c:\\", nil, nil, "explore")) -- explore disk
1484-
1485-
assert (windows_utils.shell_execute ("c:\\readme.txt", nil, nil, "print")) -- print a file
1447+
0: Hides the window and activates another window.
1448+
1: Activates and displays a window.
1449+
If the window is minimized or maximized, Windows restores it to
1450+
its original size and position.
1451+
An application should specify this flag when displaying the window for the first time.
1452+
2: Activates the window and displays it as a minimized window.
1453+
3: Activates the window and displays it as a maximized window.
1454+
4: Displays a window in its most recent size and position.
1455+
The active window remains active.
1456+
5: Activates the window and displays it in its current size and position.
1457+
6: Minimizes the specified window and activates the next top-level window in the z-order.
1458+
7: Displays the window as a minimized window.
1459+
The active window remains active.
1460+
8: Displays the window in its current state.
1461+
The active window remains active.
1462+
9: Activates and displays the window.
1463+
If the window is minimized or maximized, Windows restores it to its original
1464+
size and position.
1465+
An application should specify this flag when restoring a minimized window.
1466+
10: Sets the show state based on the SW_ flag specified in the STARTUPINFO structure
1467+
passed to theCreateProcess function by the program that started the application.
1468+
An application should call ShowWindow with this flag to set the initial show
1469+
state of its main window.
1470+
1471+
1472+
If sucessful, the function returns true.
1473+
1474+
If not, it returns nil followed by an error message. You could use "assert" to test for failure.
1475+
1476+
Examples:
1477+
1478+
assert (utils.shellexecute ("c:/mushclient/worlds/SMAUG.MCL"))-- document
1479+
assert (utils.shellexecute ("http://www.gammon.com.au/")) -- web page
1480+
assert (utils.shellexecute ("mailto:someone@somewhere.com")) -- open mail client
1481+
assert (utils.shellexecute ("c:/", nil, nil, "explore")) -- explore disk
1482+
assert (utils.shellexecute ("c:/readme.txt", nil, nil, "print")) -- print a file
14861483
14871484
*/
14881485

0 commit comments

Comments
 (0)