Text variable problem

stevex64 stevex64 at yahoo.com
Sun May 24 09:29:32 EDT 2009


It seems whitespace may be part of the problem,or the whole problem. I've
used put to write the 17th element, ",", g_reg, and another comma, and the
output was Texas,Texas, with now space between the last s and the last
comma. But if I test the length of g_reg, it came up as 6, so I assumed
there was unseen whitespace. I deleted the last character of g_reg and
things worked from there. So one problem appears to be that "put" wasn't
putting that whitespace, which was misleading me.


Sarah Reichelt-2 wrote:
> 
>> I have a very irritating problem occurring. In one part of my program a
>> global variable, g_region, is set to the name of a US state or Canadian
>> province. Later in the program there is a loop that compares the 17th
>> element of the line to g_region. If g_region and element 17 of the line
>> are
>> the same, the program does something. Using the variable watcher, I can
>> see
>> that g_region is set to a states name, and I can see that the 17th
>> element
>> of the line is the same state as g_region. But the loop doesn't
>> acknowledge
>> that the two are equivalent. I have tried :
>>
>> "repeat for each line regLine in lData
>>   if item 17 of regLine = g_reg then //and I've tried "is" in place of
>> the
>> equals sign, too.
>>      put item 17 of regLine into regFiltered
>>   end if
>> end repeat"
> 
> I have had problems with this sort of thing if there are any extra
> spaces in the data.
> Try:
> if item 17 of regLine contains g_reg then
> ....
> 
> Cheers,
> Sarah
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> 

-- 
View this message in context: http://www.nabble.com/Text-variable-problem-tp23690465p23693668.html
Sent from the Revolution - User mailing list archive at Nabble.com.




More information about the use-livecode mailing list