getting object location and size from their strings

jnash

Well-known member
Joined
Oct 20, 2006
Messages
111
Programming Experience
Beginner
i have saved a objects location and size in a string, i was wondering how i can convert it to get the values out of it to recreate the location and size

the strings are like this

object location = "{X=278,Y=59}"
object size = "{Width=390, Height=192}"

thanks
Jon
 
Both Point and Size structures are serializable, so it might be easier to serialize your "objects". Else you will be doing string parsing and/or Regular Expressions to get the values from the string. I see you have much database questions so this request could also be db related, if so there could be discussed if a database is really the best choice to store your data.
 
thanks jon, not to sure what serializable is, and regards to the db its for a uni project and it ! has ! to include a db, thank yo u
 
There is a serialization example here. If the "object" fields doesn't serve other purpose in the db you could serialize each object to byte array and store that byte array in db, you could also serialize the full collection of objects into one single byte array that was stored as one single item in db.
 
thank you , looking at the class i cant make comparision on how ill use this when adding to my db and retrieving with objreader?
for example it takes in a string, i need a point , and a size, changin these i have issues with names as such?
 
Back
Top