|
-
Jul 25th, 2004, 04:51 AM
#1
Thread Starter
Frenzied Member
Coding question reg. arrays
I have a usercontrol with 50 equal orderlines and I wish to save the information from these to a file.
I have shown some validation code for the array for orderline 7, how can I write a code for all the lines from 1 to 50 using a for-next? I have defined all the arrays Tal1(), Tal2()...Tal50().
Other wise I have to write the code below for all of the 50 order lines, not smart :-(
Code:
If Tal7(2) <> 40 Then
swFileText.Write(Tal7(0) & ";")
swFileText.Write(Tal7(1) & ";")
swFileText.Write(Tal7(2) & ";")
swFileText.Write(Tal7(3) & ";")
swFileText.Write(Tal7(4) & ";")
swFileText.Write(Tal7(5) & ";")
swFileText.Write(Tal7(6) & ";")
swFileText.Write(Tal7(7) & ";")
swFileText.Write(Tal7(8) & ";")
swFileText.Write(Tal7(9) & ";")
swFileText.Write(Tal7(10) & ";")
swFileText.Write(Tal7(11) & ";")
swFileText.Write(Tal7(12) & ";")
swFileText.Write(Tal7(13) & ";")
End If
-
Jul 26th, 2004, 04:49 AM
#2
Fanatic Member
i don't know what i'm doing mate. hehe. but i think this is it. i'm not sure though
VB Code:
Dim s As String = ""
If Tal7(2) <> 40 Then
Dim i As Integer
For i = 0 To 49
s &= Tal7(i) & ";"
Next
swFileText.Write(s)
End If
hope this helps mate.
-
Jul 26th, 2004, 05:23 AM
#3
Thread Starter
Frenzied Member
Thanks for your reply, the main problem is Tal7() (the array). I wish to make a for next which includes all of the arrays Tal1(), Tal2(), Tal3() ... Tal50(). The code for these should include the shown code for Tal7() replaced with e.g Tal1().
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|