JerichoJones Posted December 24, 2013 Posted December 24, 2013 I have a function that I have created but when I pass the string below it seems to think there are 4 args instead of three. This has worked for every app so far except this one. InstallApp("NO", "WLSetup-all.exe", "/q /NOToolbarCEIP /NOhomepage /Nolaunch /nosearch /AppSelect:Photo,MovieMaker,Writer", 9) It seems to think it is this: InstallApp("NO", "WLSetup-all.exe", "/q /NOToolbarCEIP /NOhomepage /Nolaunch /nosearch", " /AppSelect:Photo,MovieMaker,Writer", 9) What am I missing?
jdelaney Posted December 24, 2013 Posted December 24, 2013 We don't have access to your function, so can't comment on how the variables passed in are combined and executed. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
JerichoJones Posted December 24, 2013 Author Posted December 24, 2013 We don't have access to your function, so can't comment on how the variables passed in are combined and executed. Why do you need that? It doesn't even get there. It complains during compile that it is getting 4 args when only three are supported. I can add the code. I just don't see the need.
Developers Jos Posted December 24, 2013 Developers Posted December 24, 2013 (edited) The first line has 4 parameters and the second has 5 parameters. Show an example that demo's the issue. Jos Edited December 24, 2013 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
jdelaney Posted December 24, 2013 Posted December 24, 2013 (edited) Well there you go. If you had posted that to begin with, we would have had a better jumping off point: Why do you need that? It doesn't even get there. It complains during compile that it is getting 4 args when only three are supported. I can add the code. I just don't see the need. You can't call functions with more parameters than present. You can't call functions with less parameters than required (exceptions when they have default assignments) Post the function (at least the first line of it, where the variables are decalred) I don't know what you are expecting with the fourth param, but you already answered your question by passing in three. Edited December 24, 2013 by jdelaney IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
JerichoJones Posted December 24, 2013 Author Posted December 24, 2013 The first line has 3 parameters and the second has 4. Show an example that demo's the issue. Jos InstallApp("NO", "WLSetup-all.exe", "/q /NOToolbarCEIP /NOhomepage /Nolaunch /nosearch /AppSelect:Photo,MovieMaker,Writer", 9) Func InstallApp($IsMSI, $Installer, $Switches) If $IsMSI = "YES" Then ConsoleWrite("Installing " & $Installer & @CRLF) Local $Install = RunWait("MsiExec.exe /i " & Chr(34) & $Installer & Chr(34) & " " & $Switches & " /qn /Log C:\Temp\" & $Installer & ".log") If $Install = 0 Or $Install = 3010 Then WriteLog($Install, $Installer & @TAB & "Success") ConsoleWrite("Installation Successful" & @CRLF) Else WriteLog($Install, $Installer & @TAB & "Failed") ConsoleWrite("Installation Failed" & @CRLF) EndIf Else ConsoleWrite("Installing " & $Installer & @CRLF) Local $Install = RunWait(@ScriptDir & "\" & $Installer & " " & $Switches) If $Install = 0 Or $Install = 3010 Then WriteLog($Install, $Installer & @TAB & "Success") ConsoleWrite("Installation Successful" & @CRLF) Else WriteLog($Install, $Installer & @TAB & "Failed") ConsoleWrite("Installation Failed" & @CRLF) EndIf EndIf EndFunc ;==>InstallApp I get this error on compile: E:InstallWE.au3(27,47) : ERROR: InstallApp() called by a previous line with 4 arg(s). Max = 3. First previous line calling this Func is 19.
jdelaney Posted December 24, 2013 Posted December 24, 2013 What are you expecting the fourth param to do. You'll need to add some additional parameter to your function, or remove it from the call to the function. IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
JerichoJones Posted December 24, 2013 Author Posted December 24, 2013 What are you expecting the fourth param to do. You'll need to add some additional parameter to your function, or remove it from the call to the function. It should be three. For some reason it thinks it is four. The first line is the one that should work. There are only three args.
jdelaney Posted December 24, 2013 Posted December 24, 2013 From post #6: InstallApp("NO", "WLSetup-all.exe", "/q /NOToolbarCEIP /NOhomepage /Nolaunch /nosearch /AppSelect:Photo,MovieMaker,Writer", 9) change to: InstallApp("NO", "WLSetup-all.exe", "/q /NOToolbarCEIP /NOhomepage /Nolaunch /nosearch /AppSelect:Photo,MovieMaker,Writer") IEbyXPATH-Grab IE DOM objects by XPATH IEscriptRecord-Makings of an IE script recorder ExcelFromXML-Create Excel docs without excel installed GetAllWindowControls-Output all control data on a given window.
BrewManNH Posted December 24, 2013 Posted December 24, 2013 There are 4 arguments in your call to it "NO" "WLSetup-all.exe" "/q /NOToolbarCEIP /NOhomepage /Nolaunch /nosearch /AppSelect:Photo,MovieMaker,Writer" 9 One of those has to go, or you need to quote something. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
JerichoJones Posted December 24, 2013 Author Posted December 24, 2013 DOH!!!! Typo. Now I see why the code was needed.
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