プレイ日記
nate NJR1432
could someone explain the Dim function to me please? i dont understand it...
2そうだね
プレイ済み
返信[1]
親投稿
Nathaniel Rubixcube-solver
The DIM command is used to create an array. an array is simply a set of variables. For example try: DIM A[10] FOR I=0 TO 9 A[I]=RND(100) NEXT SORT A FOR I=0 TO 9 ?A[I] NEXT END This should create a random set of numbers, sort them, and finally display them.
2そうだね
プレイ済み
返信[2]
親投稿
nate NJR1432
thx :)
1そうだね
プレイ済み
返信[3]
親投稿
In SmileBASIC, DIM is the exact same as VAR in every way, in other versions of the BASIC programming language, DIM is how you create an array, so by convention we use DIM only for arrays But it's up to you DIM A$[5] A$[0]="1st item" A$[1]="2nd item" A$[2]="3rd item" A$[3]="4th item" A$[4]="5th item" Then if you ever want to know what you had inside the third array item PRINT A$[2] 'print 3rd Item
0そうだね
プレイ済み