Re: embed CR in constant

2015-08-28 Thread Mark Wieder

On 08/28/2015 09:31 AM, dunb...@aol.com wrote:


on MouseUp
  get "A" & CR & "B"
  constant embedCRInConstant = it
end mouseUp


No. You can't do that.

--
 Mark Wieder
 ahsoftw...@gmail.com

___
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: embed CR in constant

2015-08-28 Thread Mark Wieder

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
 ahsoftw...@gmail.com

___
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: embed CR in constant

2015-08-28 Thread Mike Bonner
You could put things together with a urlencoded cr, but then any time you
use the constant you'd have to urldecode it, which is kinda silly when you
can just use a property instead.

constant myConst="test%0D%0Aing"

on mouseup
   put urldecode(myConst)
end mouseup

output:
test
ing



On Fri, Aug 28, 2015 at 10:31 AM,  wrote:

> This may be a new instance of LC requiring two levels of evaluation, like
> "do" is used for in certain cases.
>
>
> Try this
>
>
> on MouseUp
>  get "A" & CR & "B"
>  constant embedCRInConstant = it
> end mouseUp
>
>
> Craig Newman
>
>
>
> -Original Message-
> From: Mike Kerner 
> To: How to use LiveCode 
> Sent: Fri, Aug 28, 2015 10:48 am
> Subject: embed CR in constant
>
>
> constant embedCRInConstant = "a"&CR&"b"
>
> throws an error.  Suggestions?
>
> --
>
> On the first day, God created the heavens and the Earth
> On the second day,
> God created the oceans.
> On the third day, God put the animals on hold for a few
> hours,
>and did a little diving.
> And God said, "This is
> good."
> ___
> 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
>
>
> ___
> 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
>
___
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: embed CR in constant

2015-08-28 Thread dunbarx
This may be a new instance of LC requiring two levels of evaluation, like "do" 
is used for in certain cases.


Try this


on MouseUp
 get "A" & CR & "B"
 constant embedCRInConstant = it
end mouseUp


Craig Newman



-Original Message-
From: Mike Kerner 
To: How to use LiveCode 
Sent: Fri, Aug 28, 2015 10:48 am
Subject: embed CR in constant


constant embedCRInConstant = "a"&CR&"b"

throws an error.  Suggestions?

--

On the first day, God created the heavens and the Earth
On the second day,
God created the oceans.
On the third day, God put the animals on hold for a few
hours,
   and did a little diving.
And God said, "This is
good."
___
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

 
___
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: embed CR in constant

2015-08-28 Thread Peter Haworth
It's been my experience that constants won;t accept any sort of expression
as a value, only string literals or numbers.

On Fri, Aug 28, 2015 at 7:48 AM Mike Kerner 
wrote:

> constant embedCRInConstant = "a"&CR&"b"
>
> throws an error.  Suggestions?
>
> --
> On the first day, God created the heavens and the Earth
> On the second day, God created the oceans.
> On the third day, God put the animals on hold for a few hours,
>and did a little diving.
> And God said, "This is good."
> ___
> 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
>
___
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