implicitVars [Was: Re: Best Practices in Rev development]

David Bovill david at openpartnership.net
Sat Jun 30 08:41:26 EDT 2007


Firstly there was a typo in the example - but it also seems I was wrong. Its
an old habit that perhaps was justified a long time ago?

function countLines someLines
     repeat for each line someLine in someLines
       add 1 to lineCount
     end repeat
     return lineCount
end countLines

I do remember having errors in handlers where an a variable that was first
declared/initiated inside a repeat loop (in this case "lineCount") would
return the literal text "lineCount' and not empty if the repeat loop was
never entered into (ie someLines) was empty - maybe it was just in a version
of the debugger - no idea.

Well one bad old habit fixed :)



More information about the use-livecode mailing list