Half Strict Compilation mode
Moderator: Klaus
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: Half Strict Compilation mode
I'm pretty sure field is a keyword for the compiler.
Here isn't tFldName a local/temporary variable?
put "CustomerName" into tFldname
Or does the compiler know that tFldnameis an object and I don't need to type cast?
Can you have a local variable name with spaces?
Again, my practice is Not to use spaces in field names ever.
And not Need to use "" around names.
the space is an extra key stroke.
The " is two key strokes.
Totaling to 5 keystrokes at least extra per name.
Again, we're measuring the difference in micro-seconds of execution speed.
And here fRlfName is a control object?
put "Milo Fenderbender" into field tFldname
Where spaces in control names are allowed.
It was just a thought.
I don't know enough about the language and all its incredible variations.
But I can see in my head it could be ticked on to insert ""
with the "" highlighted for replacement.
and if a delete key is NOT pressed then the entry would begin inside the "|".
Here isn't tFldName a local/temporary variable?
put "CustomerName" into tFldname
Or does the compiler know that tFldnameis an object and I don't need to type cast?
Can you have a local variable name with spaces?
Again, my practice is Not to use spaces in field names ever.
And not Need to use "" around names.
the space is an extra key stroke.
The " is two key strokes.
Totaling to 5 keystrokes at least extra per name.
Again, we're measuring the difference in micro-seconds of execution speed.
And here fRlfName is a control object?
put "Milo Fenderbender" into field tFldname
Where spaces in control names are allowed.
It was just a thought.
I don't know enough about the language and all its incredible variations.
But I can see in my head it could be ticked on to insert ""
with the "" highlighted for replacement.
and if a delete key is NOT pressed then the entry would begin inside the "|".
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: Half Strict Compilation mode
Ah. I start to see where you're going with this...
No,
in this example puts the string "Milo Fenderbender" into field "CustomerName" since we've already put "CustomerName" into the variable tFldName. The "put" isn't assigning a name to the field, it's storing a value into the field.
I never use spaces in object names. You can do it, but I think it's Bad Practice. And I don't think you can get away with space in variable names, although I haven't ever tried it. There are many syntactical obstacles to assigning quotes automatically because the language is so rich and supports so many variations.
No,
Code: Select all
put "Milo Fenderbender" into field tFldName
I never use spaces in object names. You can do it, but I think it's Bad Practice. And I don't think you can get away with space in variable names, although I haven't ever tried it. There are many syntactical obstacles to assigning quotes automatically because the language is so rich and supports so many variations.
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: Half Strict Compilation mode
Yep gotcha, I read that as two examples of your point and not one point with two script lines. My bad.
That situation solved with my "" selected idea.
Agreed. Well for me anyway. If others wanna then no prob.
Wouldn't compile. I though that might be where we were headed.
Yeah fair enough.
Hoping my "" selected idea will tilt the balance enough to have a go.
Even though I will probably never use it. LOL
That situation solved with my "" selected idea.
Code: Select all
I never use spaces in object names. You can do it, but I think it's Bad Practice.
Just triedAnd I don't think you can get away with space in variable names, although I haven't ever tried it.
Code: Select all
Local "my xxx Var"
Code: Select all
There are many syntactical obstacles to assigning quotes automatically because the language is so rich and supports so many variations.
Hoping my "" selected idea will tilt the balance enough to have a go.
Even though I will probably never use it. LOL
Last edited by BarrySumpter on Thu Aug 04, 2011 5:21 am, edited 1 time in total.
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: Half Strict Compilation mode
Here's what I usually do. This saves a lot of typing quotes and also cuts down on typo errors, which are especially prone to occur in quoted strings:
constant kFldName= "CustomerName"
constant kFldAmount= "InvoiceAmount"
put "hello, bucko" into field kFldName
put tInvoiceTotal into field kFldAmount
...
constant kFldName= "CustomerName"
constant kFldAmount= "InvoiceAmount"
put "hello, bucko" into field kFldName
put tInvoiceTotal into field kFldAmount
...
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: Half Strict Compilation mode
Hey! Hey! Hey!
Very cool. As yet another idea I would never have tried.
If that saves the milisecond execution time?
If not then why not just use:
i.e. without the constant dimentioning.
Very cool. As yet another idea I would never have tried.
If that saves the milisecond execution time?
If not then why not just use:
Code: Select all
put "hello, bucko" into field lblCustomerName
put tInvoiceTotal into field txtInvoiceAmount
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: Half Strict Compilation mode
Barry-
It's not so much that it saves execution time, but more that it a) saves error-prone typing and b) allows you change the name of a control in one place without having to search through your code for all the places you used it. I didn't put a lot of example stuff in the previous post, but I'd normally do this if I'm access a control more than a couple of times. If I have a script that needs a given field name a dozen times or so (and I do) it's much more convenient to have it in a constant declaration than to have to specify a quoted field name a dozen times and maybe end up with a typo or three.
It's not so much that it saves execution time, but more that it a) saves error-prone typing and b) allows you change the name of a control in one place without having to search through your code for all the places you used it. I didn't put a lot of example stuff in the previous post, but I'd normally do this if I'm access a control more than a couple of times. If I have a script that needs a given field name a dozen times or so (and I do) it's much more convenient to have it in a constant declaration than to have to specify a quoted field name a dozen times and maybe end up with a typo or three.
-
- Posts: 1201
- Joined: Sun Apr 24, 2011 2:17 am
Re: Half Strict Compilation mode
Fair enough.
I'd use find/replace.
I'd use find/replace.
All my best,
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Barry G. Sumpter
Deving on WinXP sp3-32 bit. LC 5.5 Professional Build 1477
Android/iOS/Server Add Ons. OmegaBundle 2011 value ROCKS!
2 HTC HD2 Latest DorimanX Roms
Might have to reconsider LiveCode iOS Developer Program.
Re: Half Strict Compilation mode
Me either. At least, not until Bill Marriott mentioned the convenience of using a number at the end of names as a counter or identifier in certain situations. That way you don't have to parse the end of the name looking for a number, you can just grab the last word of the name. I still use one-word field names mostly, but one time I found this technique is useful.mwieder wrote: I never use spaces in object names.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com