Hi all,
I've played a lot with your script by testing differents options and targets.
I've understand now how loops works. I think.
Sorry jaque, I think your right, I will keep your script for later. Too much for me... for now.
I would want to go ahead now by managing tha datas and dispatching them to separate targets.
I've created a Datagrid with 2 columns (colProd an colTir) that I populate by 2 text fields (addProd and addTir) with this button script :
Code: Select all
on mouseUp
put field addProd into Prod
put field addTir into Tir
put Prod into theDataA["ColProd"]
put Tir into theDataA["ColTir"]
put 1 into theLineNo
dispatch "AddData" to group "listProd" with theDataA, theLineNo
end mouseUp
Now I want to sort this data grid by dispaching them with the equality or common divisor script.
The goal is to add the sorted value and/or the product name in a particular object (text field or datagrid) for each equality , for exemple.
I can't find how to apply the script to column items (sorting) and then return another content of the line.
colProd,colTir
p1,2000
p2,2000
p3,3000
p4,4000
result :
group 2000 : p1,p2
group 3000 : p3
group 4000 : p4
I've tried this but I think it's not the good way :
Code: Select all
on mouseUp
put the dgText of group "listProd" into quantTir
repeat with y=1 to the number of lines of quantTir
delete word 1to 2 of line y of quantTir
end repeat
sort quantTir numeric
repeat with z = 1 to the number of lines of quantTir
if line z of quantTir = line z+1 of quantTir then put z & cr & z+1 & cr into field qt1
end repeat
end mouseUp
Could you help me with this problem ?