Shop OBEX P1 Docs P2 Docs Learn Events
vb6 question — Parallax Forums

vb6 question

ArchiverArchiver Posts: 46,084
edited 2004-02-25 19:13 in General Discussion
For one of my stamp projects I am trying to list some numbers in a text box
using a for loop similar to this:

dim i as integer

for i to 10

text1.text = i & vbcrlf

next i

however I only get the text box to display 10 instead of:

1
2
3
4
5
6
7
8
9
10

I want it to do this. how do you get a listing of the numbers like you would
with C++ ?

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-02-25 19:13
    Try For i = 1 to 10 instead of for i to 10 ( details, details [noparse]:)[/noparse]

    It is also better "style" and more efficient to write
    text1.text = str$(i) & vbcrlf


    At 10:21 AM 2/25/2004 -0800, you wrote:
    >For one of my stamp projects I am trying to list some numbers in a text box
    >using a for loop similar to this:
    >
    >dim i as integer
    >
    >for i to 10
    >
    >text1.text = i & vbcrlf
    >
    >next i
    >
    >however I only get the text box to display 10 instead of:
    >
    >1
    >2
    >3
    >4
    >5
    >6
    >7
    >8
    >9
    >10
    >
    >I want it to do this. how do you get a listing of the numbers like you would
    >with C++ ?
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and
    >Body of the message will be ignored.
    >
    >Yahoo! Groups Links
    >
    >
    >
    >
Sign In or Register to comment.