Re: quotes question

2014-10-08 Thread Kay C Lan
On Thu, Oct 9, 2014 at 12:30 AM,  wrote:

>
> create field
> set the name of the last field to ("myfield" & x)
>

Looks like you're starting to think like a LiveCoder :-)
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: quotes question

2014-10-08 Thread Bob Sneidar
The first one is correct. Quote object names and values, do not quote 
variables. You can get away without quoting object names, but the code is more 
readable, and avoids (remotely) possible variable/object conflicts.

Bob S


On Oct 8, 2014, at 09:30 , 
la...@significantplanet.org wrote:

Question: If I'm using a variable as part of a field name, should it have 
quotes around it?
In other words, which of the two examples below is the right way to do it?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: quotes question

2014-10-08 Thread Colin Holgate
If you mean that “myfield” is the name that you want to call the field, then 
this would be more proper, though either should work:

set the name of the last field to ("myfield" & x)

If myfield contains some other text, like “real field name”, this will work:

set the name of the last field to (myfield & x)

but this will fail:

set the name of the last field to (“myfield" & x)

My guess is that you mean that ‘x’ is the only variable, and myfield is the 
actual name that you want.

One other thing, if you want to name fields as “myfield 1”, “myfield 2”, etc, 
you can use double ampersands to get the space character:

set the name of the last field to (“myfield" && x)
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


quotes question

2014-10-08 Thread larry
Hello All,

I've been given some good advice from a couple of people on this list about 
being sure to put quotes around object names.

So I'm going back through my code and doing that.

Question: If I'm using a variable as part of a field name, should it have 
quotes around it?
In other words, which of the two examples below is the right way to do it?

create field
set the name of the last field to (myfield & x)

OR

create field
set the name of the last field to ("myfield" & x)

??

Thanks
Larry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode