105    ' ********* BASIC version of RatBas program ********** 
 110     DefInt i-n 
 115   ' TEST  Program to test RT Translator
 120   '
 125   DIM Names$(200)
 130   '
 135   Maxnames=200
 140   ' Include File Sort.inc
 145    GO TO 25000 ' jump to program 
 200    '----------------------- PROCEDURE SORT
 205     ' Shell Sort
 210   '  global variables   numnames  number of names to be sorted
 215   '                     names$    names to be sorted
 220      jump.sort=numnames
 225      while jump.sort>0
 230         jump.sort=jump.sort\2
 235         limit.sort=numnames-jump.sort
 240         lower.sort=1
 245         while lower.sort<=limit.sort
 250            ibottom.sort=lower.sort
 255            more.sort=true
 260            while ibottom.sort>0 and more.sort
 265               itop.sort=ibottom.sort+jump.sort
 270               IF NAMES$(IBOTTOM.SORT)>NAMES$(ITOP.SORT)  THEN ELSE GO TO  290
 275                  swap names$(ibottom.sort), names$(itop.sort)
 280                  ibottom.sort=ibottom.sort-jump.sort
 285    GO TO   300
 290    ' ELSE] 
 295                  more.sort=false
 300                ' IFEnd] 
 305            wend
 310            lower.sort=lower.sort+1
 315         wend
 320      wend
 325    RETURN ' ------------------------------------------
 330   '
 400    '----------------------- PROCEDURE GETKEY
 405      for i.getkey=1 to 10: fromuser$=inkey$: next
 410      while fromuser$="": fromuser$=inkey$: wend
 415    RETURN ' ------------------------------------------
 420   '
 500    '----------------------- PROCEDURE  GETSELECTION
 505   cls
 510   print "Menu For Sort Program
 515   print
 520   print "1   Enter a List of Names from Keyboard"
 525   print "2   Display the Names"
 530   print "3   Read a list of Names from a disk file"
 535   print "4   Write the list of Names to a disk file"
 540   print "5   Sort the Names alphabetically"
 545   print "10  End the Program
 550   print
 555   print "Strike Function Key for your choice"
 560   choicemade%=false
 565   while not choicemade%
 570    GOSUB  400 ' GETKEY
 575     IF LEN(FROMUSER$)=2  THEN ELSE GO TO  590
 580        ifunc.get=asc(mid$(fromuser$,2,1))-58
 585    GO TO   600
 590    ' ELSE] 
 595        ifunc.get=0
 600      ' IFEnd] 
 605     choicemade%=ifunc.get=10 or (ifunc.get>=1 and ifunc.get<=5)
 610   wend
 615    RETURN ' ------------------------------------------
 620   '
 700    '----------------------- PROCEDURE ENTERNAMES
 705   cls
 710   locate 25,1
 715   Print "Enter Names.  Use a Null Line to quit";
 720   locate 1,1,1
 725   numnames=0
 730   line input namein$
 735   while namein$<>"" and numnamesnumnames then klast=numnames
 815      cls
 820      for k=j to klast
 825         Print names$(k)
 830      next k
 835      print
 840      print "Press Space Bar to Continue;
 845    GOSUB  400 ' GETKEY
 850   next j
 855    RETURN ' ------------------------------------------
 860   '
 900    '----------------------- PROCEDURE READNAMES
 905   cls
 910   numnames=0
 915   print
 920   Input "Enter Name of File with input ";file$
 925   Open file$ for input as #1
 930   while not eof(1) and numnames