All Devdex   All VBdex   Current Category
Try DevelopersDex Online Training

VBdex > Forums & Newsgroups > Newsgroups > microsoft.public.vb.general.discussion Add this category to My Favorites

View Message Thread  (12 replies)

An Array Question Add this thread to My Favorites
From: Jaded
Date Posted: 11/23/2001 7:29:00 AM

How can you change the index of a multi lined array? For instance if
I wanted to change the third line of the index below to True.


Public Sub Inventory()

    strName(0) = "Honda"
    strType(0) = "Car"
    blnOut(0) = False

    strName(1) = "Ford"
    strType(1) = "Car"
    blnOut(1) = False

Re:An Array Question
From: Phil Young
Date Posted: 11/23/2001 8:09:00 AM

Not really sure what you're asking here.
If you want it to be true, then just set it to true
i.e.
blnOut(0) = True

If I've missed the point totally (which I think I have) then you'll have
to reply with a bit more information about what you're wanting.

Phil

-----Original Message-----
From: Jaded [mailto:auto22453@hushmail.com]
Posted At: Friday, November 23, 2001 14:28
Posted To: discussion
Conversation: An Array Question
Subject: An Array Question


How can you change the index of a multi lined array? For instance if
I wanted to change the third line of the index below to True.


Public Sub Inventory()

    strName(0) = "Honda"
    strType(0) = "Car"
    blnOut(0) = False

    strName(1) = "Ford"
    strType(1) = "Car"
    blnOut(1) = False

Re: An Array Question
From: Jaded
Date Posted: 11/23/2001 9:05:00 AM

Here's some more information to explain what I need.

The boolean defaults to false. When an item is moved from inventory I
want to change the boolean to true. I need the syntax for changing
the specific index (i.e. (0), (1), etc..) to true.

Inventory(Index) = True

This doesn't work. I need to be able to change the third line of a
specific index to a true value.


On Fri, 23 Nov 2001 14:58:03 -0000, Phil Young <Phil.Young@lfs.co.uk>
wrote:

>Not really sure what you're asking here.
>If you want it to be true, then just set it to true
>i.e.
>blnOut(0) = True
>
>If I've missed the point totally (which I think I have) then you'll have
>to reply with a bit more information about what you're wanting.
>
>Phil
>
>-----Original Message-----
>From: Jaded [mailto:auto22453@hushmail.com]
>Posted At: Friday, November 23, 2001 14:28
>Posted To: discussion
>Conversation: An Array Question
>Subject: An Array Question
>
>
>How can you change the index of a multi lined array? For instance if
>I wanted to change the third line of the index below to True.
>
>
>Public Sub Inventory()
>
>    strName(0) = "Honda"
>    strType(0) = "Car"
>    blnOut(0) = False
>
>    strName(1) = "Ford"
>    strType(1) = "Car"
>    blnOut(1) = False

Re: An Array Question
From: Larry Serflaten
Date Posted: 11/23/2001 10:38:00 AM

"Jaded" <auto22453@hushmail.com> wrote
> Here's some more information to explain what I need.
>
> Inventory(Index) = True
>
> This doesn't work.

Yes, that does work. That is exactly how to set one member
of an array to True. It is up to you to make sure that Index points
to the member you want to change....

LFS


Re: An Array Question
From: Jaded
Date Posted: 11/23/2001 11:41:00 AM

Which is the reason for the thread.

On Fri, 23 Nov 2001 11:44:07 -0600, "Larry Serflaten"
<serflaten@usinternet.com> wrote:

>It is up to you to make sure that Index points
>to the member you want to change....

Re: An Array Question
From: Larry Serflaten
Date Posted: 11/23/2001 12:45:00 PM

Jaded" <auto22453@hushmail.com> wrote
> Which is the reason for the thread.
>
> On Fri, 23 Nov 2001 11:44:07 -0600, "Larry Serflaten"
> <serflaten@usinternet.com> wrote:
>
> >It is up to you to make sure that Index points
> >to the member you want to change....

