Thank you very much for your help buddymatkona!
And sorry for asking almost the same question again.
Now I have a testcode to write string in an allocated memory and some other strings an an other allocated memory. In order provide the string length of individual string I use an auxillary array a_laenge () for the strings in array a() y and an other auxillar array b_laenge() for the strings in array b(). In the loop between "ElapsedMilliseconds() " I try to find out if a string in allocatedmemory b is also in allocatedmemory a or not. But I do not know to do this because I have no idea to use the function "comparememory and set (calculate) the correct length in the compare function.
Please could someone help me with a code!
Right now I use the following code.
Code: Select all
Dim a.s(20000)
Dim b.s(20000)
Dim c.s(20000)
Dim a_laenge(20000)
Dim b_laenge(20000)
a(1) = "Wald"
a(2) = "Baum"
a(3) = "Ast"
a(4) = "Blatt"
b(1) = "Hund"
b(2) = "Maus"
b(3) = "Katze"
b(4) = "Ast"
b(5) = "Vogel"
b(6) = "Wald"
Anzahl_a = 4
Anzahl_b = 6
String1$ = a(1)
*String1 = @String1$
String2$ = b(1)
*String2 =@String2$
*BufferString1 = AllocateMemory(10000000)
*PointerString1 = *BufferString1
*BufferString2 = AllocateMemory(10000000)
*PointerString2 = *BufferString2
;-----------------------------------------------------------
Ergebnis = CopyMemoryString(a(1), @*PointerString1)
a_laenge(1) = Len(a(1))
For i= 2 To Anzahl_a
CopyMemoryString(a(i))
a_laenge(i) = Len(a(i))
;Debug PeekS(*BufferString1)
Next
;-----------------------------------------------------------
CopyMemoryString(b(1), @*PointerString2)
b_laenge(1) = Len(b(1))
For i = 2 To Anzahl_b
CopyMemoryString(b(i))
b_laenge(i) = Len(b(i))
Next
;----------------------------------------------------------
;Debug PeekS(*BufferString1)
;Debug PeekS(*BufferString2)
;StringBuffer1$ = PeekS(*BufferString1)
;Debug StringBuffer1$
*AdresseString2 = *BufferString2
StartTime = ElapsedMilliseconds()
For i = 1 To Anzahl_b
;Debug b(i)
; How do I have to set and calculate *BufferString2 in order to use the function CompareMemory ()????????
MessageRequester("",PeekS(*BufferString1, a_laenge(1)) + " " + PeekS(*AdresseString2, b_laenge(i)))
If CompareMemory(*BufferString1, *AdresseString2, b_laenge(i)) = 0 ;???????????????????
NichtGefunden = NichtGefunden + 1
c(NichtGefunden) = PeekS(*BufferString2)
Else
EndIf
*AdresseString2 = *AdresseString2 + b_laenge(i)
Next
Time =ElapsedMilliseconds() - StartTime
MessageRequester("Auswertezeit", Str(Time))
MessageRequester("","Nicht gefunden" + Str(NichtGefunden))