473,395 Members | 1,574 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Re: Perl style splice functions for VB.NET and VBA

"John Brock" <jb****@panix.comwrote in message
news:gg**********@reader1.panix.com...
>I have been frustrated for a while by the difficulty of manipulating
arrays in VBA and VB.NET -- in particular the awkwardness involved
in appending, prepending, or inserting new elements -- so to make
my life easier I wrote two functions that act something like Perl's
splice function. I wrote the VBA version first, and then a slightly
different version for VB.NET. Both versions are included here,
and they are both a little different from the Perl function, but
close enough that you should be able to make them functionally
identical without too much trouble if you happen to feel like it.
You really need to stop trying to write perl code in dot net and VBA. Arrays
are hard to resize for a good reason, this goes down to how the hardware
works. They have the advantage of being super efficient but this comes at
the expense of some restrictions. If you want the flexibility then use the
list class. I really cannot accept at all that you are stuck using the array
because of some existing code. It will either be very easy to change the
existing code or very easy to cast the array to a list when needed (1 line
of code).

Several people here have given you good advice and you choose to ignore it.
Inserting an element in a list is one line of code but you insist on writing
pages of code to do it the wrong way. If you ask a question here you should
take the GOOD advice you are given. If you ignore it then there isn't much
point asking the question.

Michael
Nov 21 '08 #1
0 1257

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Xah Lee | last post by:
© # -*- coding: utf-8 -*- © # Python © © # in Python, one can define a boxed set © # of data and functions, which are © # traditionally known as "class". © © # in the following, we define a...
385
by: Xah Lee | last post by:
Jargons of Info Tech industry (A Love of Jargons) Xah Lee, 2002 Feb People in the computing field like to spur the use of spurious jargons. The less educated they are, the more they like...
10
by: Hendry Taylor | last post by:
I wrote a perl script and tested it on windows and it works fine. I then moved it onto a solaris machine and now it says that there is a syntax error with the following line of code: $user1 =...
0
by: Xah Lee | last post by:
One-Liner Loop in Functional Style Xah Lee, 200510 Today we show a example of a loop done as a one-liner of Functional Programing style. Suppose you have a list of file full paths of...
0
by: Kirt Loki Dankmyer | last post by:
So, I download the latest "stable" tar for perl (5.8.7) and try to compile it on the Solaris 8 (SPARC) box that I administrate. I try all sorts of different switches, but I can't get it to compile....
5
by: svancouw | last post by:
I just started teaching myself Perl a couple days ago, and am looking forward to what this will give me for my Linux administration skills. Any help on this will be appreciated. I ran into a...
19
by: Juha Nieminen | last post by:
If I'm not completely mistaken, the only reason why std::list::size() may be (and usually is) a linear-time operation is because they want std::list::splice() to be a constant-time operation, and...
2
by: muppetjones | last post by:
I have been receiving a "Floating point exception" from Perl after my program has run several iterations. I have not been able to pin point the location of the error, and I am clueless. Especially as...
18
by: dhtml | last post by:
Array.splice({}) What should it do? I think it should return a new Array with length 0. Array.splice(arr, start, deleteCount ]]) http://bclary.com/2004/11/07/#a-15.4.4.12 Example:
0
by: Michael C | last post by:
"John Brock" <jbrock@panix.comwrote in message news:gg56ab$qsn$1@reader1.panix.com... You really need to stop trying to write perl code in dot net and VBA. Arrays are hard to resize for a good...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.