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

incrementing through variables and text boxes

i think i already know the answer to the first question but it took me
2 months of searching to find it.

i am writing a program that collects user input then stores the data
in arrays then when tehy are done saves to a comma seperated file.
but i am trying to find a more effecient way of populating the array
from the data file.

say i have 3 arrays and 3 data files i would like to :

arraynames() = {firstarray,secondarray,thirdarray}

for a = 0 to 2

arraynames(a)(array possn) = whatever data

next

so i want to incrementaly move through a known list of arrays and
populate them. sorry i am sure my syntax is terrable. right now i
have to make 3 different loops to populate the 3 arrays. sinc i have
to have one for each array i want to populate. this doesn't just have
to do waith arrays but any variable with known names.

i think the answer to this is keep dreaming but on a somewhat related
topic i have created page with multiple textboxes named something
sequentialy. is there a way to send data back to those text boxes
without having to enter all the textbox.text statements for all the
textboxes.

for example

here is a slight representation of the text boxes

c1r1 c2r1 c3r1
c1r2 c2r2 c3r2
c1r3 c2r3 c3r3

then i want to make some kind of nested loop

for a = 1 to 3 step 1

for b = 1 to 3 step 1

("c" & a & "r" & b).text = "bla bla bla"

next b

next a

thanks for any assistance anyone can offer. i am not a great writer
so i hope i explained things well enough. but i can type better in
code than i can in english i think. :-)
Nov 21 '05 #1
3 1338
Charles,

There is nothing wrong with your loop, however did you know that a dataset
is a 3 dimmensional array.

Dataset holds tables which hold rows which hold items. In my idea very
efficient for your problem because it has so many methods you can do almost
everything with that.

Cor

Nov 21 '05 #2
wow thanks. i have been playing with dataset's all morning now. i
always just associated them with databases. i also didn't know that i
could associate the value in a cell to a property of a textbox. i
believe that this will make life easier. it looks like i can stop
using my huge arrays and put my data into a table of a dataset. i
just always think arays since i started (back in the day) with basic
then qbasic and now VB. that will make life easier. i however have
not found an easy way to associate textbox.text with say column 3 row
2 of the dataset. as long as i associate with row 1 (actualy 0 i
think) i can make the connection to any column. but i haven't found
the step for associating with a different row. thanks for all the
help
Nov 21 '05 #3
Charles,

That next step is as well very easy, have a look at databinding and
currencymanger

Private cma As CurrencyManager
cma = Directcast(BindingContext(dataset1.Tables(0)), CurrencyManager)
textbox1.DataBindings.Add(New Binding("Text", dataset1.Tables(0),
"MyField"))

cma.position is the current position

Because the data is set into the dataset after a focus change, do you have
to force that when the focus is on the textbox, because a button change no
focus.

cma.endcurrentedit

(You will probably have that last as question when did not tell it direct)

I hope this helps for those questions?

Cor
wow thanks. i have been playing with dataset's all morning now. i
always just associated them with databases. i also didn't know that i
could associate the value in a cell to a property of a textbox. i
believe that this will make life easier. it looks like i can stop
using my huge arrays and put my data into a table of a dataset. i
just always think arays since i started (back in the day) with basic
then qbasic and now VB. that will make life easier. i however have
not found an easy way to associate textbox.text with say column 3 row
2 of the dataset. as long as i associate with row 1 (actualy 0 i
think) i can make the connection to any column. but i haven't found
the step for associating with a different row. thanks for all the
help

Nov 21 '05 #4

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

Similar topics

10
by: Onideus Mad Hatter | last post by:
Take a look at this: http://www.backwater-productions.net/npindex/index.php Click "Nintento", "A", and then click "Adventures In The Magic Kingdom" o_O Why does it suddenly lose the system...
13
by: Larry L | last post by:
I have a Module that declares several arrays as public, some string, some integers. I then have 2 forms. Form A is the main form, that loads on start-up, and has a command button to open Form B. On...
5
by: jonhanks | last post by:
I'm fairly new to access and VB. I have a form which contains several text boxes and an insert record command button. The button is supposed to insert a new record into the database using the text...
26
by: Bas Wassink | last post by:
Hi there, Does the ANSI standard say anything about incrementing variables past their limits ? When I compile code like this: unsigned char x = 255; x++; printf ( "%d\n", x );
1
by: Glarb Shattenstein | last post by:
I am posting data to one form (integers mostly) with variables dimensioned at the modular level (i.e. mdecTotal as Integer) and have calculations performed on those variables in another form. The...
42
by: Dooglo | last post by:
I'm new VB and programming all together, but I'm getting he hang of it. My question is; I'm writting a program to figure square feet and yards when the user inputs "Length in feet and inch (...
27
by: Erik de Castro Lopo | last post by:
Hi all, The GNU C compiler allows a void pointer to be incremented and the behaviour is equivalent to incrementing a char pointer. Is this legal C99 or is this a GNU C extention? Thanks in...
8
by: mantrid | last post by:
Hello I have the following code, where clicking yh1r is supposed to move h1 10px down and update the value of yh1 by 20 each time its clicked. what the code actually does is NOT move h1 and...
7
by: jwhitby3 | last post by:
Hi all, I am trying to develop what amounts to a data entry page for the company I work for, (mostly to make my job easier). I think that I am beginning to grasp php, but I am at a loss now. I...
0
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$) { } ...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...

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.