Announcement

Collapse
No announcement yet.

What is wrong here?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • What is wrong here?

    Following is a sample from PB Help file (DIR$ function) I just tested:

    Code:
    Dim Listing(1 To 1000) As String
    Dim x As Long
    Dim temp As String
    temp = Dir$("*.*", To Listing(x)
    While Len(temp) And x < 1000
      Incr x
      temp = Dir$(Next, To Listing(x))
    Wend
    Error message:
    Data type mismatch
    Line 4: temp = Dir$("*.*", To Listing(x)
    Norbert Doerre

  • #2
    It's a mistake in the docs. Change "Listing" data type to the built-in DIRDATA:

    Code:
     
     Dim Listing(1 To 1000) As DirData
    kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

    Comment


    • #3
      There's also a missing closing bracket, don't know if that happened thru your copying to the forum or if it's in the help file as well.

      Comment


      • #4
        Code:
        Dim Listing(1000) As DirData
        Works better!
        Rgds, Dave

        Comment


        • #5
          I think Knuth may have been referring to this?
          temp = Dir$("*.*", To Listing(x)
          Furcadia, an interesting online MMORPG in which you can create and program your own content.

          Comment


          • #6
            Dave picked up on the zero bound. Good catch!
            kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

            Comment

            Working...
            X