Home > Software engineering >  VB small white, the great god.
VB small white, the great god.

Time:11-16

Private Sub Command1_Click ()
Text1. Text=""
Dim S As Long, As Long I
Dim (A)
Do
ReDim Preserve A (S)
A (S)=InputBox (" please enter the characters ", "input")
S=S + 1
Loop Until A (1 S)=""
For I=0 To 2
S -Text1. Text=Text1. Text & amp; "The first" & amp; CStr (I + 1) & amp; "One is" & amp; CStr (A) (I) & amp; "
"Next I
Erase A
End Sub

The initial value of S is "0"? Only input the data, then the array A (S) is A (0), after the For I=0 To S - 2 words For how I=0 To 1-2 of the output?
Consult!

CodePudding user response:

The initial value is 0? Yes,
Cycle to empty input end (5 such as input data, the program run effect is 6 inputbox, upload 5, in the sixth inputbox directly enter), so it S=data volume + 1, Ubound (A)=S, A (1 S)="", finally A data stored in A (2) the S -

CodePudding user response:

Only an input data, the S value is 0 is? To run a few times for here? I=0 to 0 to 2

CodePudding user response:

Ubound (A)=S - 1, hand,
If there is only 1 article data, S=2, A (0)=data, A (1)=", "
Circulation is the scope For I=0 To 2-2

CodePudding user response:

Sorry, S=2 is how to

CodePudding user response:

S=S + 1 actually run for 2 times, have been given at the end of the value is 2, is it

CodePudding user response:

Program running, bring up a inputbox, input the first number, this time S=1, this is the first cycle;
Popup A inputbox and then enter the second cycle (for A (1 S) is not ", "didn't trigger the exit circulation conditions), in the second inputbox directly enter, nothing to lose (A (1 S)=" "when will withdraw from circulation, this is the end tag), S=2,

CodePudding user response:

F X
reference - I - n reply:
program run, bring up a inputbox, input the first number, this time S=1, this is the first cycle;
Popup A inputbox and then enter the second cycle (for A (1 S) is not ", "didn't trigger the exit circulation conditions), in the second inputbox directly enter, nothing to lose (A (1 S)=" "when will withdraw from circulation, this is the end tag), S=2,
thank you
  • Related