120 posts
Posted 22 March 2012 - 08:47 AM
as the topic says i would like to make a program that accepts arguments , but i cant seem to find any info about it.
all i find is info about funtion arguments ><
please help , thank you.
1111 posts
Location
Portland OR
Posted 22 March 2012 - 09:04 AM
Try capturing them as a var using the { } brackets.
So put something like this at the start of your code..
local arg = { ... }
You should then be able to work with each argument in the code by doing something like:
if arg[1] == "y" then
do something
end
120 posts
Posted 22 March 2012 - 03:59 PM
ok , i'll try that now then =D
3 posts
Posted 15 January 2013 - 12:05 AM
What if i need to press Ctrl + Alt + 7 to make { and Ctrl + Alt + 0 to make } ?? (danish keyboard)
7508 posts
Location
Australia
Posted 15 January 2013 - 12:49 AM
Try capturing them as a var using the { } brackets.
So put something like this at the start of your code..
local arg = { ... }
You should then be able to work with each argument in the code by doing something like:
if arg[1] == "y" then
do something
end
You can also the validate the number of args with
if #args ~= 4 then
-- show usage
end
7508 posts
Location
Australia
Posted 15 January 2013 - 12:50 AM
What if i need to press Ctrl + Alt + 7 to make { and Ctrl + Alt + 0 to make } ?? (danish keyboard)
Maybe modify the edit program so that when a key such as an F key is pressed it will add them to the text…
2088 posts
Location
South Africa
Posted 15 January 2013 - 01:34 AM
Click Ctrl first and then do the shortcuts.
Alternatively, you can edit the edit program if it's single player.
Or if it's multiplayer, copy the edit program to the computer and then edit the program to use the Alt key to bring up the menu