// First extract only the numbers.
whileprintingrecords;
stringvar v_newcar := "";
numbervar v_counter := 1;
while isnumeric({Sheet1_.Values}[v_counter]) or {Sheet1_.Values}[v_counter] = "-"
do
(if isnumeric({Sheet1_.Values}[v_counter])
then
v_newcar := v_newcar + {Sheet1_.Values}[v_counter]
else v_newcar;
v_counter := v_counter + 1);
//////////////////////////////////////////////
// Next create an array and split the numbers into two digit values.
stringvar array v_array := [left(v_newcar,2),""];
numbervar v_counter2 := 3;
while v_counter2 <= len(v_newcar)
do
(v_array[v_counter2 - 1] := mid(v_newcar,v_counter2,v_counter2 + 1);
redim preserve v_array[ubound(v_array) + 1];
v_counter2 := v_counter2 + 2);
/////////////////////////////////////////////////
// Convert the years to four digits.
numbervar v_anothercounter := 1;
while v_anothercounter < ubound(v_array)
do
(if left(v_array[v_anothercounter],1) in ["0","1","2","3","4"] then v_array[v_anothercounter] := "20" + v_array[v_anothercounter]
else v_array[v_anothercounter] := "19" + v_array[v_anothercounter];
v_anothercounter := v_anothercounter + 1);
/////////////////////////////////////////////////
// Last create another array and populate it with the min, max, and all values in between.
numbervar v_min := tonumber(v_array[1]);
numbervar v_max := tonumber(v_array[ubound(v_array) - 1]);
stringvar array v_display := [totext(v_min,0)];
numbervar v_counter3 := 2;
numbervar v_counter4 := v_min;
while v_counter4 < v_max
do
(redim preserve v_display[v_counter3];
v_display[v_counter3] := totext(v_counter4 + 1,0);
v_counter3 := v_counter3 + 1;
v_counter4 := v_counter4 + 1);
numbervar v_loop :=1;
while v_loop <= ubound(v_display)
do
(v_display[v_loop] := right(v_display[v_loop],2);
v_loop := v_loop + 1);
if ubound(v_display) = 2 then v_display[1]
else
join(v_display," ");