Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sport Placings

Status
Not open for further replies.

Verada

Technical User
Joined
Aug 5, 2002
Messages
1
Location
AU
Does anyone have a 123 Macro to allocate placings to a list of times, as in sport records, including dead heats allowances. Some years ago I developed a short BASIC routine, but have lost it and the old brain can't recall how I did it.
eg
Time Place
15 4
17 6
10 1
13 2
13 2
16 5
Of course the time is usually HH:MM:SS
 
why not do a range sort on the times then the places are in order? I've been using UK football league tables as an excuse to learn a bit of 123 Lotusscript programming. The league tables are sorted (at least in my version) on points, goal difference, goals scored and on team name. The code below shows a fragment of lotusscript for sorting 1 of the 3 divisions. Equally, as a novice, I'd welcome any suggestions for improvements.

[Window 1].Activate
'
' Division 1 table
'
[D:A4..D:K27].Select
[<<C:\lotus\work\123\Footy\Footy_working.123>>].SortResetKeys
'
' Sort keys are numbered 0, 1, 2 etc.
' Sort key 0 is points, key 1 is goal difference, key 2 is goals for, key 3 is team name
'
[<<C:\lotus\work\123\Footy\Footy_working.123>>].RangeSortDefineKey 0,[D:K4..D:K27],$Descend
[<<C:\lotus\work\123\Footy\Footy_working.123>>].RangeSortDefineKey 1,[D:J4..D:J27],$Descend
[<<C:\lotus\work\123\Footy\Footy_working.123>>].RangeSortDefineKey 2,[D:H4..D:H27],$Descend
[<<C:\lotus\work\123\Footy\Footy_working.123>>].RangeSortDefineKey 3,[D:A4..D:A27],$Ascend
Selection.Sort
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top