Re: Updating Text-Script Only Stacks in Run-Time, Message Path Memory

2016-11-06 Thread Monte Goulding

> On 7 Nov. 2016, at 6:37 pm, Mark Wieder  wrote:
> 
> Really?
> I can assign substacks to script-only stacks?
> I can use a script-only stack as a substack?

Sure but nothing but the stack script will save. I think for sanity we have 
disabled setting of substacks via the property inspector though.

A good chunk of the IDE is script only stacks that build their UI in script.

Cheers

Monte
___
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: Updating Text-Script Only Stacks in Run-Time, Message Path Memory

2016-11-06 Thread Mark Wieder

On 11/06/2016 01:00 PM, Monte Goulding wrote:


The IDE doesn’t know much about script only stacks so I’d be surprised if any 
differences in behaviour can be attributed to the fact it’s script only. There 
really is very little difference between a script only stack and a regular 
stack other than reading and writing to disk and a single boolean flag in the 
class.


Really?
I can assign substacks to script-only stacks?
I can use a script-only stack as a substack?

--
 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: Updating Text-Script Only Stacks in Run-Time, Message Path Memory

2016-11-06 Thread stephen barncard
On Sun, Nov 6, 2016 at 4:27 PM, Monte Goulding  wrote:

> Sure you can edit them in a text editor that’s fine. What we are talking
> about is having those changes update the version that is currently loaded
> into a running IDE.


I remember Jacque something about using 'revert' for a situation like this,
but that was for stack files.

there used to be a plugin that did this. Either Trevor or Ken Ray made it.

Stephen Barncard - Sebastopol Ca. USA -
mixstream.org
___
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: Updating Text-Script Only Stacks in Run-Time, Message Path Memory

2016-11-06 Thread Monte Goulding

> On 7 Nov. 2016, at 11:23 am, stephen barncard 
>  wrote:
> 
> We already edit livecode script-only-stacks on server.

Sure you can edit them in a text editor that’s fine. What we are talking about 
is having those changes update the version that is currently loaded into a 
running IDE.

Cheers

Monte
___
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: Updating Text-Script Only Stacks in Run-Time, Message Path Memory

2016-11-06 Thread stephen barncard
On Sun, Nov 6, 2016 at 1:00 PM, Monte Goulding  wrote:

> You only need to do that if you don’t edit in the IDE. I don’t believe
> there’s ever been official support for editing stack scripts outside the
> IDE.


We already edit livecode script-only-stacks on server.

The only caveat. I would imagine is to make sure the editor you use has the
correct text attributes and line termination values.  When I use Coda  or
Textmate in conjunction with Transmit, double clicking a file in the FTP
listing will launch the chosen editor, open the text in a page, and when
one saves, it saves back to the file, wherever it is, and the FTP program
keeps it all straight.  I've edited stacks on a remote server and launched
my local Livecode app this way too.

Anyway, that was long winded.  Make sure your editor puts out the right
sentence termination characters.

Stephen Barncard - Sebastopol Ca. USA -
mixstream.org
___
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: Updating Text-Script Only Stacks in Run-Time, Message Path Memory

2016-11-06 Thread Monte Goulding

> On 7 Nov. 2016, at 7:52 am, Mark Wieder  wrote:
> 
> If I edit a behavior script then I expect objects using that behavior script 
> to use the new features as soon as I compile the script. I would expect that 
> the same would be true of script-only stacks: I edit the script, and on 
> saving the text I would expect it to modify what the script does.

It does as long as you edit it in the IDE. If you don’t want to edit in the IDE 
then you need something like the external editor solution that is around or 
something that just polls the file to check for an update then applies the 
script.

> I don't expect that I would have to unload and reload (or whatever the proper 
> procedure is) to get the code to stick.

