Отображение полного массива в Liberty BASIC

Прохожу учебник, но не могу понять, как это сделать. Он хочет, чтобы программа отображала все 10 имен, ранее введенных после quit. Я экспериментировал с некоторыми вещами, но не могу понять, как это сделать.

'ARRAYS.BAS
    'List handling with arrays
    dim names$(10)  'set up our array to contain 10 items

[askForName]  'ask for a name
    input "Please give me your name ?"; yourName$
    if yourName$ = "" then print "No name entered." : goto [quit]

    index = 0
[insertLoop]
    'check to see if index points to an unused item in the array
    if names$(index) = "" then names$(index) = yourName$ : goto [nameAdded]
    index = index + 1 'add 1 to index
    if index < 10 then [insertLoop] 'loop back until we have counted to 10

    'There weren't any available slots, inform user
    print "All ten name slots already used!"
    goto [quit]

[nameAdded]  'Notify the name add was successful
    print yourName$; " has been added to the list."
    goto [askForName]

[quit]
    end

person Dylan843    schedule 15.09.2015    source источник


Ответы (1)


Вставьте этот код между [quit] и end:

for I = 0 TO 10
print names$(I)
next I

Это сработает ;)

person Community    schedule 20.10.2015