Path: csiph.com!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: "Dave \"Crash\" Dummy" Newsgroups: microsoft.public.scripting.vbscript Subject: Re: VbScript and .NET objects Date: Mon, 31 Aug 2015 07:40:16 -0400 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: <55e1a84f.4061562@nntp.aioe.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Mon, 31 Aug 2015 11:38:28 +0000 (UTC) Injection-Info: mx02.eternal-september.org; posting-host="847cb9ac544c0d3986237452b863d7e6"; logging-data="3811"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18/wA5bDqSWmZluV19/tq0C/QOoEm4NGt0=" User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) In-Reply-To: Cancel-Lock: sha1:BXDm5d939MxPf54wJhW9PMf8O9c= Xref: csiph.com microsoft.public.scripting.vbscript:11143 Mayayana wrote: > | I use the Mid function to emulate the lacking Mid statement: > | > | s1=mid(s1,1,100) & "sample" & mid(s1,101) > | > > That doesn't improve efficiency over the Left/Right code. > It's just another way to do the same thing. You're still > allocating 2 new strings, even though you're not declaring > them, and then concatenating those strings in a 3rd new > string. There is no substitute for the Mid statement, which > is an entirely different operation, writing directly to the > string bytes with no new allocations. > > Any of the Mid/Left/Right/Replace methods is fine for > small string operations, but for extensive operations it's > worthwhile to try to find a way to do it with Array/Join. I don't understand how you turn the initial string of x characters into an array of x elements. -- Crash A line in the sand doesn't mean much if it disappears at high tide.