Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Arrayfunktionen

Empfohlene Antworten

Veröffentlicht

Hi.

Könnt Ihr mir helfen? Brauche Funktionen für Arrays...


StringSuchen ([COLOR="Blue"]ByVal [/COLOR]sInhalt [COLOR="Blue"]As String[/COLOR], [COLOR="Blue"]ByVal [/COLOR]sArray() [COLOR="Blue"]As String[/COLOR], [COLOR="Blue"]Optional ByVal [/COLOR]iCol [COLOR="Blue"]As Integer[/COLOR]) 

  [COLOR="Green"]' Alle Treffer in Rückgabe-Array

  ' iCol: sucht bei Angabe nur in dieser Splate[/COLOR]


DatensatzLoeschenNachString ([COLOR="Blue"]ByVal [/COLOR]sInhalt [COLOR="Blue"]As String[/COLOR], [COLOR="Blue"]ByVal [/COLOR]iCol [COLOR="Blue"]As Integer[/COLOR], [COLOR="Blue"]ByRef [/COLOR]sArray() [COLOR="Blue"]As String[/COLOR])

  [COLOR="Green"]' Sucht nach "sInhalt" in Spalte "iCol" und entfernt Datensatz

  ' Redimensioniert (ReDim Preserve) Array, sodass kein Überhang bleibt.[/COLOR]


DatensatzHinzufuegen ([COLOR="Blue"]ByVal [/COLOR]sDaten() [COLOR="Blue"]As String[/COLOR], [COLOR="Blue"]ByRef [/COLOR]sArray() [COLOR="Blue"]As String[/COLOR], [COLOR="Blue"]Optional ByVal[/COLOR] iRow [COLOR="Blue"]As Integer[/COLOR])

  [COLOR="Green"]' Fügt Datenarray (sDaten) ans Ende des Datenbankarrays (sArray) an

  ' Wenn "iRow" gesetzt ist, werden die Daten nach dieser Position angefügt. Falls "iRow" > "Ubound(sArray)" nur ans Ende anfügen[/COLOR]

Noch vergessen:

ArraySortieren ([COLOR="Blue"]ByVal [/COLOR]iCol [COLOR="Blue"]As Integer[/COLOR], [COLOR="Blue"]ByVal [/COLOR]Aufsteigend [COLOR="Blue"]As Boolean[/COLOR], [COLOR="Blue"]ByRef [/COLOR]sArray() [COLOR="Blue"]As String[/COLOR])

  [COLOR="Green"]' Sortiert Array nach Spalte "iCol"[/COLOR]

Und wo genau ist jetzt dein Problem?

Oder erwartest du, dass dir hier einer den Quelltext dafür hinschreibt?

Wir werden dir gerne helfen, aber ein bisschen überlegen solltest du selber, schliesslich können wir nicht den ganzen Tag bei dir sein und all deine Arbeit erledigen!

Hi.

Bis auf Suchen habe ich jetzt alles. Ich weiß, dass Suchen mit 2 Arrays arbeitet, finde aber keinen Lösungsansatz.

Natürlich könnte ich das erste Zeichen usw überprüfen. Blos was ist, wenn ein identischer Text (ca. 800 Zeichen) drin steht und nur am Ende ein Increment bzw. mitten drin.

Außerdem ist es dann nicht dynamisch

Warum kann man einen Array eigendlich nicht als ByVal übergeben?

  • 2 Wochen später...

Naja.. Könnte man schon, aber .. Warum? .. Allein der Speicherverbrauch für eine ByVal wäre doch unsinnig

Aber ..


Public Funktion ArraySuchen(V_SuchString as string, V_GrossKleinIgnorieren as boolean, V_ArrayD() as string, V_ArrayC as long, B_ArrayD() as string, B_ArrayC as long)

Dim X as long

Dim SS as string

SS = V_SuchString

If V_GrossKleinIgnorieren = True then

    SS = LCase(SS)

    For x = 1 to V_ArrayC

        If SS = LCase(V_ArrayD(X)) then

            B_ArrayC = B_ArrayC + 1

            Redim Preserve B_ArrayD(B_ArrayC) as string

            B_ArrayD(B_ArrayC) = V_ArrayD(X)

        End If

    next

Else

    For x = 1 to V_ArrayC

        If SS = V_ArrayD(X) then

            B_ArrayC = B_ArrayC + 1

            Redim Preserve B_ArrayD(B_ArrayC) as string

            B_ArrayD(B_ArrayC) = V_ArrayD(X)

        End If

    next

End If

End Function

Den Rest kannst dir jetz selbst erarbeiten .. vorallem die Sortier rythmen .. das is ja nicht weiter wild .. ganz simpel. und .. .. hab da noch n kleinen Hinweis für dich! : http://www.lugbz.org/documents/smart-questions_de.html :mod:

Greez

TPM

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.