I am trying to append arguments to a string to be passed to another script. Following:
WScript.Echo(Join(WScript.Arguments))
gives me an error:
Error: Wrong number of arguments or invalid property assignment Code: 800A01C2
What is wrong with this syntax?
WshArgument objects are not arrays, so you cannot use Join() for them. What you can do is something like this:
WshArgument
Join()
ReDim arr(WScript.Arguments.Count-1) For i = 0 To WScript.Arguments.Count-1 arr(i) = WScript.Arguments(i) Next WScript.Echo Join(arr)
Another solution can be made using the ArrayList object from the system:
Set oAL = CreateObject("System.Collections.ArrayList") For Each oItem In Wscript.Arguments: oAL.Add oItem: Next WScript.Echo Join(oAL.ToArray, " ")
Source: https://habr.com/ru/post/950857/More articles:How difficult is it to detect at the source code level arrays of run-time boundaries? - c ++PHP $ _SERVER ['REMOTE_ADDR'] is empty - phpERROR: Module mod_vhost_alias does not exist - apacheIs there a way to get the json handler for Pyramid to output formatted, fairly printed output? - jsonProcess.Start () is not working properly - c #https://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/950858/bootstrap-carousel-jumps-to-top-of-page-when-advancing&usg=ALkJrhj3r0gpgnZsc0KAxQ8Lg6cM-cc8QAleft / right float button inside div - htmlNode.js - a resource interpreted as Script, but ported with the MIME type text / plain - node.jsusing putchar_unlocked for quick output - c ++Update error after completing SVN transaction (unable to create temporary file from template / allowed) - linuxAll Articles