We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What command should I use to make my program pause until the user presses a key?
#20
In Small Basic, whether a variable is treated as number or array or string is context dependent.  The operator + works on all data types with precedence left to right.

Consider the following examples.

Code:
TextWindow.WriteLine(1+2)
TextWindow.WriteLine(1+2+"A")
TextWindow.WriteLine("A"+1+2)
TextWindow.WriteLine(Text.Append(1,2)+"A")

In your code I would also initialise SommeDesEcartsALaMoyenne to 0 before it is added to.  SB does assume variables are "" or 0 initially, but good practice to initialise something before you use it.  Also your SD calculation is unusual, usually it would be RootMeanSquare.
[-] The following 1 user Likes litdev's post:
  • Elzaimer
Reply


Messages In This Thread
RE: What command should I use to make my program pause until the user presses a key? - by litdev - 06-30-2024, 11:42 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)