Array tutorials
-
Thursday, November 01, 2012 9:28 AM
Hi I have been using Small Basic for a while now and love the ease with which I picked it up with no programing background.
Lots of the commands return info as an array is there any tutorials on how to use these arrays that are returned most of the time I am doing text functions on them to get the info I need and wanted to know if there was a better way and if the values can be fed into other commands.
Thanks
Chris
All Replies
-
Thursday, November 01, 2012 12:55 PMAnswerer
Sorry, I do not know of any tutorials. Here are some pointers though: - Explore the Array class and see what you can find - Array can hold many values in one variable.. for example: variable[0] = 2 variable[1] = 5 vairable[2] = 3.1415926535 Or even variable[0][1] = 86 Or even this variable["blah"] = "blah" variable["blah"]["blahblah"] = "blah" And with returns: variable = MethodName() TextWindow.WriteLine(variable[0]) ... If you need some more pointers or specific help, just ask here!Please mark any answers and "vote as helpful" any posts that help you!
- Proposed As Answer by litdevMicrosoft Community Contributor, Moderator Thursday, November 01, 2012 4:27 PM
- Marked As Answer by Chris Swankie Thursday, November 01, 2012 4:30 PM
-
Thursday, November 01, 2012 12:59 PMAnswererSorry, the formatting came out poorly on that last post. Please just add a new line in back of every line of code so it will look OK. Oh, the woes of using a mobile device with no code block menu, etc :-(
Please mark any answers and "vote as helpful" any posts that help you!
-
Thursday, November 01, 2012 1:02 PMAnswerer
This is a sample code.
path = Program.Directory ' gets the executing program's directory path arry = File.GetFiles(path) ' this command returns array count = Array.GetItemCount(arry) ' gets entry count in the array For n = 1 To count TextWindow.WriteLine(arry[n]) ' print nth entry EndFor
Nonki Takahashi
- Proposed As Answer by litdevMicrosoft Community Contributor, Moderator Thursday, November 01, 2012 4:27 PM
- Marked As Answer by Chris Swankie Thursday, November 01, 2012 4:30 PM
-
Thursday, November 01, 2012 1:10 PMThanks this is just what I was looking for

