Page 2 of 2

Re: Parsing and working with a string

Posted: Tue Dec 24, 2013 10:05 am
by SparkOut
how about a multidimensional array?
eg
put "favoriteColor" into tNewArray[141]["tag"]
put "Blue" into tNewArray[141]["response"]
etc?

I'm still unsure as to how your original array is structured.

But you could:
NOT( (tNewArray[141]["tag"]) = "Blue") AND... then I get lost with wondering where your data came from and how you got it into your response array.

Re: Parsing and working with a string

Posted: Tue Dec 24, 2013 11:35 am
by Simon
Hello all who are following.
Tonight I have it working... I'll check it again tomorrow, it'll probably be broken :(

I ended up putting all the [tag] as a custom property with [Response] as their value. I save all the answers out into a external data file and load custom properties on openStack.

Anyone know if I can have 2000 custom properties in a liveCode stack?

Ugh!

Simon

Re: Parsing and working with a string

Posted: Tue Dec 24, 2013 5:31 pm
by dunbarx
I don't think there is a limit to the number of custom properties in a stack, only a limit to how much the human mind can support. But if you have a system...

Craig Newman

Re: Parsing and working with a string

Posted: Tue Dec 24, 2013 6:28 pm
by SparkOut
Simon wrote:I'll check it again tomorrow, it'll probably be broken :(
That'll be Santa interfering. He's a jolly chap, but not much of a programmer :D

Re: Parsing and working with a string

Posted: Sun Dec 29, 2013 7:58 pm
by [-hh]
..........

Re: Parsing and working with a string

Posted: Mon Dec 30, 2013 2:32 am
by [-hh]
..........

Re: Parsing and working with a string

Posted: Mon Dec 30, 2013 5:40 am
by Simon
Hi Hermann,
Thanks for this.
I'll make a test soon to see how it compares. Right now my code is working but it's a Frankenstein kludge of code, so I have to change it soon before production.
I will still have to figure out how to apply the switch case as there are over 1000 questions and most are based on previous answers. But I can figure out how to handle that.

"lock screen; lock messages" I've got to remember that.

Thanks again,
Simon

Re: Parsing and working with a string

Posted: Mon Dec 30, 2013 2:03 pm
by [-hh]
..........

Re: Parsing and working with a string

Posted: Tue Dec 31, 2013 1:16 am
by Simon
Ok Herrman you got me,
one can't/won't use a dBase
I don't know DB's that well. There I said it.

Yes, all the questions come from MySQl and I could shove the questions and answers into a local sqLite. But I'm unclear on how to do the search.
I do think that the DB I'm grabbing the info from needs to be more consistent, I'll take that up with the client.

Is it easier to implement DB searches rather than array searches?
Does this
(NOT favoriteColor = Blue) AND ((bestSound = Laughter) OR (bestSound= Dishes clattering in a distant restaurant) OR (happyToday = NO NOT AT ALL))
make more sense to a DB?

Simon

Re: Parsing and working with a string

Posted: Tue Dec 31, 2013 2:58 am
by [-hh]
..........

Re: Parsing and working with a string

Posted: Tue Jun 17, 2014 5:25 am
by Simon
Hi Hermann,
I have to thank you for the encouragement. Took me 1 day to use it and 6 months to embrace it.
Sqlite is a breeze, absolutely no problems getting it to do what I want.

I'm going to go put my socks into a db :)

Simon