Und wenn ich versuche sie in Zellen eines OO Calc Documents eintragen zu lassen gibt es mir den wert "4" aus.
Schonmal danke im vorraus
Code: Alles auswählen
Sub Bestenliste
Dim Entry(1 To 10) As String
Dim Count As Integer
Dim Count2 As Integer
Dim Temp As String
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("Dackel")
Dim Dackel as Object
Dackel = oSheet.getCellByposition(27, 21)
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("Tetzi")
Dim Tetzi as Object
Tetzi = oSheet.getCellByposition(27, 21)
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("Kuba")
Dim Kuba as Object
Kuba = oSheet.getCellByposition(27, 21)
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("Marion")
Dim Marion as Object
Marion = oSheet.getCellByposition(27, 21)
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("Niggo")
Dim Niggo as Object
Niggo = oSheet.getCellByposition(27, 21)
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("Paddy")
Dim Paddy as Object
Paddy = oSheet.getCellByposition(27, 21)
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("Thomas")
Dim Thomas as Object
Thomas = oSheet.getCellByposition(27, 21)
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("Simon")
Dim Simon as Object
Simon = oSheet.getCellByposition(27, 21)
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("Flo")
Dim Flo as Object
Flo = oSheet.getCellByposition(27, 21)
oSheets = ThisComponent.Sheets
oSheet = oSheets.getByName("David")
Dim David as Object
David = oSheet.getCellByposition(27, 21)
Entry(1) = Dackel.value 'Beispiel aus dem StarBasic
Entry(2) = David.value ' FAQ
Entry(3) = Flo.value
Entry(4) = Simon.value
Entry(5) = Thomas.value
Entry(6) = Paddy.value
Entry(7) = Niggo.value
Entry(8) = Marion.value
Entry(9) = Kuba.value
Entry(10) = Tetzi.value
For Count = 1 To 10
For Count2 = Count + 1 To 10
If Entry(Count) > Entry(Count2) Then
Temp = Entry(Count)
Entry(Count) = Entry(Count2)
Entry(Count2) = Temp
End If
Next Count2
Next Count
For Count = 1 To 10
oSheet = oSheets.getByName("Bestenliste")
erster = oSheet.getCellByposition(2, 1)
zweiter = oSheet.getCellByposition(2, 2)
dritter = oSheet.getCellByposition(2, 3)
vierter = oSheet.getCellByposition(2, 4)
fuenfter = oSheet.getCellByposition(2, 5)
sechster = oSheet.getCellByposition(2, 6)
siebter = oSheet.getCellByposition(2, 7)
achter = oSheet.getCellByposition(2, 8)
neunter = oSheet.getCellByposition(2, 9)
zehnter = oSheet.getCellByposition(2, 10)
print Entry (Count) 'so funzt es
'erster.setvalue(Entry (Count)) 'aber so net WARUM??
'zweiter.setvalue(Entry (Count))
'dritter.setvalue(Entry (Count))
'vierter.setvalue(Entry (Count))
'fuenfter.setvalue(Entry (Count))
'sechster.setvalue(Entry (Count))
'siebter.setvalue(Entry (Count))
'achter.setvalue(Entry (Count))
'neunter.setvalue(Entry (Count))
'zehnter.setvalue(Entry (Count))
Next Count
End Sub