473,320 Members | 1,969 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,320 software developers and data experts.

Final Post of the day

Im trying to store data as I would in some old language.

Old Example
//Create an array that holds 3 different variable types

TempArray := { { "Hello", 1, False }, { "Goodbye", 123, True } }

( basically array 1 is a char, 2 is a number, and 3 is a bool )
So
TempArray[ 1, 1 ] == Hello
TempArray[ 1, 2 ] == 1
TempArray[ 2, 2 ] == 123
How can I set something like this up in Vb.Net 2003 ?

Or Can I ?

I have looked at ArrayList and havnt found an answer there. Im not sure
what to "search" for or what im looking for to declare this.

Thanks in advance,

Miro
Jun 13 '06 #1
4 953
Miro,

And you want it exactly with that ?
TempArray := n { "Hello", 1, False }, { "Goodbye", 123, True } }


Otherwise in 2.0 the list (of T) with a class it is very easy to handle
this.

Cor
Jun 13 '06 #2
Hello Miro,

A class that has 3 properties (say: .Greeting, .IntValue, and .BooleanValue)..
then create an instance of the class for each array element. You can then
use an ArrayList or a Collection(Of T).

-Boo
Im trying to store data as I would in some old language.

Old Example
//Create an array that holds 3 different variable types
TempArray := { { "Hello", 1, False }, { "Goodbye", 123, True } }

( basically array 1 is a char, 2 is a number, and 3 is a bool )
So
TempArray[ 1, 1 ] == Hello
TempArray[ 1, 2 ] == 1
TempArray[ 2, 2 ] == 123
How can I set something like this up in Vb.Net 2003 ?

Or Can I ?

I have looked at ArrayList and havnt found an answer there. Im not
sure what to "search" for or what im looking for to declare this.

Thanks in advance,

Miro

Jun 13 '06 #3
Hello, Miro,

Or, if you don't require typing for the individual columns, you could
even just write:

Dim TempArray(,) As Object = {{"Hello", 1, False}, _
{"Goodbye", 123, True}}

Cheers,
Randy
Miro wrote:
Im trying to store data as I would in some old language.

Old Example
//Create an array that holds 3 different variable types

TempArray := { { "Hello", 1, False }, { "Goodbye", 123, True } }

( basically array 1 is a char, 2 is a number, and 3 is a bool )
So
TempArray[ 1, 1 ] == Hello
TempArray[ 1, 2 ] == 1
TempArray[ 2, 2 ] == 123
How can I set something like this up in Vb.Net 2003 ?

Or Can I ?

I have looked at ArrayList and havnt found an answer there. Im not sure
what to "search" for or what im looking for to declare this.

Thanks in advance,

Miro

Jun 13 '06 #4
It was the simple example to post on thew newsgroup.

Basically my point of this is this:
This is for the case of my db file ( created by code as well.)

So what i basically want to write is a Procedure that will store a coded
array ( by me / hardcoded ) and it will look something
like this: ( example ) - again written in non vb code...

EmployeeArray := { { "Code", "C", 10 }, ; // Code field Character of 10
{ "Name", "C", 30 }, ; //Name field Character of 30
{ "Age", "I", 3 } } //Age field Integer of 3

and do this for all the tables required in the db file.

That way, if in a new version a db file is changed ( not sql ) ...no update
is really required to do another
install. All you have to do is supply the new exe, and On Load of the VB
code, the program checks
to see if the DB file is there...and tries to see if it can add any / "all"
of the fields.

If the field exists, you get around this by catching the exception, and
continuing on.

Simple solution to users who really dont know what a folder is / file is /
and have enough trouble getting around an install.

This also saved me once from another situation I had. ( in a program
written other than vb ).
The exe was being locked by the network somehow and could not be replaced.
Somewhere a user was using it, or
windows kept it locked and rebooting the server was not an option at the
time. So by creating an exe, that
reads an INI file, and from that INI file it loads a new EXE ( and closes
itself ) all I had to do in that case was to
email the user a new EXE named file with a new INI file. User copies that
into the directory, and any new user
logging in gets the new exe. The server could be rebooted later.

Loading.exe -> reads ini file where INI file has a value of (
"AProgram.exe" )
so Loading.exe runs AProgram.exe and Loading.exe closes.

