Sub InsertaElto(lista() As String, posic As Integer = 1) For i As Integer = Lbound(lista) To Ubound(lista) If i = posic Then Swap lista(i), lista(Ubound(lista)) Next i End Sub Sub mostrarLista(lista() As String, titulo As String) 'display all elements from list of strings Print !"\n"; titulo; For i As Integer = Lbound(lista) To Ubound(lista) Print lista(i); " "; Next i Print "" End Sub Dim As String arr() 'create a new list of strings Dim As String elto 'items to add to the list Dim As Integer j, c = 0 Restore datos Do Read elto : c += 1 If elto <> "EndOfData" Then Redim Preserve arr(c) : arr(c) = elto Loop Until elto = "EndOfData" Dim As Integer lb = Lbound(arr), ub = Ubound(arr) Dim As String arrTMP(ub) For j = lb To ub : arrTMP(ub-j) = arr(j) Next j For j = lb To ub : Swap arr(j), arrTMP(j) Next j mostrarLista(arr(),"Insertion at Head: ") Erase arr Restore datos c = 0 Do Read elto : c += 1 If elto <> "EndOfData" Then Redim Preserve arr(c) : arr(c) = elto Loop Until elto = "EndOfData" mostrarLista(arr(),"Insertion at Tail:") Erase arr Restore datos c = 0 Do Read elto : c += 1 If elto <> "EndOfData" Then Redim Preserve arr(c) : arr(c) = elto Loop Until elto = "EndOfData" InsertaElto(arr(), 3) mostrarLista(arr(),"Insertion in Middle:") Sleep 'the list of datos that will be added to the list datos: Data "One", "Two", "Three", "Four", "Five", "Six", "EndOfData"