koresho Posted July 14, 2008 Share Posted July 14, 2008 (edited) Hey guys, I am sure this has come up before but I searched for it (Same search string as the title is) and gotThe error returned was:One or all of your search keywords were below 3 characters or you searched for words which are not allowed, such as 'html', 'img', etc, please go back and increase the length of these search keywords or choose different keywords.Anyway, anyone have any tips on how to pass variables to another compiled script? I need a download progress bar, and if I try to use INetGet() in the background it doesn't work, won't update the progress bar properly... So I'm thinking of having another script run just the progress bar, but I need to pass the @INetGetBytesRead to the other script. Or, if someone has tips on how to get the progressbar to work... Edited July 14, 2008 by koresho Link to comment Share on other sites More sharing options...
DaRam Posted July 14, 2008 Share Posted July 14, 2008 In the called script, use $CmdLine[1] to get the first parameter ($CmdLine[2] for second, and so on). Hey guys, I am sure this has come up before but I searched for it (Same search string as the title is) and got Anyway, anyone have any tips on how to pass variables to another compiled script? I need a download progress bar, and if I try to use INetGet() in the background it doesn't work, won't update the progress bar properly... So I'm thinking of having another script run just the progress bar, but I need to pass the @INetGetBytesRead to the other script. Or, if someone has tips on how to get the progressbar to work... Link to comment Share on other sites More sharing options...
koresho Posted July 14, 2008 Author Share Posted July 14, 2008 Are you saying to use the ConsoleWrite/Read functions? Link to comment Share on other sites More sharing options...
ChrisL Posted July 14, 2008 Share Posted July 14, 2008 (edited) The receiver with the progressbar Global Const $WM_USER = 0x400 $GuiTitle = "The Progress Bar Script" $gui = GuiCreate($GuiTitle,500,200) $progress = GUICtrlCreateProgress(10,10,400,20) GUISetState() GUIRegisterMsg($WM_USER, "MY_MSGS_HANDLER") While 1 Sleep(100) WEnd Func MY_MSGS_HANDLER($hWnd, $nMsg, $wParam, $lParam) GUICtrlSetData($progress, Dec(StringTrimLeft($wParam,2))) EndFunc ;==>MY_MSGS_HANDLER The sender... Global Const $WM_USER = 0x400 Const $ProgressGuiTitle = "The Progress Bar Script" $wHwnd = WinGetHandle($ProgressGuiTitle ) For $i = 1 to 100 If $wHwnd <> "" then PostMessage($wHwnd,$WM_USER, $i, "") Sleep(200) Next Func PostMessage($hWnd, $msg, $wParm, $lParm) Return DllCall("user32.dll", "int", "PostMessage", _ "hwnd", $hWnd, _ "int", $msg, _ "int", $wParm, _ "int", $lParm) EndFunc ;==>PostMessage Edited July 14, 2008 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
DaRam Posted July 14, 2008 Share Posted July 14, 2008 (edited) Ok, I must admit I just answered after reading the "Topic" of the post, and I think the answer was correct. In that if your script is "Script1.Au3" and your second script is "Script2.Au3" Script1.Au3 could call Script2.Au3 passing it a parameter. Script2.Au3 would use $Command[1] to get the passed parameter. In your case, I think you are better off creating a GUI for the progress and updating it as needed. Edit: ChrisL has posted some elegant code that might do exactly what you are looking for. Are you saying to use the ConsoleWrite/Read functions? Edited July 14, 2008 by DaRam Link to comment Share on other sites More sharing options...
koresho Posted July 14, 2008 Author Share Posted July 14, 2008 (edited) ChrisL, that looks like it will work, thanks muttleyDaRam, I wouldn't have been able to do that because I need to have both scripts compiled thanks for the help though. ...pass variables to another compiled script?... Edited July 14, 2008 by koresho Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now