Freedom_Dragon
The 36th Dragon
- Joined
- Oct 11, 2003
- Messages
- 154
- Location
- Behind a door that will never open.
- Gender
- Undisclosed
- HSC
- N/A
Using the example [C][O][M][P][T][E][R].Seraph said:now if i wanted to extract COMP
Start - 1 is out of the array.....
Now u wanted to extract [C][O][M][P].
U dont need "Start-1".
U know that ur "Start" is [C] which is the first "1" element of the string.
U know that ur "Finish" is [P] which is the fourth "4" element of the string.
Simply apply:
Function Extract (Xstring, Start, Finish)
Index=1
FOR Position=Start TO Finish //Start is "1" & Finish is "4" of the extract
Newstring(Index)=Xstring(Position)
Index=Index+1 //Increments index of Newstring
ENDFOR
Newstring=Extract
END Extract
U can extract anything, anywhere.
The time when u would use "Start-1" is when the deletion occur is greater than the first element.
If u wanted to delete [C][O][M][P] from [C][O][M][P][T][E][R]
I guess u would jus perform an extract instead.
Start=5
Finish=8