kinda new to skripting, so i suck
anyways im trying to make a least to greatest sorting algorithm
why is {_t1} or {_t2} <none>
anyways im trying to make a least to greatest sorting algorithm
Code:
function least2greatest(list: objects) :: objects: #list has entries modeled like %number%.%text%
set {_i} to 0
loop size of {_list::*} times:
add 1 to {_i}
set {_j} to {_i}
loop size of {_list::*} times:
add 1 to {_j}
if {_j} is less than size of {_list::*} + 1:
set {_one} to 1
set {_tt1::*} to {_list::%{_i}%} split at "."
set {_t1} to {tt1::%{_one}%} parsed as an integer
set {_tt2::*} to {_list::%{_j}%} split at "."
set {_t2} to {tt2::%{_one}%} parsed as an integer
broadcast "%{_tt1::*}%, %{_tt2::*}%" #each of them show up as "%number% and %text%", so it works
broadcast "%{_list::%{_i}%}%,%{_list::%{_j}%}%" #each of them show up as "%number%.%text%" so it works
broadcast "%{_t1}%,%{_t2}%" # both show up as <none>
if {_t1} is greater than {_t2}:
set {_temp} to {_list::%{_i}%}
set {_list::%{_i}%} to {_list::%{_j}%}
set {_list::%{_j}%} to {_temp}
else:
stop
broadcast "%{_list::*}%"
why is {_t1} or {_t2} <none>