Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > microsoft.public.scripting.vbscript > #11720
| Path | csiph.com!aioe.org!.POSTED!not-for-mail |
|---|---|
| From | "R.Wieser" <address@not.available> |
| Newsgroups | microsoft.public.scripting.vbscript |
| Subject | Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? |
| Date | Sat, 22 Jul 2017 14:16:01 +0200 |
| Organization | Aioe.org NNTP Server |
| Lines | 59 |
| Message-ID | <okvgds$lc6$1@gioia.aioe.org> (permalink) |
| References | <okvc0l$d0p$1@gioia.aioe.org> <XnsA7BA8B48B27C1eejj99@194.109.6.166> |
| NNTP-Posting-Host | ExTgs1lzWeWpikkEjhubcA.user.gioia.aioe.org |
| X-Complaints-To | abuse@aioe.org |
| X-Priority | 3 |
| X-Notice | Filtered by postfilter v. 0.8.2 |
| X-Newsreader | Microsoft Outlook Express 5.00.2615.200 |
| X-MSMail-Priority | Normal |
| X-MimeOLE | Produced By Microsoft MimeOLE V5.00.2615.200 |
| Xref | csiph.com microsoft.public.scripting.vbscript:11720 |
Show key headers only | View raw
Evertjan,
> Methinks you need the second "Set" command,
> so the execute does not receive the string in your code:
Wel, I've already written and tested that part, and it works as posted
(inclusive displaying and modifying the parents data). Also, if you whould
be right I'm rather certain I would have gotten some kind of (compile or
runtime) error thrown at me. :-)
The reason it works is because the "fso.OpenTextFile("test.vbs")" itself
returns an object, and even though its not (yet) copied into a users
variable its already available. The ".readall" is just a method applied to
that object.
Though as the reference count for that object stays Zero it will be garbage
collected soon after the method terminates.
Regards,
Rudy Wieser
-- Origional message:
Evertjan. <exxjxw.hannivoort@inter.nl.net> schreef in berichtnieuws
XnsA7BA8B48B27C1eejj99@194.109.6.166...
> "R.Wieser" <address@not.available> wrote on 22 Jul 2017 in
> microsoft.public.scripting.vbscript:
>
> > I'm writing a script in which I want to execute some child scripts, and
> > return a result. Like this:
> >
> > result = execute(oFS.OpenTextFile("childscript.vbs").ReadAll)
> >
> > Two things: I do not see any way to return such a result, nor do I see
> > any way to, if needed, provide arguments.
> >
> > I'm aware that the executed script can just access and/or change some of
> > its parents data (scope permitting ofcourse), but I was wondering if I
> > could handle it more like an external function.
>
>
> Methinks you need the second "Set" command,
> so the execute does not receive the string in your code:
>
> ====== test.vbs =======
>
> Set fso = CreateObject("Scripting.FileSystemObject")
> Set theFile = fso.OpenTextFile("test.vbs")
> MsgBox theFile.ReadAll
> theFile.close
>
> =======================
>
> --
> Evertjan.
> The Netherlands.
> (Please change the x'es to dots in my emailaddress)
Back to microsoft.public.scripting.vbscript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-22 13:14 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-07-22 13:41 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-22 14:16 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "Dave \"Crash\" Dummy" <invalid@invalid.invalid> - 2017-07-22 07:58 -0400
Re: the "execute" command, arguments and returning a result. Possible? If so, how ? "R.Wieser" <address@not.available> - 2017-07-22 14:29 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? Ulrich Möller <knobbi38@arcor.de> - 2017-07-22 14:53 +0200
Re: the "execute" command, arguments and returning a result. Possible? If so, how ? "R.Wieser" <address@not.available> - 2017-07-22 16:28 +0200
Re: the "execute" command, arguments and returning a result. Possible? If so, how ? Ulrich Möller <knobbi38@arcor.de> - 2017-07-23 13:49 +0200
Re: the "execute" command, arguments and returning a result.Possible? If so, how ? "R.Wieser" <address@not.available> - 2017-07-24 08:29 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? JJ <jj4public@vfemail.net> - 2017-07-22 19:58 +0700
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-22 16:52 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "Mayayana" <mayayana@invalid.nospam> - 2017-07-22 09:28 -0400
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-22 17:09 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "Mayayana" <mayayana@invalid.nospam> - 2017-07-23 08:41 -0400
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-24 10:52 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "Mayayana" <mayayana@invalid.nospam> - 2017-07-24 08:38 -0400
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-24 18:45 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-07-25 10:02 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-25 14:18 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-07-25 23:42 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-26 08:20 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-07-26 10:21 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-26 14:14 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-07-26 19:34 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-27 09:11 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-07-27 09:18 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-07-27 12:44 +0200
Re: the "execute" command, arguments and returning a result. Possible ? If so, how ? "R.Wieser" <address@not.available> - 2017-08-01 23:21 +0200
csiph-web