OK, use this:

Index = 3

If that doesn't answer your question, then you need to better define
the problem. You have provided very little to go on:

<quote>
How can you change the index of a multi lined array? For instance if
I wanted to change the third line of the index below to True.


Public Sub Inventory()

    strName(0) = "Honda"
    strType(0) = "Car"
    blnOut(0) = False

    strName(1) = "Ford"
    strType(1) = "Car"
    blnOut(1) = False

</quote>

Some might ask, what is a multi lined array? Where is it defined?
Then, the third line was: blnOut(0) = False, so it appears that you
have False where you are asking what to use to assign a value of True...

The obvious answer is to change the word False to True.

The problem is, as if you haven't noticed, nobody understands what
you are asking. How about you clarify it a little bit, or else you may find
that nobody can answer your question.

Bext lomupt?
LFS






Re: An Array Question
From: Chris Judge
Date Posted: 11/23/2001 1:49:00 PM

Larry Serflaten wrote:

> <snip>
> The problem is, as if you haven't noticed, nobody understands what
> you are asking. How about you clarify it a little bit, or else you may find
> that nobody can answer your question.

You hit the nail on the head.

<rant>

In my experience, this is one of the most difficult ideas to convey to new
programmers. They think they are describing a problem clearly when, in fact,
there are many interpretations of what they're asking. Tools like VB are to
programming what power tools are to construction - with power tools, I can cut
straight lines, join together pieces of wood, etc., but I, personally, still
can't build a house because tools are not a replacement for knowledge.

The most important thing for a newbie to remember is that a computer is
completely dumb. The intelligence comes from the programmer. So to be a good
programmer, one must be able to analyze a problem AND clearly convey one's
understanding of the problem. If one can't convey that understanding to another
human being, how can one tell a computer how to do what needs to be done?

</rant>

chris judge
chris@formfill.com

Re: An Array Question
From: Jaded
Date Posted: 11/23/2001 2:21:00 PM

FWIW I found the problem. My descriptions in this thread are, in
hindsight, nonsensical. My bad. Thanks to those who tried to help a
newbie.

For those that ranted...please come down off the cross. You might
like the view :-)

Re: An Array Question
From: Rick Rothstein
Date Posted: 11/23/2001 6:45:00 PM

First off, the expression I think you were looking for is "...come down from you high
horse..." In any event, I think the "ranters" can remain there if they want. You must
understand that those of us who answer questions on this, and other, newsgroups do so
voluntarily (i.e., it's not our job and no one pays us to do so). However, we do want to
help.

When an ill-formed question is posted, we try to figure out what the poster might have
wanted to ask and proceed from there. This effort takes time -- and that time is usually
at the expense of someone else's question (which may be properly phrased, but time
constraints force it to go unanswered). For example, I recently posted two attempted
answers to a question, as did two or three others, for what the poster later told us was
an Access97 VBA system. That information up front would have saved considerable time.

So, your "...in hindsight, nonsensical..." post did have a cost associated with it; in an
effort to try and answer it, someone else's question may still be sitting there
unanswered. Now I don't think you are the kind of person to be so selfish as to say "who
cares"; so I will ask, as did the "ranters", please think about what you are trying to
ask, re-read your post before sending it to see if you are actually asking what you
intended and see if you have provided us with enough information about you system
configuration for us to know how to answer you.

Rick


"Jaded" <auto22453@hushmail.com> wrote in message
news:9oetvto9sbsgn4c12havugpsa7ol5glbar@4ax.com...
> FWIW I found the problem. My descriptions in this thread are, in
> hindsight, nonsensical. My bad. Thanks to those who tried to help a
> newbie.
>
> For those that ranted...please come down off the cross. You might
> like the view :-)
>
>

Re: An Array Question
From: Randy Birch
Date Posted: 11/23/2001 9:57:00 PM

