Programm OOo-Basic erstellen

Programmierung unter AOO/LO (StarBasic, Python, Java, ...)

Moderator: Moderatoren

bst
*****
Beiträge: 222
Registriert: Mo, 18.01.2010 16:14
Wohnort: Ilsfeld

Re: Programm OOo-Basic erstellen

Beitrag von bst »

Hi,

versuche das mal so ähnlich.

cu, Bernd
--

Code: Alles auswählen

REM  *****  BASIC  *****

Sub TestSpiegel
	dim ar As Variant
	
	ar = Array(1,2,3,4,5,6,7)
	
	MsgBox Join( ar, " ")
	Spiegel ar, Ubound(ar)
	MsgBox Join( ar, " ")
End Sub

Sub Spiegel(ar As Variant, ByVal lngCount As Long)
	dim lTmp as Long, i as long
	
	i = 0
	do while lngCount > i
		lTmp = ar(i)
		ar(i) = ar(lngCount)
		ar(lngCount) = lTmp
		i = i + 1
		lngCount = lngCount - 1
	loop
End Sub
turtle47
*******
Beiträge: 1849
Registriert: Mi, 04.01.2006 20:10
Wohnort: Rheinbach

Re: Programm OOo-Basic erstellen

Beitrag von turtle47 »

Hallo,

hier mein Lösungsansatz:

Code: Alles auswählen

Option Explicit
Global newArray
Global ArrayMirror

Sub Spiegel
Dim i as Integer
Dim resultArray
	resultArray = ""
	ArrayMirror = Array(1.23,2.75,3.12,4.83,5.45,6.34,7.71)
	for i =  uBound(ArrayMirror) to lBound(ArrayMirror) step -1
	resultArray = resultArray  & ArrayMirror(i) & ";"
	next i
	newArray = Split(resultArray,";")
	'TestSpiegel
End Sub 

Sub TestSpiegel
	MsgBox "Vorher:    " & Join(ArrayMirror,"  ") & CHR(13) & "Nachher: " & Join(newArray,"  ")
End Sub
Viel Erfolg.

Jürgen
Software hat keinen Verstand - benutze deinen eigenen...!

Win 7 SP1/ LibreOffice 3.4.2 OOO340m1 (Build:203) / Firefox 15.0.1 / Notebook ASUS K70IO 64 Bit-Betriebssytem
Antworten