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
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi, I have a big problem with Arrays in Small Basic program
Cause when I have get value from the Array, action is return empty value. Below is the code (For the sake of the question, I simplified the code)
my_array = "1=firstvalue;2=secondvalue;"
TextWindow.Write("1: ")
TextWindow.WriteLine(Array.Getvalue(my_array, 1))
TextWindow.Write("2: ")
TextWindow.WriteLine(Array.Getvalue(my_array, 2))
When I run the program, I get this result:
Any ideas why this program isn't working?
Hi Simon,
there is no array method "GetValue", but a similar one with "ContainsValue".
The output and further processing takes place simply with the index 1 or [2] ... or depending on the definition.
my_array = "1=firstvalue;2=secondvalue;"
TextWindow.WriteLine("1: " + my_array[1])
TextWindow.WriteLine("2: " + my_array[2])
TextWindow.WriteLine("ContainsValue 'secondvalue': " + Array.ContainsValue(my_array, "secondvalue"))