Security 17 Posted June 15, 2013 Report Share Posted June 15, 2013 Maybe a dumb question but id like to know if someone can please define and or describe the difference between the "Function" & "Command" choice in the "Define" command. Thank you. Quote Link to post Share on other sites
blumi40 222 Posted June 15, 2013 Report Share Posted June 15, 2013 simple exampledefine $mathfunc(#var1, #var2) { set(#var1, #var1, "Local") set(#var2, #var2, "Local") set(#result, $add(#var2, #var1), "Global") return(#result)}set(#i need the value, $mathfunc(5, 9), "Global") 1 Quote Link to post Share on other sites
Security 17 Posted June 16, 2013 Author Report Share Posted June 16, 2013 Thanks a lot bro.. I appreciate it. BUt this doesn't really explain the difference between the "Function" & "Command" choice in the "Define" command. Quote Link to post Share on other sites
Security 17 Posted June 16, 2013 Author Report Share Posted June 16, 2013 Could i asked you one more question. What do the "parameters" mean, or better yet could you show me another example ? Thanks again.. Quote Link to post Share on other sites
Security 17 Posted June 16, 2013 Author Report Share Posted June 16, 2013 add item to list(%msgbody1, $list from file(#msgbody), "Delete", "Global") set(#emails position, 0, "Global") loop(#threads) { thread { loop while($comparison(#counter, "<", $list total(%emails))) { next email cmd() connect to mail server("SMTP", #pass, #password, #domain, #port) { wait(1) send email($next list item(%emails), $random list item(%subjects), "HTML", #next email, "", $next list item(%froms), "") increment(#counter) wait(#wait) wait(.5) } } set(#done, $true, "Global") stop script } } define next email cmd { wait($rand(1, $add(#threads, 1))) set(#next email, $replace regular expression(%msgbody1, "EMAIL-MACRO", $list item(%emails, #emails position)), "Local") increment(#emails position) } Here is what i'm trying to do. I set the define to "command" and left "parameters" blank.PLEASE HELP..! Quote Link to post Share on other sites
blumi40 222 Posted June 16, 2013 Report Share Posted June 16, 2013 "thread" needs a "in new browser" too without it wont work also u can use "set visibility" search for in ubotthread { in new browser { set visibility("Visible") here your stuff }} difference between func and commanddefine $mathfunc(#var1, #var2) { set(#var1, #var1, "Local") set(#var2, #var2, "Local") set(#result, $add(#var2, #var1), "Global") return(#result)}set(#i need the value, $mathfunc(5, 9), "Global") <---absolut exclusive define mathfunccomand(#var1, #var2) { set(#var1, #var1, "Local") set(#var2, #var2, "Local") set(#result, $add(#var2, #var1), "Global")}mathfunccomand(9, 4)set(#i need the value, #result, "Global") <---a bitch everyone knows sure for coders are both functions but ubot got a bit his own rulezhope u understand yet Quote Link to post Share on other sites
Security 17 Posted June 16, 2013 Author Report Share Posted June 16, 2013 I am using "connect to mail server". This is a socket command, does not use a browser (i don't thinkg) my Mailer has been working fine with out "in new browser".. Are you sure i need to use "in new browser" for connect to mail server ? Quote Link to post Share on other sites
VaultBoss 310 Posted June 16, 2013 Report Share Posted June 16, 2013 A simple define (command) is the equivalent of a sub-routine that performs code and affects data for variables/list/tables that are set as Global inside its container, w/o returning ANY result at all per se = it is only a series of commands that repeat themselves.The function version of the define, is a series of commands that will return ONE variable value, the one specified by the RETURN command within its code.That makes it very useful. Personally, I only use functions, even when there is no particular output that I need from the define, but at least I return a false/true value as a measure of the functions' ability to perform all the code it was supposed to. EXAMPLE Many people use a simple DEFINE (as a command) for a signup or signin/login to a site I prefer to use a FUNCTION instead, that returns the true/false value, telling the calling main program that the function was able to execute correctly (logged in successfully, or created an account successfully, etc...) Makes more sense now? 2 Quote Link to post Share on other sites
Security 17 Posted June 16, 2013 Author Report Share Posted June 16, 2013 Thank you so much VaultBoss i could not have asked for a more clear response. This totally explains EXACTLY what i needed. blumi40 i thank you as well for trying. 1 Quote Link to post Share on other sites
Sanjeev 46 Posted June 17, 2013 Report Share Posted June 17, 2013 blumi40 and VaultBoss - thanks for your replies - I understands functions and commands better now! Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.