Results 1 to 5 of 5

Thread: array URGENT

  1. #1

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Exclamation array URGENT

    i use an array to save the Tiles of a map(Width, Height)

    is there an easy way to im and ex -port the array into a mysql field?
    Last edited by nareth; Dec 12th, 2004 at 11:11 AM.

  2. #2

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Re: array URGENT

    or atleast something that works efficient. doesnt need to be easy it can be advanced

    anyone i need it today

  3. #3
    Frenzied Member David.Poundall's Avatar
    Join Date
    Sep 2002
    Location
    Robin Hood Land
    Posts
    1,457

    Re: array URGENT

    Just to clarrify. Did you mean to say field or did you mean fields ? One being a serialise and stash the other being a read across.
    David

    Learn the Rules so that you know how to break them properly.

    Printing dll dBTools MZTools Winsock API WinsockVB More Winsock SGrid2 MSChart Mail2Web

    If you have found this thread useful then read this

  4. #4

    Thread Starter
    Banned nareth's Avatar
    Join Date
    Jun 2004
    Posts
    1,206

    Re: array URGENT

    i think i found it:

    5) LONGTEXT data cannot be held in a string, and would need to be treated as a BLOB and written directly to a file using the BLOB handling methods. If using the stream object, change the stream type to adTypeText instead of adTypeBinary.
    http://dev.mysql.com/tech-resources/...-handling.html

    Code:
    Public Function LoadMaps() As Boolean
        On Local Error GoTo ErrCatch:
        Dim FilePath As String: Let FilePath = App.Path & "\tmp.txt"
        Dim Map As CMap: Set Map = New CMap
        Dim RS As Recordset: Set RS = New Recordset
        Dim SR As Stream: Set SR = New Stream
        
        Call RS.Open("SELECT * FROM Maps", DB, adOpenDynamic, adLockReadOnly)
        Call RS.MoveFirst
        
        Let SR.Type = adTypeText
        Call SR.Open
        
        While Not RS.EOF
            Let Map.Name = CStr(RS("Name"))
            Let Map.Width = CLng(RS("Width"))
            Let Map.Height = CLng(RS("Height"))
            Call SR.WriteText(CStr(RS("Tiles")))
            Call Map.parsetext(SR.ReadText)
            
            Call Maps.Add(Map, Map.Name)
            Call RS.MoveNext
        Wend
        
        Set RS = Nothing
        Let LoadMaps = True
    ErrCatch:
    End Function
    Last edited by nareth; Dec 12th, 2004 at 11:38 AM.

  5. #5
    Frenzied Member David.Poundall's Avatar
    Join Date
    Sep 2002
    Location
    Robin Hood Land
    Posts
    1,457

    Re: array URGENT

    Now that's usefull to know.
    David

    Learn the Rules so that you know how to break them properly.

    Printing dll dBTools MZTools Winsock API WinsockVB More Winsock SGrid2 MSChart Mail2Web

    If you have found this thread useful then read this

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width