Hi all,
I have a customer that is asking for a recipe of 200 recipes to be sorted. I'm trying to do this by way of a bubble sort.
Basically my code looks like this but pay no attention to the syntax. I will sort that out, no pun intended.
For a = 0 to 199 -1
If recipe[a]+1 <> "" then
For nSort = 0 to 199 -1
If recipe[nSort] > recipe[nSort]+1 then
Copy ( recipe[nSort], recipeTemp)
Copy ( recipe[nSort]+1, recicpe[nSort])
Copy (recipeTemp, recipe[nSort])
End_If;
End_If;
End_For;
End_For;
Much of the recipe array has empty data, (i.e. "" ) for the recipe name so I need to handle the null data as well.
I looked in the data base but can't find much information for ST programming on Sorting.
I would appreciate any ST examples that anyone has.
Thank you.
I have a customer that is asking for a recipe of 200 recipes to be sorted. I'm trying to do this by way of a bubble sort.
Basically my code looks like this but pay no attention to the syntax. I will sort that out, no pun intended.
For a = 0 to 199 -1
If recipe[a]+1 <> "" then
For nSort = 0 to 199 -1
If recipe[nSort] > recipe[nSort]+1 then
Copy ( recipe[nSort], recipeTemp)
Copy ( recipe[nSort]+1, recicpe[nSort])
Copy (recipeTemp, recipe[nSort])
End_If;
End_If;
End_For;
End_For;
Much of the recipe array has empty data, (i.e. "" ) for the recipe name so I need to handle the null data as well.
I looked in the data base but can't find much information for ST programming on Sorting.
I would appreciate any ST examples that anyone has.
Thank you.