Anyones shortcut ( if using over the network ) should point to the
Loading.exe
So if a change is required, I can send them AProgramB.exe and an INI file
that contains "AProgramB.exe" and
all the user has to do is copy this into a folder.

Any new user who is not running a program taht takes a long time to data
crunch can log in, and on login, it adds
new fields as required ( if required ), and the old user who is data
crunching does not need to boot off his computer.
A company does not need to wait for 1 user to do an update.

A network guy can schedule a reboot on the server ( if required ) when he
wants to - not when I want / need to.

This has worked great for a user who wants a new report in the system
Pronto, or a new field or something they would
like to have written in the db. Send them a quote - quote accepted...write
the new app, send them the new INI and EXE
file, and the big boss is happy. Any new user logging in will start writing
to the new fields, any old user can finish the day without
knowing anything different. A proper update can be installed later - that
also clears away the old unused EXE's.

My original app idea will not be ( most likely ) run thru a network. It
will be stand alone copies. But in the future
it could.

Anyway, thats the theory ( and it works great ) of why set up your file defs
in an "array" so you can create them / check
them at start up.

** I would be curious to know how some of you other programmers do this?
Keep in mind the app example I
am giving you could have 25+ or 50+ users in all at the same time.

I have finally decided i will be staying away from sql express until the
original app is written. Then the next learning experience
will start.

Miro
"R. MacDonald" <sc****@NO-SP-AMcips.ca> wrote in message
news:44***********************@news.wanadoo.nl...
Hello, Miro,

Or, if you don't require typing for the individual columns, you could even
just write:

Dim TempArray(,) As Object = {{"Hello", 1, False}, _
{"Goodbye", 123, True}}

Cheers,
Randy
Miro wrote:
Im trying to store data as I would in some old language.

Old Example
//Create an array that holds 3 different variable types

TempArray := { { "Hello", 1, False }, { "Goodbye", 123, True } }

( basically array 1 is a char, 2 is a number, and 3 is a bool )
So
TempArray[ 1, 1 ] == Hello
TempArray[ 1, 2 ] == 1
TempArray[ 2, 2 ] == 123
How can I set something like this up in Vb.Net 2003 ?

Or Can I ?

I have looked at ArrayList and havnt found an answer there. Im not sure
what to "search" for or what im looking for to declare this.

Thanks in advance,

Miro

Jun 13 '06 #5

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

Similar topics

1
by: Laphan | last post by:
Hi All I know this is my 2nd (and final) cross-post, but which NG should I use for the below. I want to create a game that queries and updates text and numeric stats on a regular basis, so...
1
by: Anthony Martin | last post by:
I've been reading the Java Language Specification, and in Chapter 16 there's an interesting topic called Definite Assignment. http://tinyurl.com/3fqk8 I'm wondering about the idea of "Deferred...
0
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and...
14
by: Medi Montaseri | last post by:
Hi, I think my problem is indeed "how to implement something like java's final in C++" The long version.... I have an abstract base class which is inherited by several concrete classes. I...
0
by: Hans Forbrich | last post by:
Section 1. Ballot: ------------------- 1.YES NO: I agree that there should be a periodic post describing the newsgroup charter and providing a FAQ on newsgroup usage. 2.MONTHLY BI-WEEKLY...
5
by: Jared | last post by:
Hi there I am trying to do the following with no luck: I want to have a form with two select menus. Each menu will obvisouly have different options, each with its own value. Then quite simply,...
48
by: David J Patrick | last post by:
I'm trying to rewrite the CSS used in http://s92415866.onlinehome.us/files/ScreenplayCSSv2.html. using the w3.org paged media standards as described at http://www.w3.org/TR/REC-CSS2/page.html ...
10
by: Bezalel Bareli | last post by:
I know I have seen some threads on the subject long time ago and it was using a virtual base class ... in short, what is the nicest way to implement the Java final class in c++ Thanks.
1
by: Unebrion | last post by:
Alright im working on a program that prints out user imput in a frame, along with a barcode.. it is like the front of an envelope. Here is the description for the program. This...
0
by: Fortis Florin | last post by:
Final CFP: Workshop on Workflow and Process Management (WfPM'08), September 2008, Timisoara, Romania EXTENDED DEADLINES ___________________________________________________________________________­...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.