Re: export snapshot woverwrites variable?

2020-12-10 Thread Klaus major-k via use-livecode
Hi Mark,

> Am 10.12.2020 um 15:25 schrieb Mark Waddingham via use-livecode 
> :
> 
> On 2020-12-10 13:55, Klaus major-k via use-livecode wrote:
>> Hi friends,
>> ## Doing this again fixes the inconvenience and I can continue:
>> put dasObjekt() into tObject
>> ...
>> Funky, funky!?
> Nope - not funky.

a littel bit? 8-)

> Container syntax can be either a variable (with array indices or without), or 
> an object chunk which has a notion of 'text' (i.e. button, field, image).
> If it is a variable then the variable gets modified.
> If it is an object chunk then the text of the object gets changed.
> Variables are only treated as (potential) object chunks when being evaluated 
> as a source, and only then if the thing operating on them expects an object. 
> e.g. the blendLevel of tObject (property syntax only makes sense when 
> targetting an object chunk, so the contents of tObject are parsed as a 
> control chunk).
> Indeed, if this wasn't the case then you wouldn't ever be able to change 
> tObject in the following script:
>  local tObject
>  put the long id of field 1 into tObject
>  -- If variable containers (targets) resolved as objects first:
>  put "foo" into tObject -- this would set the text of the field to "foo"
> 
> Warmest Regards,
> 
> Mark.

thank you for this explanation, wil take this into account the next time!


Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
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: export snapshot woverwrites variable?

2020-12-10 Thread Mark Waddingham via use-livecode

On 2020-12-10 13:55, Klaus major-k via use-livecode wrote:

Hi friends,

## Doing this again fixes the inconvenience and I can continue:
put dasObjekt() into tObject
...

Funky, funky!?


Nope - not funky.

Container syntax can be either a variable (with array indices or 
without), or an object chunk which has a notion of 'text' (i.e. button, 
field, image).


If it is a variable then the variable gets modified.

If it is an object chunk then the text of the object gets changed.

Variables are only treated as (potential) object chunks when being 
evaluated as a source, and only then if the thing operating on them 
expects an object. e.g. the blendLevel of tObject (property syntax only 
makes sense when targetting an object chunk, so the contents of tObject 
are parsed as a control chunk).


Indeed, if this wasn't the case then you wouldn't ever be able to change 
tObject in the following script:


  local tObject
  put the long id of field 1 into tObject

  -- If variable containers (targets) resolved as objects first:
  put "foo" into tObject -- this would set the text of the field to 
"foo"


Warmest Regards,

Mark.

--
Mark Waddingham ~ m...@livecode.com ~ http://www.livecode.com/
LiveCode: Everyone can create apps

___
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: export snapshot woverwrites variable?

2020-12-10 Thread Klaus major-k via use-livecode
Hi all,

> Am 10.12.2020 um 15:08 schrieb Brian Milby via use-livecode 
> :
> 
> What about using (tObject)?  Since tObject is a container itself, the export 
> put the data in the container directly instead of the referenced container?
> Sent from my iPhone
>> On Dec 10, 2020, at 8:56 AM, Klaus major-k via use-livecode 
>>  wrote:
>> Hi friends,
>> just found a very strange thing...
>> I have this script:
>> ...
>> put dasObjekt() into tObject
>> ## returns in this special case -> image "Bild_1"
>> flip tObject horizontal
>> # Overwrite image data
>> export snapshot from rect(the rect of tObject) of tObject to tObject as PNG
>> ## But now, LC gives an error indication that tObject now contains the DATA 
>> of the new PNG
>> ## Hint: åPNG...
>> ## And yes, the palette in the debugger shows the complete PNG binary data 
>> instead of -> image "Bild_1"
>> ## as the content of tObject
>> ## Doing this again fixes the inconvenience and I can continue:
>> put dasObjekt() into tObject
>> ...

I finally solved it with resolving the actual NAME of the image:
...
## Yes, we have a function for everything! :-)
put dasObjekt2() into tObject
## -> Bild_1
...
export snapshot from rect(the rect of img tName) of img tName to img tName as 
PNG
...


Best

Klaus
--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
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: export snapshot woverwrites variable?

2020-12-10 Thread Klaus major-k via use-livecode
Hi Brian,

> Am 10.12.2020 um 15:08 schrieb Brian Milby via use-livecode 
> :
> 
> What about using (tObject)?  

sorry, no capisce?

> Since tObject is a container itself, the export put the data in the container 
> directly instead of the referenced container?

Hm, I thought you were working at Livecode and could answer this? :-D
But yes, obvioulsy, question is: desired/correct behviour?
Should I use DO somehow here?

> Sent from my iPhone
> 
>> On Dec 10, 2020, at 8:56 AM, Klaus major-k via use-livecode 
>>  wrote:
>> 
>> Hi friends,
>> 
>> just found a very strange thing...
>> I have this script:
>> ...
>> put dasObjekt() into tObject
>> ## returns in this special case -> image "Bild_1"
>> 
>> flip tObject horizontal
>> # Overwrite image data
>> export snapshot from rect(the rect of tObject) of tObject to tObject as PNG
>> 
>> ## But now, LC gives an error indication that tObject now contains the DATA 
>> of the new PNG
>> ## Hint: åPNG...
>> ## And yes, the palette in the debugger shows the complete PNG binary data 
>> instead of -> image "Bild_1"
>> ## as the content of tObject
>> 
>> ## Doing this again fixes the inconvenience and I can continue:
>> put dasObjekt() into tObject
>> ...
>> 
>> Funky, funky!?

Best

Klaus

--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
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: export snapshot woverwrites variable?

2020-12-10 Thread Brian Milby via use-livecode
What about using (tObject)?  Since tObject is a container itself, the export 
put the data in the container directly instead of the referenced container?

Sent from my iPhone

> On Dec 10, 2020, at 8:56 AM, Klaus major-k via use-livecode 
>  wrote:
> 
> Hi friends,
> 
> just found a very strange thing...
> I have this script:
> ...
> put dasObjekt() into tObject
> ## returns in this special case -> image "Bild_1"
> 
> flip tObject horizontal
> # Overwrite image data
> export snapshot from rect(the rect of tObject) of tObject to tObject as PNG
> 
> ## But now, LC gives an error indication that tObject now contains the DATA 
> of the new PNG
> ## Hint: åPNG...
> ## And yes, the palette in the debugger shows the complete PNG binary data 
> instead of -> image "Bild_1"
> ## as the content of tObject
> 
> ## Doing this again fixes the inconvenience and I can continue:
> put dasObjekt() into tObject
> ...
> 
> Funky, funky!?
> 
> 
> Best
> 
> Klaus
> --
> Klaus Major
> https://www.major-k.de
> kl...@major-k.de
> 
> 
> ___
> 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


export snapshot woverwrites variable?

2020-12-10 Thread Klaus major-k via use-livecode
Hi friends,

just found a very strange thing...
I have this script:
...
put dasObjekt() into tObject
## returns in this special case -> image "Bild_1"

flip tObject horizontal
# Overwrite image data
export snapshot from rect(the rect of tObject) of tObject to tObject as PNG

## But now, LC gives an error indication that tObject now contains the DATA of 
the new PNG
## Hint: åPNG...
## And yes, the palette in the debugger shows the complete PNG binary data 
instead of -> image "Bild_1"
## as the content of tObject

## Doing this again fixes the inconvenience and I can continue:
put dasObjekt() into tObject
...

Funky, funky!?


Best

Klaus
--
Klaus Major
https://www.major-k.de
kl...@major-k.de


___
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