Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
request for printing patterns with for loops tutorial
#16
(11-20-2024, 03:21 PM)SMcNeill Wrote: Aren't you guys making this all too complicated for such a simple task and question?

Code: (Select All)
For i = 0 To 20
    Print Space$(40 - i); String$(i * 2 + 1, "*")
Next

Three simple lines of code.  That's all you need.  Nothing fancy.  Nothing complex.  Just a FOR statement, a PRINT statement, and a NEXT.

I get this and can back engineer it for the most part to figure out what's going on.  So I notice if I place anything greater than a single character in place of the asterik, the String$ command seems to only print out the very first character.  For example if I entered "Car" in place of "*", then it would just print out the C character every time, instead of the word Car.  Am I correct on that?
Reply


Messages In This Thread
RE: request for printing patterns with for loops tutorial - by fistfullofnails - 12-27-2024, 12:03 AM



Users browsing this thread: 4 Guest(s)