Hello everybody!
I want to read a non sorted list from an Excel file, sort it in B4J and create a sorted text/doc output.
My thoughs are:
1) I will use the JPOI library to read the Excel file using a For Loop cycle
2) Sort in B4J the results
3) Print out a doc or txt file.
I already did this in python and there it very easy, you need to just create a collection and sort it using the item you want (example: the name or the points).
Here come my questions (I am reading the booklet B4X Basic Language):
1) Is it correct to use Maps for a ranking list? Considering that the name of runners are unique (like: Omar Simpson)
2) I will use a For Loop cycle to "scroll" the Map position and collect data like:
and
where RACER is name and surname and POINTS are the points,
at the end I will have a Map like
Luca,5
Michele,7
Marco,1
...
for this point my question is can I order the list using the POINTS item? So I can display a ranking list on the monitor and after print it in a doc file?
3) the Map index start from 0 (zero)?
In my example the "Key" Luca will be in index 0?
Thank you
Massimiliano
I want to read a non sorted list from an Excel file, sort it in B4J and create a sorted text/doc output.
My thoughs are:
1) I will use the JPOI library to read the Excel file using a For Loop cycle
2) Sort in B4J the results
3) Print out a doc or txt file.
I already did this in python and there it very easy, you need to just create a collection and sort it using the item you want (example: the name or the points).
Here come my questions (I am reading the booklet B4X Basic Language):
1) Is it correct to use Maps for a ranking list? Considering that the name of runners are unique (like: Omar Simpson)
2) I will use a For Loop cycle to "scroll" the Map position and collect data like:
B4X:
Private RANK As Map
RANK.Initialize
B4X:
RANK.Put(RACER,POINTS)
where RACER is name and surname and POINTS are the points,
at the end I will have a Map like
Luca,5
Michele,7
Marco,1
...
for this point my question is can I order the list using the POINTS item? So I can display a ranking list on the monitor and after print it in a doc file?
3) the Map index start from 0 (zero)?
In my example the "Key" Luca will be in index 0?
Thank you
Massimiliano