76
Scripting Chat / Re: Placing misc words into an array
« on: January 29, 2017, 01:16:25 AM »
If you've already broken apart the #property into sections, you can name your variables what you're searching for, and set them to #true. Like if you're looking for very specific things.
Then when you break apart your #property string, or you could even use the whole #property, and you get your result from each part, you can do some code like this:
Then you can use the %stringChunk variable if it's found to be in the #property in any way you like, in a variable to find what you are looking for in #property, or perform an action based on that item because it's the #result from earlier in the script, and it's in the #property.
Code: [Select]
set %arrayMonitor #true
set %arrayBike #true
set %arrayKleenex #true
set %arrayCamera #true
Then when you break apart your #property string, or you could even use the whole #property, and you get your result from each part, you can do some code like this:
Code: [Select]
for %I 1 %numberOfStringChunks
{
gosub breakStringApartRight
set %stringChunk n/a
if %array . #result = #true
set %stringChunk #result
if %stringChunk = n/a
display The variable is not in the #property.
if %stringChunk <> n/a
display The variable is in the #property.
}
Then you can use the %stringChunk variable if it's found to be in the #property in any way you like, in a variable to find what you are looking for in #property, or perform an action based on that item because it's the #result from earlier in the script, and it's in the #property.