"\n" for small basic

Coder 1 Reputation point
2022-07-29T08:21:08.05+00:00

You know how in like c# and other codes in strings you have "Hi!\nIm new" where \n goes to the next line
I was Wondering if there is something similar on small basic?

Thanks,
Coder

;)

Small BASIC
Small BASIC
A programming language created by Microsoft that serves a stepping stone for beginners from block-based coding languages to more complex text-based languages.
277 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. WhTurner 1,611 Reputation points
    2022-07-29T12:34:22.103+00:00

    You can use"
    CRLF=Text.GetCharacter(13)+Text.GetCharacter(10) ''Carriage return Line feed
    TextWindow.WriteLine("Hi"+CRLF+"I'm new")

    Or you can use
    TextWindow.WriteLine("Hi")
    TextWindow.WriteLine("(I'm new")

    0 comments No comments

  2. Small Visual Basic 406 Reputation points
    2022-09-17T10:38:26.717+00:00

    In Small visual Basic, you can use Text.NewLine Or Chars.CrLf to represent the new line.
    You can also use the Text.Format to easily concatenate strings, such as:

       TextBox1.Text = Text.Format(  
          "line1[1]line2[1]line3",  
          Chars.CrLf  
       )  
    

    Where [1] will be replaced with Chars.CrLf. The reason of using the indexer [1], is that you can use an array of values, such as:

       TextBox1.Text = Text.Format(  
          "Name: [2].[1]Age: [3].",  
          {Chars.CrLf, "Adam", 15}  
       )  
    

    Also, you can use TextBox1.AppendLine directly:

       TextBox1.AppendLine ("Name: Adam.")  
       TextBox1.AppendLine ("Age: 15.")  
    
    0 comments No comments