Hello:
I have a variable which contains a comma delimited list contained in a
database variable e.g. "5,6,9,10,55,42" - I want to hand this list to
an array function to get it to populate an array, such as follows
(where rst!Q10ACode is the database variable):
Dim ListArray as Variant
Dim Substring1 as String
SubString1 = rst!Q10ACode
ListArray = Array(SubString1)
________________
When I do this, it returns the string length as 14, so I know it's
getting the string, but the UBound of the array is 0, and if I try to
access ListArray(1) and get an index out of bounds error. Can someone
let me know what I'm doing wrong?
Many thanks.
Jim 2 4688
On Tue, 21 Aug 2007 14:02:13 -0000, Jim <ja*************@gmail.com>
wrote:
That's because of the difference between an array and a variant array.
The Array function returns the latter, the Split function the former.
Take your pick (but realize no variant arrays in DotNet).
-Tom.
>Hello:
I have a variable which contains a comma delimited list contained in a database variable e.g. "5,6,9,10,55,42" - I want to hand this list to an array function to get it to populate an array, such as follows (where rst!Q10ACode is the database variable):
Dim ListArray as Variant Dim Substring1 as String
SubString1 = rst!Q10ACode
ListArray = Array(SubString1)
________________ When I do this, it returns the string length as 14, so I know it's getting the string, but the UBound of the array is 0, and if I try to access ListArray(1) and get an index out of bounds error. Can someone let me know what I'm doing wrong?
Many thanks.
Jim
On Tue, 21 Aug 2007 07:16:00 -0700, Tom van Stiphout
<no*************@cox.netwrote:
I should have added:
To iterate a variant array write:
dim v as variant
for each v in ListArray
...
next v
>On Tue, 21 Aug 2007 14:02:13 -0000, Jim <ja*************@gmail.com> wrote:
That's because of the difference between an array and a variant array. The Array function returns the latter, the Split function the former. Take your pick (but realize no variant arrays in DotNet).
-Tom.
>>Hello:
I have a variable which contains a comma delimited list contained in a database variable e.g. "5,6,9,10,55,42" - I want to hand this list to an array function to get it to populate an array, such as follows (where rst!Q10ACode is the database variable):
Dim ListArray as Variant Dim Substring1 as String
SubString1 = rst!Q10ACode ListArray = Array(SubString1)
________________ When I do this, it returns the string length as 14, so I know it's getting the string, but the UBound of the array is 0, and if I try to access ListArray(1) and get an index out of bounds error. Can someone let me know what I'm doing wrong?
Many thanks.
Jim
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: RH |
last post by:
<SELECT name="txtServices" size="3" multiple>
<OPTION value="Massage">Massage</OPTION>
<OPTION value="Facials">Facials</OPTION>
<OPTION value="Wet & Dry Body Treatments">Wet & Dry Body...
|
by: Christine Forber |
last post by:
I wonder if anyone knows of some javascript code to check a
comma-delimited list of email addresses for basic formating.
What I'm looking for is the javascript code to check a form field on
form...
|
by: John B. Lorenz |
last post by:
I'm attempting to write an input routine that reads from a comma delimited
file. I need to read in one record at a time, assign each field to a field
array and then continue with my normal...
|
by: Bob |
last post by:
I have a function that takes in a list of IDs (hundreds) as input parameter
and needs to pass the data to another step as a comma delimited string. The
source can easily create this list of IDs in...
|
by: moondaddy |
last post by:
I'm writing an app in vb.net 1.1 and need to convert a byte array into a
string, and then from a string back to a byte array.
for example
Private mByte() as New Byte(4){11,22,33,44}
Now how...
|
by: jjturon |
last post by:
Can anyone help me??
I am trying to pass a Select Query variable to a table using Dlookup
and return the value to same select query but to another field.
Ex.
SalesManID ...
|
by: XML newbie: Urgent pls help! |
last post by:
function to convert string to 1 dimensional array of long in VB.Net
|
by: Marty |
last post by:
I am new to C# and to structs so this could be easy or just not
possible.
I have a struct defined called Branch
If I use Branch myBranch = new Branch(i); // everything works
If I use Branch...
|
by: gh |
last post by:
Hi,
I have a string variable which contains n number of comma delimited
elements and I would like to store each element into an array but I
could not figure how to do it.
for example,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
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...
|
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...
|
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
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
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...
| |