On 9/7/05, Andrew Douglas Pitonyak <[EMAIL PROTECTED]> wrote:
I don't suppose that you can provide an example that causes the
problem...
I tried to use the supplied example and there are issues.

I've just checked the copy of my mail in the archive for this mailing list and apparently it got mangled during transit (especially whitespace, e.g. n(0) is supposed to be a string of exactly 100 space characters). I've attached the code again as a text file. Copy and paste it into a new module and it should run without errors (and give the message box "This is impossible!". Sorry for the wasted time but unfortunately GMail doesn't show the mailing list copy of my own mails so I didn't notice that it was corrupted.

Matthias
Sub Main
  Dim n(1) as String
  n(0) = "                                                                      
                              "
  n(1) = "                                                                      
                              "
  Dim a as Variant

  f(Array(60,10,1,12,20,10,25,30), n(), 0, 76)

End Sub

Function f(splitInfo() as Variant,  daten() as String, i as Long, j as Long) as 
Variant
  If i > UBound(daten) Then
    Exit Function
  End If
 
  Dim ret() as String

  for k = 0 to UBound(splitInfo)
    restLen = Len(daten(i)) - j
    Dim splitPos as Long
    splitPos = splitInfo(k)
    If splitPos <= restLen Then
      j = j + splitPos
    Else
      st = Right(daten(i), restLen)
      i = i + 1
      j = 0
      sta = f(Array(splitPos - restLen), daten, i, j)

      If IsNull(sta) Then
        MsgBox("This is impossible!")
        Exit Function
      End if
     
    End If
  next k
 
  f = ret()
End Function
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to