Livecode 10.0.0dp5 new reserved words
Martin Koob
mkoob at rogers.com
Tue Jul 11 08:04:22 EDT 2023
Hi Paul,
I remember that at a workshop or meeting, a few years PCE* it was says by someone from LiveCode (although possibly RunRev at the time) by Mark W (I think but I could be wrong but definitely from the mothership) that
‘All words in the English Dictionary should be considered reserved words.’
Or something to that effect.
The rationale was that even though LiveCode does not use the words in its vocabulary currently It may in the future.
(Can someone else corroborate my vague memory of this?)
So with that in mind even though tExt is camelCase and visually does not appear to be a word livecode does not consider case so it sees it as ’text’ which is a word in the English dictionary and also one that would more likely be a part of LiveCode’s future lexicon
( more so than perhaps Oxford’s word of the year. https://languages.oup.com/word-of-the-year/2022/
Although I think it would be cool to have ‘goblin mode’ as a LiveCode word.
e.g.
command relaxHygieneStandards
set goblin mode to “severe”
end relaxHygieneStandards
command restoreHygieneStandards
set goblin mode to “false”
end restoreHygieneStandards
In any case the advice as to best practice was to never use an English dictionary word as the name of a variable in order to future proof your application should the MotherShip decide to add a new term from the English dictionary to the LiveCode lexicon.
So in your case it would be better to use something like tExtn or even tExtension.
Martin
*PCE (Pre COVID Era)
> On Jul 11, 2023, at 7:28 AM, Paul Dupuis via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> Does anyone, including folks at the mothership, have a list of new reserved words in Livecode 10?
>
> I have used a variable called "tExt" (t for temp, Ext for extension) to pull of the file extension from file paths. i.e. if tFile contains "C:/users/paul/desktop/image.png"
>
> set itemDel to "."
> put last item of tFile into tExt -- tExt contains "png"
>
> However, in LC 10.0.0dp5, the word "tExt" (which is "text") now appears to be a reserved work and you can not use it as a variable. This is not true in LC 9.6.9. This has me asking: Are there any other new reserved words I should refactor out of my code before I get mysterious errors?
>
>
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
More information about the use-livecode
mailing list