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

-= JB =- sundown at nwrain.net
Sat Jun 30 21:41:33 EDT 2007


Hi Joe,

I liked your reply.  It is always nice to have things
explained in a variety of ways.  At least it is for me
because I can easily get brain locked.  And with
another explanation it might answer questions
not easily seen in the previous answer.

thanks,
-=>JB<=-

==========================================
On Jun 30, 2007, at 9:07 AM, Joe Lewis Wilkins wrote:

> Hi JB,
>
> Seems I should have read further in the thread. (smile)
>
> Joe Wilkins
>
> On Jun 30, 2007, at 6:05 AM, -= JB =- wrote:
>
>
>>
>> On Jun 30, 2007, at 5:41 AM, David Bovill wrote:
>>
>>
>>> 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 :)
>>>
>>
>> Maybe you are thinking of a problem I have had which
>> was dealt with by declaring the variable just before I
>> do the repeat line.  When I am going to add to a variable
>> I always make sure it has something to add to first.
>>
>> put 0 into lineCount
>>
>>
>>> function countLines someLines
>>>     repeat for each line someLine in someLines
>>>       add 1 to lineCount
>>>     end repeat
>>>     return lineCount
>>> end countLines
>>>
>>
>> -=>JB<=-
>>
>
> _______________________________________________
> 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
>
>




More information about the use-livecode mailing list