You only need to do that if you don’t edit in the IDE. I don’t believe there’s 
ever been official support for editing stack scripts outside the IDE.
> 
> If the script doesn't compile then of course I wouldn't expect the executing 
> code to change. But that's no different from the way things work now: my 
> experience has been that script-only stacks will fail silently on errors or 
> in ways that give no clue as to what went wrong.

The IDE doesn’t know much about script only stacks so I’d be surprised if any 
differences in behaviour can be attributed to the fact it’s script only. There 
really is very little difference between a script only stack and a regular 
stack other than reading and writing to disk and a single boolean flag in the 
class.

Cheers

Monte
___
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: Updating Text-Script Only Stacks in Run-Time, Message Path Memory

2016-11-06 Thread Mark Wieder

On 11/06/2016 11:36 AM, Monte Goulding wrote:


This introduces some interesting initialisation issues. What if the 
initialisation is the thing that changed? What if script local values are not 
appropriate for the new version? What if there’s some self generating UI that 
isn’t there because only the script was updated. What if I’m mid merge or 
rebase and there’s conflict markers in the file so it doesn’t compile?


I don't think this is specific to script-only stacks.
If I have an initialization routine in a sscript and I edit the script 
in the IDE, I won't expect it to get called unless I do so explicitly.


If I edit a behavior script then I expect objects using that behavior 
script to use the new features as soon as I compile the script. I would 
expect that the same would be true of script-only stacks: I edit the 
script, and on saving the text I would expect it to modify what the 
script does. I don't expect that I would have to unload and reload (or 
whatever the proper procedure is) to get the code to stick.


If the script doesn't compile then of course I wouldn't expect the 
executing code to change. But that's no different from the way things 
work now: my experience has been that script-only stacks will fail 
silently on errors or in ways that give no clue as to what went wrong.


--
 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: Stack name conflicts resolved?

2016-11-06 Thread Monte Goulding

> On 7 Nov. 2016, at 3:57 am, Mark Wieder  wrote:
> 
> Now rename the second stack to "Untitled 1"
> 
> The property inspector allows this, but now gets very confused.

Ah… well that’s probably a bug. If the IDE can’t handle multiple stacks with 
the same name it should not allow this. Even if the IDE were refactored to only 
refer to stacks by long ID it would still get confused by multiple stacks with 
the same name that are unsaved. I think the solution is a more robust object 
handle we can use in scripts it would help I think. Ideally we can get a handle 
to an object and pass it around and it won’t matter how much we change the ID 
or name of the object the handle will still be valid. If we had that then we 
could get lists of stack handles and not get confused if there are multiple 
with the same name.

Cheers

Monte
___
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: How can we dynamically create variable names from changing value "x" on a loop?

2016-11-06 Thread dunbarx
Hi.

Arrays are so new_fashioned.

But do you mean something like this, from the stone age, that creates
variables on the fly, in this case with 2X the value of an index?

on mouseUp
   repeat with y = 1 to 10
  do "put y * 2 into onTheFlyVar" & y
   end repeat
end mouseUp

Craig





--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/How-can-we-dynamically-create-variable-names-from-changing-value-x-on-a-loop-tp4710128p4710142.html
Sent from the Revolution - User mailing list archive at Nabble.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: export snapshot

2016-11-06 Thread Paul Hibbert

> On Nov 6, 2016, at 11:54 AM, hh  wrote:
> 
> Tested to work here in LC 9.0.0-dp1 on
> 
> MacOS 10.12.1
> Win 7/10
> Linux (Mint173)
> 
> on mouseUp
>   put specialfolderPath(home)&"/test.png" into sph
>   export snapshot from img "test" to file sph as PNG
> end mouseUp
> 
> So you could test whether you have write permission in the
> folder where you wish to write to.

A very good point, I found the defaultFolderPath was set to;

/Users/paulhibbert/Library/Application Support/RunRev/Documentation 
Cache/9_0_0_dp_1_commercial/IDE

After I had been using the dictionary I presume.

