How to compile in earlier versions using new keywords?

Mark Wieder mwieder at ahsoftware.net
Sat Apr 9 13:19:47 EDT 2016


On 04/09/2016 07:47 AM, -hh wrote:

> ====
> I have an idea, that may be more comfortable:
> If we could have a switch in LC 7+8 for parsing/compiling
> that temporarily disables one of the commenting methods,
> for example "//", we could use "version blocks" in new scripts:
>
> // usual comment line for all versions
> set slashCommentsOff to true
>   // ... code for versions 7/8 only
>   // ... code for versions 7/8 only
> set slashCommentsOff to false
> // usual comment line for all versions
>
> This could analogously go on two times with switches
> "hashCommentsOff" and "dashCommentsOff"
> for later versions...
>
> Just an idea.

Either #pragma or #if directives would solve the problem neatly, but the 
problem there is that we'd need to have them retroactively. And there's 
zero chance of getting anything into earlier parsers now that everything 
before LC8 is going to be end-of-lifed.

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the use-livecode mailing list