BTW, you're going to end up with horrid and hard to track code if you
continue using three separate arrays for the data. How about using a
User-Defined Type instead ...

Private Type CarData
   ModelName as string
   ModelType as string
   InStock as Boolean
End Type

Dim Car(1 to 100) as CarData

... then you can reference the cars using syntax such as:

   Car(0).ModelName = "Honda"
   Car(0).ModelType = "Car"
   Car(0).InStock = False

   Car(1).ModelName = "Ford"
   Car(1).ModelType = "Car"
   Car(1).InStock = True

--

Randy Birch
MVP Visual Basic

http://www.mvps.org/vbnet/

Please respond only to the newsgroups so all can benefit.



"Jaded" <auto22453@hushmail.com> wrote in message
news:9oetvto9sbsgn4c12havugpsa7ol5glbar@4ax.com...
> FWIW I found the problem. My descriptions in this thread are, in
> hindsight, nonsensical. My bad. Thanks to those who tried to help a
> newbie.
>
> For those that ranted...please come down off the cross. You might
> like the view :-)
>
>

Re: An Array Question
From: T. Koster
Date Posted: 11/24/2001 11:24:00 PM

Here here.

Re:An Array Question
From: Phil Young
Date Posted: 11/26/2001 2:16:00 AM

Any chance you could let us know what the problem was and how you solved
it?
I've read all the posts from over the weekend, and I still don't know
what you where after!

Phil

-----Original Message-----
From: Jaded [mailto:auto22453@hushmail.com]
Posted At: Friday, November 23, 2001 21:21
Posted To: discussion
Conversation: An Array Question
Subject: Re: An Array Question


FWIW I found the problem. My descriptions in this thread are, in
hindsight, nonsensical. My bad. Thanks to those who tried to help a
newbie.

For those that ranted...please come down off the cross. You might
like the view :-)

Re: An Array Question
From: Chris Judge
Date Posted: 11/26/2001 10:10:00 PM

Jaded:

By ranting, I AM trying to help you. You must learn communication skills
in order to be an effective programmer. If/when you learn that, you will
find that people are much better able to help you with specific problems.

chris judge

Jaded wrote:

> FWIW I found the problem. My descriptions in this thread are, in
> hindsight, nonsensical. My bad. Thanks to those who tried to help a
> newbie.
>
> For those that ranted...please come down off the cross. You might
> like the view :-)

 

Would you like to track this thread?

By adding this News Thread to your Favorites Area you can refer to it later with just a click of the mouse. Also you can optionally be notified instantly whenever there are any replies posted to this Thread. To add this Thread to your Favorites Area just click on the red arrow next to the subject of the thread above Add this thread to My Favorites.


ASP ArticlesThis category has been added to your weekly newsletter
ASP Web Sites
ADSI & WSH BooksThis category has been added to your weekly newsletter
FREE ComponentsThis category has been added to your weekly newsletter
ASP EventsThis category has been added to your weekly newsletter
ASP HeadlinesThis category has been added to your weekly newsletter

CSharp ArticlesThis category has been added to your weekly newsletter
C# Web SitesThis category has been added to your weekly newsletter

SQL ArticlesThis category has been added to your weekly newsletter
SQL Events
SQL HeadlinesThis category has been added to your weekly newsletter
SQL Jobs

Jobs in CaliforniaThis category has been added to your weekly newsletter

XML ArticlesThis category has been added to your weekly newsletter
XML BooksThis category has been added to your weekly newsletter
XML Web Sites
XML Tutorials

free asp host

"Alex Homer"This search has been added to your weekly newsletter

Edit My Favorites Edit Profile

XML Premier Partners
Code Project
DevGuru
Programmers Heaven
Tek-Tips Forums
TopXML
VisualBuilder.com
W3Schools
XMLPitstop
ZVON
Search us!

 

 




Copyright © 2000, 2001 Developersdex™. All rights reserved.