So that wasn’t going to work out well! In fact LC9.0.0(dp1) did write the file, 
it just wasn’t where I expected it to be, but that’s because I didn’t control 
the destination in my (quick) experiment - another lesson learnt. :)

Paul
___
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

2016-11-06 Thread hh
Tested to work here in LC 9.0.0-dp1 on

MacOS 10.12.1
Win 7/10
Linux (Mint173)

on mouseUp
   put specialfolderPath(home)&"/test.png" into sph
   export snapshot from img "test" to file sph as PNG
end mouseUp

So you could test whether you have write permission in the
folder where you wish to write to.

___
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: selectedText

2016-11-06 Thread Paul Hibbert

> On Nov 6, 2016, at 9:41 AM, Richmond  > wrote:
> 
> I wonder why this:
> 
> set text of the selectedText to numToCodePoint(2309)
> 
> [when I have a textField with a selection point within it]
> 
> doesn't work (LC 8.1).
> 
> Richmond.

I didn’t expect it to work (set property of a function?), but it does here on 
Mac in LC8.1.1(rc2) and LC9.0.0(dp1), either of the following seem to have the 
desired effect;
put numToCodePoint(2309) into the selection

put numToCodePoint(2309) into the selectedText

Paul
___
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: Updating Text-Script Only Stacks in Run-Time, Message Path Memory

2016-11-06 Thread Monte Goulding

> On 7 Nov. 2016, at 3:23 am, Mark Wieder  wrote:
> 
> But...
> shouldn't that be the big advantage of script-only stacks?

I think this would be relatively handy for trivial stacks but have issues for 
more complicated ones. Also consider why should this only be the case for 
script only stacks? If I git checkout and I have a binary stack diff shouldn’t 
that stack reload too? After all there could be dependencies between the script 
only stacks and the binary one (they could be its behaviors or something). 

This introduces some interesting initialisation issues. What if the 
initialisation is the thing that changed? What if script local values are not 
appropriate for the new version? What if there’s some self generating UI that 
isn’t there because only the script was updated. What if I’m mid merge or 
rebase and there’s conflict markers in the file so it doesn’t compile? 

I guess it’s possibly OK to have a go updating and the user can restart if they 
need but I’m not overly sure it’s a good idea.

Cheers

Monte
___
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

2016-11-06 Thread Paul Hibbert

> On Nov 6, 2016, at 3:27 AM, Richmond  > wrote:
> 
> I wonder why?


It seems the ‘export snapshot from’ doesn’t like the ‘img’ form, whereas, in a 
simple experiment the following does work in LC8.1.1(rc2);

export snapshot from control "met" to file "met.png" as png

Although neither option seems to work in LC9.0.0(dp1)!

So I’d suggest there is a bug, or at least, inconsistencies across versions, 
just as you found out.

Paul
___
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: Background colour of a new stack

2016-11-06 Thread Randy Hengst
Glad it helped.

be well,
randy

Randy Hengst
www.classroomFocusedSoftware.com



> On Nov 5, 2016, at 5:46 PM, Graham Samuel  wrote:
> 
> Thanks Randy, I hadn’t realised I could do that. Excellent!
> 
> Graham
> 
>> On 5 Nov 2016, at 22:40, Randy Hengst  wrote:
>> 
>> Graham,
>> 
>> I also thought the change of color to be a bit odd. 
>> 
>> If I understood you correctly, you are adding a graphic to “cover up” the 
>> gray background. You don’t need to add a graphic to create the white 
>> background. Go to the Stack Inspector and change the backgroundColor to 
>> white. Then each card you make in the stack will have the white background.
>> 
>> be well,
>> randy
>> 
>> Randy Hengst
>> www.classroomFocusedSoftware.com
>> 
>> 
>> 
>>> On Nov 5, 2016, at 4:30 PM, Richard Gaskin  
>>> wrote:
>>> 
>>> Graham Samuel wrote:
>>> 
 This may be old news to some, but in the LC7x series and earlier, if
 you created a stack, the card displayed as white. In LC 8.1.1, it
 displays as grey (reported as 220,220,220). To make cards look the
 way they did in earlier versions, I have to created a background
 rectangle graphic specifically coloured white.
 
 Was this a deliberate change? Or have I  made some odd mistake? Looks
 like I need to tweak some cards.
