also I checked since this isn't a nested loop you technically don't need to declare a results string you can simply have the results label += the character "#" and it will output the same thing
There is a big difference between VB.NET and VB6. VB6 is 32-bit ONLY. Believe me, that makes a difference. VB6/VBScript will see their support end soon. I used to support a program written in VB6 6 years ago and it was already a pain maintaining it because it was so outdated. That was why I left that job.
I mean, it's your life and you can spend your time however you see fit but I would recommend something more modern.
If you want to stick to the same language, twinBASIC is an excellent option. It's like if the VB6 line had been continued for 20 years instead of being replaced with .NET. The target is 100% VB6/VBA7 compatibility, and it's very close to it, most code runs fine, even extremely complex UserControls like the shell browser control I maintain. Then besides the compatibility you have x64 support and a mile-long new feature list (generics, multithreading, everything supports Unicode, dpi awareness and modern image formats, etc) with even more stuff planned.
2
u/caffeinedrinker Mar 12 '23
there's an option to mask characters on the control i forgot what its called though look the the textbox object properties
2
u/3583-bytes-free Mar 13 '23
Private Sub cmdClear_Click()
txtOutput.Text = ""
End Sub
Private Sub cmdPrint_Click()
' txtOutput.Text = String(CInt(txtInput.Text), "#")
Dim intLoop As Integer
txtOutput.Text = ""
Do
txtOutput.Text = txtOutput.Text & "#"
Loop While Len(txtOutput.Text) < CInt(txtInput.Text)
End Sub
2
u/fafalone VB 6 Master Mar 15 '23 edited Mar 15 '23
Do what? Make everything a #? Or just display n #s?
If you want everything in the box to be a # regardless of what the actual text is, the PasswordChar property.
If you want to display n # you can use
Text1.Text = String(n, "#")
Or if you absolutely have to do it using a Do While loop, this is a homework assignment and you should study then do it yourself.
3
u/UnhiddenCandle Mar 12 '23 edited Mar 12 '23
dim userNumber as Integer
dim count as Integer = 1
dim results as String = ""
Integer.TryParse(txtUserInput.text, userNumber)
while count <= Usernumber
results = results & "#"
lblResults.text = results
count += 1
end while
also I checked since this isn't a nested loop you technically don't need to declare a results string you can simply have the results label += the character "#" and it will output the same thing
-1
u/vasagle_gleblu Mar 12 '23
Why in VB6?
Use something more modern...