cool
So please allow me to be a bit nitpicky:
I am sure you mean "per se", right?My issue is not with line 1 per say
Sorry, I'm into languages and that really hurts
Best
Klaus
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
I am sure you mean "per se", right?My issue is not with line 1 per say
Thanks for thathyltonclarkeBUSH1Ex wrote:I am sure you mean "per se", right?
Code: Select all
on openCardList
put empty into field "task list"
repeat for each key tKey in gTaskList
put gTaskList[tKey]["task title"] & return after field "task list"
end repeat
end openCardList
Code: Select all
put the keys of gTaskArray into gKeysList
# I have renamed your gTaskList as gTaskArray; gKeysList would be a list
delete variable gTaskArray[item gHilitedLine of gKeysList]
delete item gHilitedLine of gKeysList
# Now, if you display the remainder of the array, the order of the elements in the array should be undisturbed.
I thought that I had achieved that with Klaus' code, but unfortunately, after looking carefully at the array in the variable inspector, I see that the keys are being rewritten correctly, but the contents of the elements no longer match the keys, which then makes the display of the elements in the field jumbled up.mwieder wrote:The order of elements in an array isn't deterministic. If you want to display the elements in order you'd have to sort the keys in gTaskList before the repeat loop.
Code: Select all
put the keys of gTaskArray into gKeyList
Code: Select all
# assuming gHilitedLine holds the number of the line clicked by the user (in the list of array keys, i.e., a, b, c, or d)
set the itemDel to return -- you need to do this since comma is the default itemDelimiter
delete variable gTaskArray[item gHilitedLine of gKeyList]
delete item gHilitedLine of gKeyList
Code: Select all
put the keys of myArray into myKeys
sort lines of myKeys numeric
delete myArray[line 1 of myKeys]
Code: Select all
gTaskArray
1
task title 1
task description 1
2
task title 2
task description 2
3
task title 3
task description 3
Code: Select all
delete variable gTaskArray[gHilitedLine]
Code: Select all
gTaskArray
1
task title 1
task description 1
3
task title 3
task description 3
Code: Select all
gTaskArray
1
task title 1
task description 1
2
task title 3
task description 3