>>> 
>>> I believe the current default background is inherited from the OS, part of 
>>> the theming enhancements that make LC 8 much more HIG-savvy than earlier 
>>> versions.
>>> 
>>> -- 
>>> Richard Gaskin
>>> Fourth World Systems
>>> Software Design and Development for the Desktop, Mobile, and the Web
>>> 
>>> ambassa...@fourthworld.comhttp://www.FourthWorld.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
>> 
>> ___
>> 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

selectedText

2016-11-06 Thread Richmond

I wonder why this:

set text of the selectedText to numToCodePoint(2309)

[when I have a textField with a selection point within it]

doesn't work (LC 8.1).

Richmond.

___
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: How can we dynamically create variable names from changing value "x" on a loop?

2016-11-06 Thread Mike Bonner
Why not just leave it as an array?  In fact, if you want to have separate
preferences categories, that's easy enough to do too.

local sPrefsA

put getPref ("preferences/modules/color-meditation") into
sPrefsA[ColorMedPrefs]

at this point you have an local script array variable structured like so..
sprefsA
  colormedprefs
  breathcount = 5
  breathPace = 1
  cycles = 2
  audio on = true

to get a value from above, a simple function works..

function getSinglePref prefCat,prefName
 if prefcat is among the keys of sPrefsA
 if prefName is among the keys of sPrefsA[prefCat] then
  return sPrefsA[prefCat][prefName]
 else
  answer information "No such preference"
 end if
 else
  answer information "No such preference category"
  end if
end getSinglePref

If you don't need to categorize, change it to this..

put getPref ("preferences/modules/color-meditation") into sPrefsA

at which point you can retrieve a value with sPrefsA[prefname]


The code above is just off the top of my head, but it should be close.

On Sun, Nov 6, 2016 at 8:50 AM, Sannyasin Brahmanathaswami  wrote:

> Given this scenario:
>
> We fetch a preference array from some json on disk
> We want to insert the key-values into separate discrete local vars in the
> stack script
>
> function getUserPreferences
>
> # the following function fetches an object in a JSON file:
>
> put getPref ("preferences/modules/color-meditation") into aColorMedPrefs
>
> # aColorMedPrefs now appears in variable watcher with keys
> # aColorMedPrefs["BreathCount"] # value = 5
> # aColorMedPrefs["BreathPace,"] # value = 1
> # aColorMedPrefs["Cycles "] # value = 2
> # aColorMedPrefs["AudioOn"] # value = "true"
>
> # we want to pass each to a discrete local:
> # sBreathCount,sBreathPace,sCycles,sAudioOn
>
>  repeat for each key x in aColorMedPrefs
> put "s" & x into tNextPref
> put aColorMedPrefs[x] into tNextPref
> put tNextPref & comma after tSettings
> end repeat
>
> return tSettings
>
> # result:  "5,1,2,true"  i.e. the values
>
> # But what we really want to do was insert those values in the local vars
> on each iteration.
>
>   return (sBreathCount,sBreathPace,sCycles,sAudioOn) # would also return
> "5,1,2,true"# but we get ",,," i.e now values.
> end getUserPreferences
> 
> i.e. how do we dynamically create/name/instantiate variables & set their
> values from values in a loop?
>
> it begs for some syntax like
>
> create var ("s" & x); put x into the last var
>
> BR
>
> ___
> 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: OT - cross platform zero slashed font

2016-11-06 Thread David V Glasgow
Belated thanks Richmond and Jeanne

Best 

