|
-
Dec 12th, 2004, 10:54 AM
#1
Thread Starter
Banned
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.
-
Dec 12th, 2004, 11:14 AM
#2
Thread Starter
Banned
Re: array URGENT
or atleast something that works efficient. doesnt need to be easy it can be advanced
anyone i need it today
-
Dec 12th, 2004, 11:26 AM
#3
Frenzied Member
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.
-
Dec 12th, 2004, 11:34 AM
#4
Thread Starter
Banned
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.
-
Dec 12th, 2004, 01:42 PM
#5
Frenzied Member
Re: array URGENT
Now that's usefull to know.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|