Parsing and working with a string
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Re: Parsing and working with a string
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.
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
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
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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Parsing and working with a string
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
Craig Newman
Re: Parsing and working with a string
That'll be Santa interfering. He's a jolly chap, but not much of a programmerSimon wrote:I'll check it again tomorrow, it'll probably be broken![]()

Re: Parsing and working with a string
..........
Last edited by [-hh] on Wed Aug 13, 2014 2:22 pm, edited 1 time in total.
shiftLock happens
Re: Parsing and working with a string
..........
Last edited by [-hh] on Wed Aug 13, 2014 2:22 pm, edited 1 time in total.
shiftLock happens
Re: Parsing and working with a string
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
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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Parsing and working with a string
..........
Last edited by [-hh] on Wed Aug 13, 2014 2:22 pm, edited 1 time in total.
shiftLock happens
Re: Parsing and working with a string
Ok Herrman you got me,
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
I don't know DB's that well. There I said it.one can't/won't use a dBase
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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!
Re: Parsing and working with a string
..........
Last edited by [-hh] on Wed Aug 13, 2014 2:22 pm, edited 1 time in total.
shiftLock happens
Re: Parsing and working with a string
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
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
I used to be a newbie but then I learned how to spell teh correctly and now I'm a noob!