embed CR in constant

Mark Wieder mwieder at ahsoftware.net
Fri Aug 28 22:17:05 EDT 2015


On 08/28/2015 07:47 AM, Mike Kerner wrote:
> constant embedCRInConstant = "a"&CR&"b"
>
> throws an error.  Suggestions?

I first logged this as a bug in 2004.
(http://quality.runrev.com/show_bug.cgi?id=1241)
The current bug number is 12802, and the other reports (1241, 3680, 
8737, 13955) have been "resolved" as duplicates of that one, although 
the "resolved" status of the many bug reports is somewhat in question.

You can now use negative numbers as constants. That seems to be fixed in 
build 7.0-rc1. Otherwise constants can only be strings or numbers.

The way I get around this is by defining ersatzConstants:

local kConstantButNotReally = ""

-- initialize it in preOpenStack
  put some_value into kConstantButNotReally
-- then treat it like a constant

-- 
  Mark Wieder
  ahsoftware at gmail.com




More information about the use-livecode mailing list