Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!
put revXMLNodeContents( tInfo, "ArrayOfXmlNode/"&tChild&"/"&tAdoptable&"/Age") into tAge
tAge div 12
put it into tYears
tAge mod 12
put it into tMonths
put "Age: " & tYears & " " & tMonths & return after tData
put tData & return after tOutput
set the text of field "tData" to tOutput
You have syntax errors, not operator errors. I started reading your code, and threw an error at line 2. You are asking LC to find a handler with the name "tAge". There isn't one. I think you want to:
You have syntax errors, not operator errors. I started reading your code, and threw an error at line 2. You are asking LC to find a handler with the name "tAge". There isn't one. I think you want to:
Yes, currently it gives a number which is the age in months. I am trying to divide by 12 to get just the number of years and then use mod to also show the number of months in addition to the years.
For example: tAge = 71 but want it to show as 5 years and 11 months.
Hm, the little script works as exspected in LC 8 RC1 (with age 71 hardcoded!)!?
I understand this, but it does not work with the variable which does display a value. Would you like me to show you more code? I am unsure why it is not working, but tAge does represent a value so...
If you have a number in tAge, it will work. And if you have tAge itself, it will work.
You are now in the exalted group of those who struggle mightily, and finally discover the tiny flaw in the ointment. Or fly. This includes everyone here...