David Glasgow
> On 24 Oct 2016, at 6:37 am, Jeanne A. E. DeVoto  
> wrote:
> 
> At 4:52 PM +0100 10/18/2016, David V Glasgow wrote:
>> Is there really no cross platform zero slashed (like Monaco 0) font? Is 
>> there one which is substituted by another zero slashed font on different 
>> platforms?
> 
> 
> If you just need a font where the 0 character has a slash (or dot), we 
> discussed a few last month. People seemed to like:
> 
> Source Code Pro
> Hack: http://sourcefoundry.org/hack/
> Input Mono: http://input.fontbureau.com/
> 
> They all have a slashed or dotted zero.
> 
> ___
> 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: Stack name conflicts resolved?

2016-11-06 Thread Mark Wieder

On 11/05/2016 09:38 PM, Monte Goulding wrote:



On 6 Nov. 2016, at 1:31 pm, Mark Wieder  wrote:

When new stacks are created in memory they are assigned the id 1002.
Why?
If there's a stack already in memory why not create the new stack with the next 
sequential id?
Then the combination of id and filename should uniquely identify a stack.


Stack IDs aren’t really IDs at all they are just the max ID in a stack + 1. The 
first 1000 IDs are reserved. Card 1 is 1001 and therefore a new stack ID is 
1002. Create a new object and the ID changes.


Yes, good point, but here's the thing:

Create two new stacks.
They both have the "ID" 1002.
Set the id of the second stack to 3000.
Now you have stacks 1002 and 3000.
Add a button to each stack.
The stack ids are now 1003 and 3001.

They're obviously different stacks.
You see two stacks on the screen, they have different ids.
Now rename the second stack to "Untitled 1"

The property inspector allows this, but now gets very confused.
If you try to bring up the property inspector of either stack, you get 
only the first one it comes across, until you rename one.


I'd prefer the creation timestamp as a unique identifier for stacks, but 
whatever we use, the short name by itself is inadequate to the task.


--
 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: export snapshot

2016-11-06 Thread Mark Wieder

On 11/06/2016 03:31 AM, Peter TB Brett wrote:


Because the correct syntax is:

export snapshot of img "met" to file "met.png" as png


My reading of the syntax from the documentation allows the 'from object' 
form:


export snapshot [from rect[angle] rectangle] [of object(glossary)] 
[(with | without) effects] ... | [from object] [{with|and} metadata 
metadata] to {file filePath | container} [as format] [with mask maskFile]


And, from the documentation examples:

export snapshot from Field 1 to file "File1.png" as PNG

export snapshot from Group 1 with metadata theMetadataArray to file 
"File2.jpg" as JPEG


--
 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: Updating Text-Script Only Stacks in Run-Time, Message Path Memory

2016-11-06 Thread Mark Wieder

On 11/05/2016 09:31 PM, Monte Goulding wrote:

> Of course if you are making changes in a text editor and expecting 
those to be reflected in the running IDE then you are out of luck.


But...
shouldn't that be the big advantage of script-only stacks?

--
 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


How can we dynamically create variable names from changing value "x" on a loop?

2016-11-06 Thread Sannyasin Brahmanathaswami
Given this scenario:

We fetch a preference array from some json on disk
We want to insert the key-values into separate discrete local vars in the stack 
script

function getUserPreferences

# the following function fetches an object in a JSON file:

put getPref ("preferences/modules/color-meditation") into aColorMedPrefs

# aColorMedPrefs now appears in variable watcher with keys
# aColorMedPrefs["BreathCount"] # value = 5
# aColorMedPrefs["BreathPace,"] # value = 1
# aColorMedPrefs["Cycles "] # value = 2
# aColorMedPrefs["AudioOn"] # value = "true"

# we want to pass each to a discrete local:
# sBreathCount,sBreathPace,sCycles,sAudioOn

 repeat for each key x in aColorMedPrefs
