I ask a lot of questions. I hope no one minds - I'm very stupid and very persistent.
I've got this little clause in my code - it's pulling information from a MySQL database and puts it into tName and tMessage for this part, and I'm trying to get it so it posts item 1 of tName, then item 1 of tMessage, then item 2 of tName, and item 2 of tMessage, and so on until it runs out:
else
set itemDelimiter to return
put 1 into tMessageCount
repeat for each item theNames in tName
put "<" && item theNames of tName && ">" after field "textDisplay"
put item tMessageCount of tMessage after field "textDisplay"
add 1 to tMessageCount
end repeat
However I get an error for the illustrated line in "range start expression". The variables all seem to be what they should be at this point. I looked at other people's solutions across the internet and tried "repeat with i = 1 to the number of lines of tName" instead but it didn't change anything. Still got the same error in the same place.
Error in range start expression
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Error in range start expression
Quick look, you are over-thinking, and therefore overCoding.
If you already have a repeat loop that extracts successive items (each instance is "theNames") then you only need to:
Oh, and nobody yet, ever, ever asked too many questions. if you don't, I have to actually work at my job.
Craig Newman
If you already have a repeat loop that extracts successive items (each instance is "theNames") then you only need to:
Code: Select all
put "<" && theNames && ">" after field "textDisplay"
Craig Newman
Re: Error in range start expression
That works, thank you!
I was about to ask a further question that was tricky, but then I solved it. I love coding! It's like a lateral thinking puzzle. If you don't know the complicated way of doing something, look for an easy solution
I was about to ask a further question that was tricky, but then I solved it. I love coding! It's like a lateral thinking puzzle. If you don't know the complicated way of doing something, look for an easy solution
