Small Basic interprets a WriteLine with spaces and numericals as the printing of a formula "7 + 9" is printed as 16, ignoring the spaces.
Other non numerical characters (except spaces) force the output to string..
You can use TextWindow.Write(" "+i+" ") and then TextWindow.Writeline(hold[i])
or use Textwindow.WriteLine(Text.Append(" "+i+" ",hold[i]))
Why is output to text screen wrong when using leading spaces
Darrel Wood
21
Reputation points
' Initialize the Array
For i = 1 To 9
hold[i] = i
TextWindow.WriteLine(" "+i+" "+hold[i]) ' spaces and i not printed, hold[ i ]get multiplied by 2.
TextWindow.WriteLine("-"+i+"-"+hold[i]) ' replaced spaces with "-", works as intended.
EndFor
TextWindow.WriteLine("")
'having trouble with leading spaces, please help! 'thanks
Accepted answer
-
WhTurner 1,611 Reputation points
2021-03-05T10:58:08.983+00:00