put "s" & x into tNextPref
put aColorMedPrefs[x] into tNextPref
put tNextPref & comma after tSettings
end repeat

return tSettings

# result:  "5,1,2,true"  i.e. the values

# But what we really want to do was insert those values in the local vars on 
each iteration.

  return (sBreathCount,sBreathPace,sCycles,sAudioOn) # would also return
"5,1,2,true"# but we get ",,," i.e now values.
end getUserPreferences

i.e. how do we dynamically create/name/instantiate variables & set their values 
from values in a loop?

it begs for some syntax like

create var ("s" & x); put x into the last var

BR

___
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: Find chars

2016-11-06 Thread Mike Bonner
There is an optional "form" that can be specified with find, so it looks
like it still exisits.
form enum

If no *form* is specified, the normal form is used. anywhere in the field's
words

One of the following items:

   - normal -Find each word in textToFind, at start of the field's words
   - characters, character, chars, char -Find each word in textToFind,
   - words, word -Find each word in textToFind, as complete words
   - whole -Find the whole of textToFind, as a sequence of complete words
   - string -Find the whole of textToFind, anywhere


On Sun, Nov 6, 2016 at 6:20 AM, Richmond 
wrote:

> Hey: on page 58 of theDanny Goodman Complete Hypercard Handbook 4th
> Edition there is talk
> of a "find chars" function in Hypercard . . . it doesn't seem to have
> survived in Livecode . . . ?
>
> Richmond
>
> ___
> 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: Recoding: search and replace

2016-11-06 Thread Mike Bonner
Using a backup of course.. You might try something simple like..

repeat for each line tline in the script of stack "yourscripttarget"--
wherever your script is.
   if tline contains "set the unicodetext of fld " & quote & "fDECODE"&
quote & " to (numtocodepoint(" then
  replace "set the unicodetext of fld " & quote & "fDECODE"& quote & "
to " with "put " in tline
  put " into field " & quote & "fDECODE" & quote after tLine
  put tline & cr after tNewScript
   else
  put tline & cr after tNewScript
   end if
end repeat
delete the last char of tNewScript

set the script of stack "yourscripttarget" to tNewScript



On a very small test scale it seems to work.  Curious though, is the
current method working?

On Sun, Nov 6, 2016 at 6:22 AM, Richmond 
wrote:

> Thanks: I hope you manage to get some rest.
>
> Richmond
>
>
> On 6.11.2016 15:19, hh wrote:
>
>> I'm so tired, but there is an exit from my typos:
>>
>> function numToCode n
>> return numToCodePoint(n)
>> end numToCode
>>
>> ;-)
>>
>> ___
>> 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: Recoding: search and replace

2016-11-06 Thread Richmond

Thanks: I hope you manage to get some rest.

Richmond

On 6.11.2016 15:19, hh wrote:

I'm so tired, but there is an exit from my typos:

function numToCode n
return numToCodePoint(n)
end numToCode

;-)

___
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


Find chars

2016-11-06 Thread Richmond
Hey: on page 58 of theDanny Goodman Complete Hypercard Handbook 4th 
Edition there is talk
of a "find chars" function in Hypercard . . . it doesn't seem to have 
survived in Livecode . . . ?


Richmond

___
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: Recoding: search and replace

2016-11-06 Thread hh
I'm so tired, but there is an exit from my typos:

function numToCode n
   return numToCodePoint(n)
end numToCode

;-)

___
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: Recoding: search and replace

2016-11-06 Thread hh
> Richmond M. wrote:
> *put (numToCodePoint(107) & numToCodePoint(104)) into \
>  fld "fDECODE"* where /(numToCodePoint(107) & numToCodePoint(104))/ vary?

You could try

put "107,104" & "104,107"  & ... into myNums

repeat for each line L in myNums
  put numTocode(item 1 of L) & numToCode(item 2 of L) into fld "fDECODE"
end repeat


___
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: curioser and curioser

2016-11-06 Thread Richmond

