Könnte vielleicht jemand brauchen.
Code: Alles auswählen
Structure StrPMut
Chars.s
cMax.l
cPos.l
plen.l
pPos.l[10000]
Pref.s
EndStructure
Procedure.s GetNextString(*obj.StrPMut)
Protected RtVar.s,i
*obj\cPos+1
RtVar = *obj\Pref+Mid(*obj\Chars,*obj\cPos,1)
If Not *obj\cMax
*obj\cMax = Len(*obj\Chars)
EndIf
If *obj\cMax = *obj\cPos
*obj\cpos=0
*obj\pPos[*obj\plen]+1
For i = *obj\plen To 0 Step -1
If *obj\pPos[i] > *obj\cMax
*obj\pPos[i] = 1
If Not i
*obj\plen+1
*obj\pPos[*obj\plen] = 1
Else
*obj\pPos[i-1]+1
EndIf
EndIf
Next
*obj\Pref = ""
For i = 0 To *obj\plen
*obj\Pref+Mid(*obj\Chars,*obj\pPos[i],1)
Next
EndIf
ProcedureReturn RtVar
EndProcedure
; Testen
Test.StrPMut
Test\Chars = "abcdefghijklmnopqrstuvwxyz" ; Mögliche Zeichen
For i = 1 To 1000
Debug GetNextString(@Test)
Next