View Full Version : Multiple Variables in a string
Cheeze Man
05-13-2006, 03:39 PM
inputuser = pie1;
inputpass = pie2;
inputfile = pie3;
Dialog.Message("Notice", inputuser inputpass inputfile );
To make the dialogue say "pie1 pie2 pie3"
so one string (or whatever you call it) is using not 1 but 3 variables, if you don't undestand please tell me, i am not that good at explaining things
Corey
05-13-2006, 04:07 PM
Hi, check out "concatenation" in the user's guide, i.e.
Dialog.Message("Notice", inputuser.." "..inputpass.." "..inputfile );
Cheeze Man
05-13-2006, 04:41 PM
thank you, but when i bulid the project and click the button, it gives me the message "On Click, Line 4: attempt to concatenate global `inputfile' (a nil value)"
why does it say that?:huh
Corey
05-13-2006, 04:58 PM
Because you didn't set your variable.
longedge
05-13-2006, 04:58 PM
If you're using the code shown in your original post, then you need to assign values to each string by enclosing each one in quotes. Try something like -
inputuser = "pie1";
inputpass = "pie2";
inputfile = "pie3";
Dialog.Message("Notice", inputuser.." "..inputpass.." "..inputfile );
Cheeze Man
05-13-2006, 06:29 PM
its a bit too late i used a more complex way
create = "-c -b";
user = Input.GetText("user");
pass = Input.GetText("pass");
out = "output.txt";
userout = out .. " " .. user;
useroutc = create .. " " .. userout;
b = useroutc .." " .. pass;
result = File.Run("AutoPlay\\Docs\\htpasswd.bat", b, "AutoPlay\\Docs", SW_SHOWNORMAL, false);
thanks anyway
Corey
05-13-2006, 06:37 PM
Well the main thing is that now you know how to concatenate. :yes
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.