Ha, Ha . . .

Where I stay, in the conservative Balkans, there is only one Trans in 
the town!


Richmond.

On 6.11.2016 14:11, hh wrote:

Richmond M. wrote:
.. put numToCodePoint(107) into fld "TRANZ" which worked
perfectly OK in 4.5 does NOT work in 8.1 HOWEVER; if I
rename fld "TRANZ" to "fTRANZ" this works:
put numToCodePoint(107) into fld "fTRANZ"

Such effects usually indicate that there was more than one field
named "TRANZ".

Herlock Sholmes

___
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


Recoding: search and replace

2016-11-06 Thread Richmond

I wonder if there is a way to replace this:

set the unicodeText of fld "fDECODE" to (numToCodePoint(107) & 
numToCodePoint(104))


with this:

*put (numToCodePoint(107) & numToCodePoint(104)) into fld "fDECODE"*

where /(numToCodePoint(107) & numToCodePoint(104))/ vary?

I have no great urge to do that sort of thing manually about 6 million 
times.


Richmond.
___
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: curioser and curioser

2016-11-06 Thread hh
> Richmond M. wrote:
> .. put numToCodePoint(107) into fld "TRANZ" which worked
> perfectly OK in 4.5 does NOT work in 8.1 HOWEVER; if I
> rename fld "TRANZ" to "fTRANZ" this works:
> put numToCodePoint(107) into fld "fTRANZ"

Such effects usually indicate that there was more than one field
named "TRANZ".

Herlock Sholmes

___
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


curioser and curioser

2016-11-06 Thread Richmond

I am currently recoding my Devawriter Pro from Livecode 4.5 to Livecode 8.1,
and it is proving rather more long-winded than I had envisaged.

For instance:

put numToCodePoint(107) into fld "TRANZ"

which worked perfectly OK in 4.5 does NOT work in 8.1

HOWEVER; if I rename fld "TRANZ" to "fTRANZ" this works:

put numToCodePoint(107) into fld "fTRANZ"

Am I to conclude that Livecode 8.1 is guilty of discriminating against 
LGBT fields?


Richmond.

___
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

2016-11-06 Thread Richmond

So: when I did as you instructed I got this:

Script compile error:
Error description: export: missing 'to'

Richmond.

On 6.11.2016 13:31, Peter TB Brett wrote:

On 06/11/2016 11:27, Richmond wrote:

I tried this:

export snapshot from img "met" to file "met.png" as PNG

and that worked in 7.1.4

but did NOT work in 8.1

I wonder why?


Because the correct syntax is:

export snapshot of img "met" to file "met.png" as png

 Peter




___
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

2016-11-06 Thread Richmond

Thanks: although I have been using "from" for years with no problems at all:
I can only conclude that 8.1 is "fussier" than 7.1.4

Richmond.

On 6.11.2016 13:31, Peter TB Brett wrote:

On 06/11/2016 11:27, Richmond wrote:

I tried this:

export snapshot from img "met" to file "met.png" as PNG

and that worked in 7.1.4

but did NOT work in 8.1

I wonder why?


Because the correct syntax is:

export snapshot of img "met" to file "met.png" as png

 Peter




___
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

2016-11-06 Thread Peter TB Brett

On 06/11/2016 11:27, Richmond wrote:

I tried this:

export snapshot from img "met" to file "met.png" as PNG

and that worked in 7.1.4

but did NOT work in 8.1

I wonder why?


Because the correct syntax is:

export snapshot of img "met" to file "met.png" as png

 Peter

--
Dr Peter Brett 
LiveCode Technical Project Manager

lcb-mode for Emacs: https://github.com/peter-b/lcb-mode

___
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

2016-11-06 Thread Richmond

I tried this:

export snapshot from img "met" to file "met.png" as PNG

and that worked in 7.1.4

but did NOT work in 8.1

I wonder why?

Richmond.

___
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