Help with other code
graham samuel
graham.samuel at wanadoo.fr
Fri Mar 11 05:15:57 EST 2005
Kevin - one extra point. Although it may have worked in this particular
case, it is generally not a good idea to give a variable a name which
is a reserved word in Transcript. 'number' is certainly reserved, as in
put the number of lines of myField into myTemp
or whatever. It you do this, you will eventually get unexpected results
(when Revolution can't work out from the context whether you mean to
use a reserved word or not). Many people use a consistent naming style
by introducing a one or two-letter prefix before every variable name. I
believe Richard G has some clearer advice on this on his site.
HTH
Graham
On Thu, 10 Mar 2005 22:20:52 -0500, Kevin J <kj2005.28 at gmail.com> wrote:
>
> Ahh ok I see. lol I am still thinking like as if I was useing Python
> or Visual Basic.
> Thanks for the help
>
>
> On Thu, 10 Mar 2005 18:58:25 -0800, Dan Shafer <revdan at danshafer.com>
> wrote:
>> It's almost as you have it, Kevin!
>>
>> if txtName is "Kevin" then
>> put pi * 12 into number
>> else
>> put pi * 20 into number
>> end if
>>
>> If "txtName" is not a variable but rather the name of a field, then
>> it's only slightly different:
>>
>> if field "txtName" is "Kevin" then
>> put pi * 12 into number
>> else
>> put pi * 20 into number
>> end if
>>
>> Dan
>>
>> On Mar 10, 2005, at 6:44 PM, Kevin J wrote:
>>
>>> I understand the basics on how to manipulate fields. What I would
>>> like
>>> to know is how to your write the code for somthing like this
>>>
>>> if txtName == "Kevin" then
>>> number = pi * 12
>>> else
>>> number = pi * 20
>>>
>>> I hope I explained my self ok there lol.
>>>
>>> Thanks
>>>
>>> Kevin
>>> _______________________________________________
>>> use-revolution mailing list
>>> use-revolution at lists.runrev.com
>>> http://lists.runrev.com/mailman/listinfo/use-revolution
>>>
----------------------------------------
Graham Samuel / The Living Fossil Co. / UK and France
More information about the use-livecode
mailing list