Re: How do you build the tabs like in the script editor

2011-06-06 Thread Peter Brigham MD
On Jun 6, 2011, at 6:49 PM, Jim Ault wrote:

> It is like clicking the same radio button in a group.
> If the user makes the same choice in a menu, since there is no change, should 
> the menupick report it?

If a tree falls in the forest and nobody is there to hear it, does it make a 
sound?

Or, If a man speaks in a forest and there is no woman around to hear him, is he 
still wrong?

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: What's the syntax to check if a local folder exists?

2011-06-07 Thread Peter Brigham MD
Sure -- what you get instead of true or false is "damn right there ain't no 
damn folder!" or "of course the damn folder exists, stupid!"

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jun 7, 2011, at 12:06 PM, Bob Sneidar wrote:

> will it support double negative expletives like "ain't no damned folder"?
> 
> Bob
> 
> 
> On Jun 7, 2011, at 8:55 AM, Richard Gaskin wrote:
> 
>> Bob Sneidar wrote:
>>> You can say "there is not"?? Well I'll be damned!
>> 
>> And don't forget the most important request in the RQCC, Jeanne's suggestion 
>> for adding an "aint" operator:
>> 
>> 
>> 
>> :)
>> 
>> --
>> Richard Gaskin
>> Fourth World
>> LiveCode training and consulting: http://www.fourthworld.com
>> Webzine for LiveCode developers: http://www.LiveCodeJournal.com
>> LiveCode Journal blog: http://LiveCodejournal.com/blog.irv
>> 
>> ___
>> 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: [OT] Apple at it again

2011-06-09 Thread Peter Brigham MD
On Jun 9, 2011, at 1:34 PM, Bob Sneidar wrote:

> I never listen to what people say. I only listen to what they mean. ;-)
> 
> Bob

Now, what exactly do you mean by that? (I speak as a psychiatrist...)

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




___
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] Apple at it again

2011-06-09 Thread Peter Brigham MD

On Jun 9, 2011, at 2:44 PM, Richmond Mathewson wrote:

> Hey; and if I land the role, I promise NOT to wear my leopard-skin posing 
> briefs . . .
> 
> . . . whoops, wait a minute . . . Leopard is out . . . I meant to say 
> "lion-skin posing briefs" . . .  :)

Better not... as we have been hearing, Lion is full of bugs. You don't want to 
find out just what kind of bugs, not in that way.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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] Apple at it again

2011-06-09 Thread Peter Brigham MD
I'm not sure.

("If you can't be kind, at least have the decency to be vague.")

:-)

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jun 9, 2011, at 6:36 PM, Bob Sneidar wrote:

> What are you saying? (I speak as a patient...)
> 
> Bob
> 
> 
> On Jun 9, 2011, at 3:04 PM, Peter Brigham MD wrote:
> 
>> On Jun 9, 2011, at 1:34 PM, Bob Sneidar wrote:
>> 
>>> I never listen to what people say. I only listen to what they mean. ;-)
>>> 
>>> Bob
>> 
>> Now, what exactly do you mean by that? (I speak as a psychiatrist...)
>> 
>> -- Peter
>> 
>> Peter M. Brigham
>> pmb...@gmail.com
>> http://home.comcast.net/~pmbrig
>> 
>> 
>> 
>> 
>> ___
>> 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: How to structure HTML text (tags and attributes) for processing in LiveCode?

2011-06-12 Thread Peter Brigham MD
On Jun 12, 2011, at 5:24 PM, Jim Ault wrote:

> On Jun 12, 2011, at 1:15 PM, Keith Clarke wrote:
>> I am a LiveCode novice (<1 year, so still a Rookie!). So, part of the 
>> challenge with LiveCode (and indeed, software development in general for me) 
>> is understanding the art of the possible.
> 
> 
> 
> If you have a URL, I could give some concrete examples of good steps to 
> consider.
> The reality is that there are different ways that become easier depending on 
> the structure of the html.
> 
> If the page is a catalog or inventory page, there are lots of repeating 
> blocks of code.  If it is a set of tables, nested tables, or other cellular 
> structure, then the approach should be different.
> 
> If it is mostly text blocks in   without links, or with  tags, 
> again can change the structure of your repeat loops.
> 
> One approach is to keep replacing the html strings with delimiters, such as 
> tab, cr, ~, or a run of chars such as "" and then pase the resulting text 
> block.  There are almost too many ways to do this.  The key is to those that 
> fit together, rather than try to mix and match combinations of all of them.
> 
> This is usually a very confusing puzzle, since html offers so many variations 
> and exceptions.
> 
> Hope this helps rather than add to the confusion.
> 
> Jim Ault
> Las Vegas

One technique is to replace a repeating string that sets off pieces of content 
you want to isolate with a single character, e.g., 

   replace "" with divChar in tText

then use that as an itemdelim or linedelim to access "item n of tText" or "line 
n of tText"

You need to make sure that the characters you will use as delimiters are not 
found in the text. For HTML, all you have to do is use any higher-ASCII 
characters. Here is a way of doing that that actually works also with text that 
may contain high-ASCII characters, but you can use this fine to parse HTML text.

-

local lineChar, itemChar, cellDivChar
local textBlockDivider, frameDivider -- extras as needed

on assignDelims tText
   put getdelimiters(tText) into delimArray
   -- an array of high-ASCII characters not found in tText
   put "lineChar,itemChar, cellDivChar" into delimList
   -- add more if you want, these are 
   put the number of items of delimList into nbrDelimsNeeded
   repeat with i = 1 to nbrDelimsNeeded
  put delimArray[i] into tDelim
  if tDelim = empty then
 answer "Could only assign" && i-1 && "out of" && \
 nbrDelimsNeeded & "!"
 -- in case you have high nbrDelimsNeeded
 -- or tText contains lots of unusual characters,
 -- and the list of allowable delims is very short
 exit to top
  end if
  do "put tDelim into" && item i of delimList
   end repeat
   
   -- you can also do this manually, for one-off parsing jobs
   -- should check that delimArray[n] is not empty if in doubt
   -- (declare script local variables as needed)

   -- put delimArray[4] into textBlockDivider
   -- put delimArray[5] into frameDivider
   -- etc
end assignDelims

on getdelimiters tText
   if tText = empty then return empty
   put "ßπ∆ƒµ¡™£¢∞§¶ªç≈…æ∑ø©®Ω" into charList
   -- don't know if this will show well in all email clients
   -- it's a string of high-ASCII characters
   put 0 into tCount
   repeat for each char tChar in charList
  if tChar is in tText then next repeat
  add 1 to tCount
  put tChar into delimList[tCount]
   end repeat
   return delimList
end getdelimiters

Then you can do things like:

   replace cr with empty in tText
   -- html ignores cr's, and extraneous returns may complicate things
   replace "" with lineChar in tText
   replace "" with 
cellDivChar in tText
   -- or whatever the tag string is for this particular table

then:

   set the lineDelimiter to lineChar
   set the itemDelimiter to cellDivChar
   repeat for each line tLine in tText
  repeat for each item textRun in tLine
  -- do more parsing stuff here:
  -- now you can work on each block textRun
   end repeat
   end repeat

This helps to pare down some of the HTML formatting/tagging so as to use LC's 
powerful chunk manipulation to extract the content you want.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: horizontal and vertical scrolling

2011-06-16 Thread Peter Brigham MD
But when we finally make contact with another intelligent species, will we 
discover that all their cards are right-handed? (It goes with out saying that 
such a species will necessarily be using LiveCode.) If so, then importing any 
of their cards might result in the stack disappearing in a flash of high-energy 
photons That problem will be one of the knottiest the LC development team 
has had to tackle.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jun 16, 2011, at 1:07 PM, Bob Sneidar wrote:

> So you think that card creation would be racemic in nature? As many left 
> handed cards as right handed? But surely someone would soon come up with a 
> plugin that ensured an optically pure creation of new cards. Then we would be 
> back to where we are now, purely left handed cards, as it should be. 
> 
> Bob
> 
> On Jun 15, 2011, at 11:08 PM, Keith Clarke wrote:
> 
>> ...a kind of quantum scrolling/fixed duality inherent in cards, so we can 
>> know it's state by inserting an object - Shrödinger's card?
>> 
>> But then 50% of cards would be created with a scrollbar - unless of course, 
>> these are all non-local, sitting in the anti-stack that can't be accessed 
>> because it's in the >90% of dark code that fills all hard drives. 
>> 
>> That would explain the rumour that Time Machine was originally going to be 
>> called Space-Time Machine, but I'll resist considering why Parallels is 
>> really called that and instead, get some coffee! ;-)
>> Best,
>> Keith.. 
>> 
>> On 16 Jun 2011, at 05:44, Richard Gaskin wrote:
>> 
>>> Thomas McGrath III wrote:
>>> 
 Although, I suppose if you could group a card then you could scroll a card.
>>> 
>>> Actually, I believe empty cards do scroll.  ;)
>> 
>> 
>> ___
>> 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: horizontal and vertical scrolling

2011-06-16 Thread Peter Brigham MD
I'm a nerd and proud of it. My daughter once got me a button that read "I was 
cool before uncool was cool." (Actually, before all that I really was cool. But 
never to my daughter...)

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Jun 16, 2011, at 2:49 PM, Richmond Mathewson wrote:

> On 06/16/2011 09:43 PM, Bob Sneidar wrote:
>> You all realize how completely odd this line of humor would seem to someone 
>> who was not a nerd erm excuse me, a Professional Software Developer?
> 
> Umm; well, nobody around these parts would admit to being a nerd would they?
> 
> I have yet to become a Professional Software Developer . . . . . . .   :\
> 
>> Bob
>> 
>> 
>> On Jun 16, 2011, at 11:13 AM, Keith Clarke wrote:
>> 
>>> ...sure they'd use LiveCode but it's ridiculous to just blindly assume that 
>>> they'd have hands! ;-)
>>> Best,
>>> Keith..
>>> 
>>> On 16 Jun 2011, at 19:03, Peter Brigham MD wrote:
>>> 
>>>> But when we finally make contact with another intelligent species, will we 
>>>> discover that all their cards are right-handed? (It goes with out saying 
>>>> that such a species will necessarily be using LiveCode.) If so, then 
>>>> importing any of their cards might result in the stack disappearing in a 
>>>> flash of high-energy photons That problem will be one of the knottiest 
>>>> the LC development team has had to tackle.
>>>> 
>>>> -- Peter
>>>> 
>>>> Peter M. Brigham
>>>> pmb...@gmail.com
>>>> http://home.comcast.net/~pmbrig
>>>> 
>>>> 
>>>> On Jun 16, 2011, at 1:07 PM, Bob Sneidar wrote:
>>>> 
>>>>> So you think that card creation would be racemic in nature? As many left 
>>>>> handed cards as right handed? But surely someone would soon come up with 
>>>>> a plugin that ensured an optically pure creation of new cards. Then we 
>>>>> would be back to where we are now, purely left handed cards, as it should 
>>>>> be.
>>>>> 
>>>>> Bob
>>>>> 
>>>>> On Jun 15, 2011, at 11:08 PM, Keith Clarke wrote:
>>>>> 
>>>>>> ...a kind of quantum scrolling/fixed duality inherent in cards, so we 
>>>>>> can know it's state by inserting an object - Shrödinger's card?
>>>>>> 
>>>>>> But then 50% of cards would be created with a scrollbar - unless of 
>>>>>> course, these are all non-local, sitting in the anti-stack that can't be 
>>>>>> accessed because it's in the>90% of dark code that fills all hard drives.
>>>>>> 
>>>>>> That would explain the rumour that Time Machine was originally going to 
>>>>>> be called Space-Time Machine, but I'll resist considering why Parallels 
>>>>>> is really called that and instead, get some coffee! ;-)
>>>>>> Best,
>>>>>> Keith..
>>>>>> 
>>>>>> On 16 Jun 2011, at 05:44, Richard Gaskin wrote:
>>>>>> 
>>>>>>> Thomas McGrath III wrote:
>>>>>>> 
>>>>>>>> Although, I suppose if you could group a card then you could scroll a 
>>>>>>>> card.
>>>>>>> Actually, I believe empty cards do scroll.  ;)
>>> 
>>> ___
>>> 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


Re: [OT] Text analysis and author, anyone done it?

2011-06-25 Thread Peter Brigham MD
On Jun 25, 2011, at 3:48 AM, Peter Alcibiades wrote:

> Well just in case anyone ever does need to do it, here are two places to get
> started.  One is NLTK - the free Natural Language Toolkit and its associated
> free online book Natural Language Processing with Python.  Which appears to
> double as a Python tutorial, so its two for one.
> 
> http://www.nltk.org/book
> 
> Then there is this
> 
> http://cran.ma.imperial.ac.uk/web/views/NaturalLanguageProcessing.html

This link gives me a 404 error.

> which has a bunch of tools and material in R.  i guess we have all known
> that one day it was going to be our painful duty to learn R, but, like St
> Augustine, hoped it would not be yet.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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] Text analysis and author, anyone done it?

2011-06-25 Thread Peter Brigham MD
On Jun 24, 2011, at 11:46 PM, Peter Alcibiades wrote:

> It can be done statistically. Various methods have been proposed and used. 
> One general kind of measure is the probability of another word coming, as a
> function of the past n words.  Another is to measure the length of gap
> between occurrences of pairs of a given word.  There is technical literature
> on it, and I guess LC would permit writing something to do it.  Not that its
> the best thing to do it in, that seems to be R, but its what I know.
> 
> But it would be nice if someone had already done it, in any language.  Save
> a huge lot of work.
> Peter

Don't know if anyone has already tackled this kind of thing in LC, but it 
should be fairly easy to do. (Whether the algorithms actually work to 
distinguish different authors is something I know nothing about.) The gap 
between pairs of a given word, in particular, is nearly trivial. The question 
would be speed, and since LC is blindingly fast at processing text strings, I'd 
be optimistic about that, unless you're talking really huge texts.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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] Amiga OS in 2011

2011-06-29 Thread Peter Brigham MD
I have a sundial in my back yard. Sure, it's not quite as convenient as a 
watch, but it don't need no stinkin' batteries

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jun 29, 2011, at 1:03 AM, Nonsanity wrote:

> Oh yeah? Well... well... MY wristwatch is a PDP-11, so NYAH!
> 
> :)
> ~ Chris Innanen
> ~ Nonsanity
> 
> 
> On Tue, Jun 28, 2011 at 1:56 AM, Jeff Reynolds wrote:
> 
>> I still have my transparent developer's newton! talk about looks when i use
>> to plop that down on a conference table! that and my sinclair z80 and my
>> Basis 108 are still alive...
>> 
>> cheers
>> 
>> jeff
>> 
>> 
>> On Jun 28, 2011, at 1:19 AM, 
>> use-livecode-request@lists.**runrev.comwrote:
>> 
>> hey I was using a newton up until last year...
>>> 
>> 
>> 
>> __**_
>> 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: System Date/Time Format Problems

2011-07-02 Thread Peter Brigham MD
There may be a better way, but you might have to use a shell call. Execute the 
following in the message box:

   put shell("man date | col -b")

and look at the options. You can get any format you want, and this way you 
would have full control over date display format in LC.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Jul 1, 2011, at 1:59 PM, Pete wrote:

> I'm running into some major differences in the way LC displays system date
> and time versus what I have set up in my OSX control panel and wondering if
> anyone else has run into this.  This is in the context of providing my users
> with a preference setting for how they want dates/times displayed.
> 
> First problem is that OSX has 4 date and time formats (Short, Medium, Long,
> and Full) whereas LC only has three (Short, Abbrev, Long) so there are some
> inevitable discrepancies.
> 
> For dates:
> LC Short = OSX Short
> LC Long = OSX Full
> LC Abbrev = no OSX format
> no LC format = OSX medium or long
> 
> 
> For times:
> LC Short = OSX Short
> LC Abbrev = OSX Short
> LC Long = OSX Medium
> no LC format = OSX Long or full
> 
> Any thoughts?
> 
> Pete
> Molly's Revenge 
> ___
> 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] what RGB is blue?

2011-07-02 Thread Peter Brigham MD
I posted a stack to RevOnline demonstrating one of the illusions from the 
boingboing page. See "optical illusion"

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jul 1, 2011, at 4:24 PM, Bob Sneidar wrote:

> Well that is the point I was making, but when I see how badly my mind has to 
> misinterpret color in order to make sense of an image, I begin to doubt 
> whether anything I see is valid or not. 
> 
> Bob
> 
> 
> On Jul 1, 2011, at 11:27 AM, Nonsanity wrote:
> 
>> Go with the math. You can't trust your eyes.
>> 
>> http://boingboing.net/2008/02/08/color-tile-optical-i.html
> 
> 
> ___
> 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: select after the selectedText

2011-07-06 Thread Peter Brigham MD

On Jul 6, 2011, at 3:47 AM, Richmond Mathewson wrote:

> On 07/06/2011 10:38 AM, Mark Wieder wrote:
>> Richmond-
>> 
>> Wednesday, July 6, 2011, 12:19:41 AM, you wrote:
>> 
>>> I have just tried this:
>>> on mouseUp
>>> set the useUnicode to true
>>> set the unicodeText of the selectedText to numToChar(2340)
>>>select after char -1 of field X
>>> end mouseUp
>> Untested, but what about
>> 
>> on mouseUp
>>   local tChunkChar, tChunkField
>> 
>>   set the useUnicode to true
>>   put word 4 of the selectedChunk into tChunkChar
>>   put word -1 of the selectedChunk into tChunkField
>>   set the unicodeText of the selectedText to numToChar(2340)
>>   select after char tChunkChar of field tChunkField
>> end mouseUp
>> 
> 
> A good thought; however, there is NO selectedChunk insofar as
> the end-user starts his/her edit with a selectedText that is NOT a chunk, just
> a cursor insertion point.
> 
> Just tried it and it threw this:
> 
> execution at line 5116 (Chunk: no such object), char 12

Try this, perhaps?

on mouseup
   put 1 + (word 4 of the selectedchunk) into saveMark
   -- this will be the first character after the selection
   put length(char saveMark to -1 of fld "myUnicodeFld") into savedLength
   put (-1)*savedlength into savedLength
   set the useUnicode to true
   set the unicodeText of the selectedText to numToChar(2340)
   select before char savedLength of fld "myUnicodeFld"
end mouseup

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: autoHilite and focus (following Jacque's solution)

2011-07-06 Thread Peter Brigham MD
On Jul 6, 2011, at 12:52 PM, J. Landman Gay wrote:

> On 7/6/11 2:06 AM, Slava Paperno wrote:
>> But then I added other buttons to the same card, and found that if any of
>> them has AutoHilite set to true, my focus command is undone, and the focus
>> moves to the card itself as soon as the mouseUp handler is done in the Find
>> button. I do want the user to see the visual feedback from those buttons,
>> and I don't want their Focus with Keyboard property set to true.
> 
> I think what you're seeing is the engine's long-standing behavior that 
> automatically focuses on the first object that has traversalOn set to true 
> whenever the card changes. On Windows/Linux, it can be a button. On OS X, 
> where buttons by default don't respond the same way, it's a field. This has 
> been known to drive developers gibbering into the streets, and I wish there 
> were a way to turn that off.

One way to "turn that off" is to group all the controls on the card, then set 
the traversalon of the *group* to false. You can still enter text in any 
individual field, but you don't get an unintended insertion point in the first 
(lowest layer) field when the card opens. I use this a lot, since I'm one of 
the people (can't really call myself a true developer) you might have seen 
gibbering in the street

> But since we're stuck with it, one solution is to make your Find field the 
> first one (the lowest layer) if possible. Or, see my suggestion in my other 
> post. Or add an (ugly) command to an openCard handler that sends a message in 
> 1 millisecond to another handler, which in turn focuses on nothing (or on 
> your field if you prefer.)
> 
>> 
>> With the focus gone, my user will probably try to press Tab to return the
>> focus to the input field. But when the focus is on the card, none of my
>> buttons receives that Tab keypress.
> 
> Put the tabkey handler into the stack or card and check "the target" to see 
> which object received the message.
> 
> -- 
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Using linkText

2011-07-08 Thread Peter Brigham MD
On Jul 7, 2011, at 6:17 PM, Ken Ray wrote:

> 
> On Jul 7, 2011, at 4:14 PM, Pete wrote:
> 
>> Thanks, hadn't noticed that.  But it just seems to make the text a link or
>> not, no way to specify what the link should be.
>> 
>> Maybe I'm misunderstanding the purpose of linkText.  What I want to do is
>> have each link go to a specific card in the stack
> 
> All that setting the style of a textrun to "link" does is to display it as a 
> web link and when it is clicked it sends a "linkClicked" message to the field 
> with the first parameter being the text that was clicked. It's up to you to 
> trap the "linkClicked" message and then do something with it.
> 
> An alternative method is to set the htmlText of a field to text that includes 
> an "a href=" tag; if you do *that*, the value in "href" is returned as the 
> parameter to linkClicked, NOT the text itself. Consider this HTML chunk:
> 
>  This is a test
> 
> The phrase "This is a test" will be underlined and clickable, but when you 
> click it:
> 
> on linkClicked pText
>  answer pText
> end linkClicked
> 
> This would answer "Test", not "This is a test".
> 
> HTH,
> 
> Ken Ray
> Sons of Thunder Software, Inc.
> Email: k...@sonsothunder.com
> Web Site: http://www.sonsothunder.com/

Here's what I have in one of my fields, where I am creating links from time to 
time:

on mouseup
   -- select the text you want to turn into a link
   -- then control-click the selectedText
   -- mouseup is sent when control-clicking in an unlocked field
   if the environment <> "development" then pass mouseup
   if $user <> "pmbrig" then exit mouseup
   -- prevents other users from modifying links
   if the controlkey is down then
  put the clickchunk into cc
  put the clicktext into ctxt
  put the linktext of cc into linkT
  -- in case you are modifying an existing link
  ask "Linktext for '" & ctxt & "'?" with linkT as sheet
  put result() into r
  put it into linkT
  if r = empty then
 if linkT = empty then
-- to remove link & set the text back to normal style
set the forecolor of cc to empty
set the textstyle of cc to empty
set the linktext of cc to empty
 else
set the forecolor of cc to blue
set the textstyle of cc to link
set the linktext of cc to linkT
 end if
  end if
   else
  pass mouseup
   end if
end mouseup

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: text formatting

2011-07-10 Thread Peter Brigham MD
You can create the htmltext by hand as suggested, or you can do something like 
the following (not tested):

-- 

Re: Rev Customer Databased Hacked?

2011-07-12 Thread Peter Brigham MD
On Jul 11, 2011, at 5:12 PM, Andre Garzia wrote:

> On Mon, Jul 11, 2011 at 5:37 PM, Pierre Sahores  wrote:
> 
>> I changed all mine, even if they went in theory full safe. It's realy best
>> for all of us to verify that our passwords are at least trusted as 100% safe
>> by the cPanel AJAX tester. Any mix of letters, numbers and itemdels are
>> always more trusty than only letters + numbers ;-)
>> 
>> 
> I used http://strongpasswordgenerator.com/ to generate mine... :-)

I made a simple stack to generate strong passwords. Options include choosing 
length of PW and whether to use punctuation characters or not. Should be pretty 
robust. Using this kind of password really means you have to have a secure 
repository for your passwords, since random passwords are rarely easy to 
remember. (Here is a plug for Bill Vlahos' InfoWallet!)

Mac:
http://db.tt/RieJv91

Windows:
http://db.tt/PEaUKCY

(sorry, no Linux)

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Mac OS X missing controls in the LiveCode IDE

2011-07-12 Thread Peter Brigham MD
At the risk of embarrassing Stephen, here is a link to his older life in music:

http://www.allmusic.com/artist/stephen-barncard-p54338/credits

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jul 12, 2011, at 1:07 PM, stephen barncard wrote:

> it's true. I'm almost famous! But Grace only sang in a choir with others.
> Jerry Garcia was the biggest influence on the record.
> 
> sqb
> 
> On 12 July 2011 02:59, René Micout  wrote:
> 
>> 
>> Le 11 juil. 2011 à 20:11, stephen barncard a écrit :
>> 
>>> Custom controls are *cool*. One can make any UI gadget work just the way
>> one
>>> wants and clone hundreds of them and run them from a single behavior
>> script.
>>> And make a Droptool™ to share with others.
>> 
>> 
>> I work on it...
>> 
>> [OT] > I see your young face on jacket disc "If I Could Only Remenber My
>> Name" of David Crosby under Grace Slick
>> 1971 > Ah ! Mes vingt ans !
>> 
>> Bon souvenir de Paris
>> René — twenty years old... in 1971...  :-(


___
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: defining and using globals in an application

2011-07-12 Thread Peter Brigham MD
I've been telling my bosses I could use arrays

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jul 12, 2011, at 1:30 PM, Bob Sneidar wrote:

> Hey now! Those aren't arrays!!
> 
> Bob
> 
> 
> On Jul 9, 2011, at 3:05 AM, Francis Nugent Dixon wrote:
> 
>> Of course, I begin to grab arrays when I have another (Irish)
>> Whiskey !
>> 
>> -Francis
> 
> 
> ___
> 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: AW: security code number generation

2011-07-18 Thread Peter Brigham MD
You could include (without telling the user) the contents of $user as part of 
what is inputted to generate the code. This would make it more secure but cause 
problems with portability, etc. I agree with the later posts pointing out the 
trade-offs between security and user-frendliness. Consider your decisions in 
that light.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jul 18, 2011, at 3:43 AM, Tiemo Hollmann TB wrote:

> First: Congratulations to Shao to the winner of the FIFA womens soccer world
> championship: Japan!
> 
> As I understand Zygodact, or Peters or Shaos approach the user can pass on
> his "name, etc." and the generated code to everyone else to unlock the
> software.
> How do you handle this issue? Is it just something "as is", is this scenario
> so negligible in your customer base that you just can ignore it, or do you
> count on the good in the people that they won't do it?
> Would be of interest on how you handle this.
> Tiemo
> 
> 
> 
>> -Ursprüngliche Nachricht-
>> Von: use-livecode-boun...@lists.runrev.com [mailto:use-livecode-
>> boun...@lists.runrev.com] Im Auftrag von Pete
>> Gesendet: Montag, 18. Juli 2011 09:15
>> An: How to use LiveCode
>> Betreff: Re: security code number generation
>> 
>> Thanks Ken, that looks good.  I guess the other missing piece is how to
>> control "demo" versions.  Expiration dates seem to be the most common, or
>> maybe some limited function set.
>> Pete
>> Molly's Revenge <http://www.mollysrevenge.com>
>> 
>> 
>> 
>> 
>> On Sun, Jul 17, 2011 at 10:48 PM, Ken Ray  wrote:
>> 
>>>> I'm looking for something to generate license codes for some software
> I'm
>>>> planning to sell.  Do you think this would work for that purpose?
>>> 
>>> Take a look at Zygodact; it does exactly this plus it has a DropTool
>>> component to make it a snap to work with.
>>> 
>>> http://www.runrev.com/store/product/zygodact-1-0-4/
>>> 
>>> 
>>> Ken Ray
>>> Sons of Thunder Software, Inc.
>>> Email: k...@sonsothunder.com
>>> Web Site: http://www.sonsothunder.com/
>>> 
>>> 
>>>> Pete
>>>> Molly's Revenge <http://www.mollysrevenge.com>
>>>> 
>>>> 
>>>> 
>>>> 
>>>> On Sat, Apr 2, 2011 at 9:51 AM, Peter Brigham MD 
>>> wrote:
>>>> 
>>>>> For anyone who might have the need, I have a handler I use to
> generate a
>>>>> security code, in my case for printed prescriptions. It takes the
> name
>>> of
>>>>> the patient, the date of the prescription, the medication and med
>>> strength
>>>>> and hashes all that to produce a ten-digit alphanumeric string (using
>>> 0-9,
>>>>> a-z, A-Z). If there is any question about the validity of the
>>> prescription I
>>>>> can retrieve the correct code from the rx entry in my database with a
>>>>> mouseclick (actually recalculating the code from the stored rx data)
> and
>>>>> confirm it with the pharmacy. This has proved useful on two occasions
>>> when a
>>>>> pt was playing fast and loose with his prescriptions.
>>>>> 
>>>>> The algorithm is fast in LC, sufficiently obscure that I'm pretty
> sure
>>> it
>>>>> would be hard to hack -- though of course few things are bulletproof
> in
>>>>> encryption if someone wants to try hard enough -- and discontinuous
> in
>>> the
>>>>> sense that similar inputs do not generate similar outputs, eg, change
>>> one
>>>>> character in the input and the code number is completely different.
> The
>>>>> probability of coming up with the correct security number by chance
>>> alone is
>>>>> 1 in 10^15 (a million billion to 1). It could be adapted to any
> number
>>> of
>>>>> purposes. I am not posting the handler here, since it would be unwise
> to
>>> let
>>>>> it be archived and available, eg, with a Nabble search, but if anyone
> is
>>>>> interested, let me know and I'll share it.
>>>>> 
>>>>> -- Peter
>>>>> 
>>>>> Peter M. Brigham
>>>>> pmb...@gmail.com
>>>>> http://home.comcast.net/~**pmbrig <http://home.comcast.net/~pmbrig>
>>>>> 
>>>>> 
>>>>&

Re: Setting a dirty flag for a file

2011-07-21 Thread Peter Brigham MD
On Jul 21, 2011, at 4:02 PM, Mark Schonewille wrote:

> Hi Charles,
> 
> I read your e-mail again. I understand that you want to know whether one or 
> more fields have changed, not whether a file is open.
> 
> Usually, I generate an md5Digest and save that:
> 
> on closeField
>  makeDigest 
> end closeField
> 
> on makeDigest
>  put empty into myDigest
>  repeat with x = 1 to number of fields
>put md5Digest(fld x & myDigest) into myDigest
>  end repeat
>  set the cDigest of this stack to myDigest
> end makeDigest
> 
> function dataChanged
>  put empty into myDigest
>  repeat with x = 1 to number of fields
>put md5Digest(fld x & myDigest) into myDigest
>  end repeat
>  return (the cDigest of this stack is myDigest)
> end dataChanged
> 
> You just will have to figure out what is a smart event to check the digest: 
> closing a field, closing a window, opening a window, refreshing the file 
> menu, etc.
> 
> When you close the window, you might want to do this:
> 
> on closeStackRequest
>  if dataChanged then
>answer "Do you want?" with "Don't Save" or "OK" or "No"
>if it containt "Don't" then
>  exit closeStackRequest
>else if it is "No" then
>  pass closeStackRequest
>else
>  // do your saving stuff here
>  // return true if the file was saved
>  if the result is true then
>pass closeStackRequest
>  end if
>end if
>  end if
> end closeStackRequest


I use a frontscript -- wholesale is better than retail:

on closefield
   setDirty
   pass closefield
end closefield

on setDirty tf
   if tf = empty then put true into tf
   put the version into v
   replace "." with empty in v
   if v < 453 then exit setDirty
   -- version must be 4.5.3 or higher,
   -- or you just create a new customprop
   set the modifiedMark of stack "myStack" to tf
end setDirty

If you want to exclude certain fields, use a customprop to mark fields that 
shouldn't trigger setDirty when edited:

   set the the dontFlagDirty of fld "excludedFld" to true

Then in the closeField handler in the frontscript, insert as the first line

   if the dontFlagDirty of the target <> true then pass closefield

Changes other than field content that should be saved (radiobuttons or 
checkboxes, etc) can be handled, eg, with a mouseup handler in the frontscript, 
and suitable checks on the target. (Pass the mouseup!)

I also do:

on preopenstack
   set dirty false
   ...  ...
   ...
end preopenstack

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


___
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: Where does survive the inventive user ?

2011-07-27 Thread Peter Brigham MD
Just to let you know that you're not alone -- I'm a similar LC user, started 
with HC (actually bought and read through Danny Goodman's book even before I 
bought my first Mac), developed a set of stacks to manage my clinical notes, 
incorporated more and more features, moved it over to LC a number of years ago, 
at which point with all of LC's capability the feature set grew even larger, 
now a full-fledged practice management tool, with 45 substacks, over 32,000 
lines of script, couldn't manage without it. I'm not a programmer, just picked 
it up on the side. I have no idea how you market to people like me, but I 
suspect there are lots of us scattered around.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jul 27, 2011, at 9:25 PM, Timothy Miller wrote:

> I've never been a computer professional. Not even close. I taught myself to 
> write Basic programs for my Atari 64, mostly out of curiosity. Around 1984 I 
> taught myself HyperCard. I wrote a variety of applications for home and 
> business use. A pretty good phonics tutorial for my kids, among others. And I 
> gradually cobbled together a complex set of HyperCard stacks, which I use 
> every day to run my business. They're crude, kludgy and ugly, but they work. 
> Many thousands of lines of script, no idea how many thousands. When I need a 
> new feature, I write it. Often, it's working reliably in less than an hour. 
> It's been years since I saw an error message. Sometimes I "discover" clever 
> and useful features I wrote and forgot about.
> 
> When HyperCard became obsolete, I moved over to Runtime Revolution, which was 
> rather an ordeal, because RR was far more complex. It's comfortable now. And 
> now it's LiveCode, but I've barely noticed the change. LiveCode does many 
> things I don't understand, but that's not a problem.
> 
> I still write stacks for my own use. I recently written a stack to help me 
> study and identify photos and songs of birds. Also, I'm taking notes for a 
> book and I've written a stack to help me organize the notes. I will 
> eventually use the same stack to help me develop the book -- probably some 
> kind of a one-paragraph-per-card arrangement with many summarizing, indexing, 
> re-sequencing, search and notation features. I tweak old features and invent 
> new ones as I go along.
> 
> None of this seems very difficult. It's a gradual transition from HyperCard. 
> I'm not really a nerd -- computers don't fascinate me all that much. I write 
> a stack when the time invested justifies the functionality of the final 
> product.
> 
> It's gradually dawning on me that "programmers" like me have become rather 
> rare. Fewer and fewer non-professionals on this list, as far as I can tell. I 
> don't understand why, seems like a shame.
> 
> Many people have use for the kind of functionality an amateur and dabbler can 
> get out of LiveCode, and it isn't that hard to do.
> 
> Admittedly, HyperCard was easier, simply because it was less complex. I've 
> wondered if LiveCode might be more approachable if it had some kind of "dumb 
> mode," sort of like the old userLevel system in HyperCard. Probably won't 
> happen though.
> 
> FWIW...
> 
> Tim
> 
> 
> 
> On Jul 27, 2011, at 5:35 AM, dunb...@aol.com wrote:
> 
>> In the old days, Hypercard was. like a viral pandemic, infected the world 
>> because it was bundled with every Macintosh. It was offered like a 
>> promotion, a possibly valuable coupon one gets in the mail, which you will 
>> at least read before throwing out, And it became a nerd fad, with many 
>> hundreds of thousands of people trying it out. Certainly only a small 
>> fraction became enamored; many of those are reading this post.
>> 
>> 
>> Without that once in a lifetime vehicle, it is an uphill battle to engage 
>> people who might fall in love with LC if they only were simply exposed to 
>> it. Worse, these days, the mindset is that everything comes in small 
>> ready-to-go packages, complete and compact. I have three kids who just don't 
>> think about building stuff, especially from raw materials. I used to, though.
>> 
>> 
>> Thank the iMac, iPhone, iPod, etc., for creating that expectation, a far cry 
>> from reading a bank of eight lights telling you what byte was currently 
>> passing by.
>> 
>> 
>> LC should be taught in the ninth grade in every school in the world. 
>> 
>> 
>> Craig Newman
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> -Original Message-
>> From: Francis Nugent Dixon 
>> To: use-livecode 
>> Sent: Wed, Jul 27, 2011 2:42 am
>> Subject: Where does survive the inventive user ?
>> 
>> 
>> Alejandro asks some potent questions .
>> 
>> Question 1 - Is programming so easy . ?
>> 
>> I think we should ask the question "Is programming a niche occupation ?
>> 
>> During my early career, practically everybody I knew was a programmer
>> (birds of a feather flock together ?)
>> 
>> Now I am out of the industry (retired), outside of the LiveCode forum,

Re: Where does survive the inventive user ?

2011-07-30 Thread Peter Brigham MD
On Jul 30, 2011, at 10:42 AM, Richard Gaskin wrote:

> Kay C Lan wrote:
> 
>> I look in my wallet an there are a couple of notes and a couple of plastic
>> cards. The notes represent about 0.01% of iMoney I have in my account. I can
>> use those plastic cards to access the BankCloud and if the strangers at the
>> Bank are willing, the machine will give me more real money on a 1 to 1
>> reduction of my iMoney. Sometimes I don't even have to change iMoney into
>> real money, I just go to the shop and transfer iMoney from my account to
>> their iMoney account which all resides in the same BankCloud. Of course I
>> have to pay a 'rental' fee for the privilege of being able to access my
>> iMoney at virtually any time or shop. But then again, if a stranger at the
>> bank goes all Nick Leeson on me, the bank will collapse and my iMoney in the
>> BankCloud will disappear like the early morning stratocumulus, leaving me
>> without any real money.
>> 
>> Strange what we think we'd never do.
> 
> Or even stranger, we could trust our money to so-called professional money 
> managers who mishandle it so badly that the world economy is brought to the 
> edge of collapse. ;)

I've always wondered why they're called "brokers" ... I think if I were in that 
line of work I'd find another way of describing it.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: User Interface Question

2011-07-31 Thread Peter Brigham MD
And it's much better not to lock the cursor and then change it. Locked cursors 
have a way of sticking if the handler to unlock the cursor somehow misses. 
instead, don't lock anything, just set the defaultcursor to hand, then set it 
to empty when done. I usually have this in my stack script:

on mousemove
   put the target into tTarg
   if the name of the target contains "button" then
  if the tool contains "browse" then
 set the defaultcursor to hand
  end if
   else
  set the defaultcursor to empty
   end if
   pass mouseMove
end mousemove

on mouseLeave
   set the defaultcursor to empty
   pass mouseLeave
end mouseLeave


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jul 30, 2011, at 8:17 PM, Jeff Massung wrote:

> I never do mouse cursor changes in controls. I do all of them in the card.
> 
> on mouseMove px,py
>  if px,py is within the rect of ... then
>-- cursor A
>  else if px,py is within the rect of ... then
>-- cursor B
>  else
>-- put the cursor back to normal
>  end if
> end mouseMove
> 
> This makes it *much* easier to control what's shown when.
> 
> Jeff M.
> 
> On Sat, Jul 30, 2011 at 1:58 PM, Pete  wrote:
> 
>> Thanks Jeff.  I'm trying to implement the cursor change and running into
>> some weirdness.
>> 
>> In the script of the datagrid, I have these two handlers:
>> 
>>  *on* mouseEnter
>> 
>>  *lock* cursor
>> 
>>  *set* the cursor to hand
>> 
>> *end* mouseEnter
>> 
>> 
>> *on* mouseLeave
>> 
>>  *unlock* cursor
>> 
>> *end* mouseLeave
>> 
>> 
>> This changes the cursor as expected and most of the time, it returns to the
>> correct cursor when I move the mouse away from the datagrid.  However, if I
>> move the cursor above the datagrid, the cursor stays as the hand and does
>> not return to any other image no matter where I move the mouse to.
>> 
>> 
>> This is the first time I've attempted to control the cursor so no doubt I'm
>> doing something wrong!
>> 
>> 
>> Pete
>> Molly's Revenge 
>> 
>> 
>> 
>> 
>> On Sat, Jul 30, 2011 at 11:48 AM, Jeff Massung  wrote:
>> 
>>> For dragging, I'd go with "handles" on the left side of the datagrid that
>>> have hand icon when you hover over them. They've become pretty ubiquitous
>>> on
>>> webpages. For an example of what I mean:
>>> 
>>> http://jqueryui.com/demos/sortable/
>>> 
>>> As for a context menu, you be okay with just a tool-tip. People generally
>>> try and right-click a lot for things they expect to be there. Otherwise,
>>> again, go with something common to show that actions are available. For
>>> example, and disclosure triangle on the far right of a UI widget is
>>> typically clickable and will bring up a menu. Left-click will bring up
>> your
>>> context menu, and r-click anywhere will bring it up as well.
>>> 
>>> Jeff M.
>>> 
>>> On Sat, Jul 30, 2011 at 12:42 PM, Pete  wrote:
>>> 
 Wondering if anyone has any thoughts on a couple of user interface
 questions.
 
 I'm providing a popup contextual menu when the user right-clicks on a
 datagrid.  I'm also providing the ability to re-order rows in a
>> datagrid
>>> by
 dragging and dropping them.  The common thread between these two
>>> functions
 is that there is no on-screen indication that they exist.  Popup menus
>>> are
 invisible until they are invoked and drag and drop is equally invisible
 until someone initiates it.
 
 Are there any common methods for indicating to users that features like
 this
 are available to them?
 
 Pete
 Molly's Revenge 
 ___
 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


___
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: Getting someone's age from dob and current year

2011-07-31 Thread Peter Brigham MD
On Jul 31, 2011, at 12:03 AM, Warren Samples wrote:

> On Saturday, July 30, 2011 07:16:44 PM Roger Eller wrote:
>>  convert tToday to seconds
>>  convert tBorn to seconds
> 
> 
> It's been talked about before, but this calls for a reminder: attempting to 
> convert a date prior to Jan 1, 
> 1970 to "seconds" returns "invalid date" instead of a number in Windows. 
> Don't do this if you are going to 
> need this to work in Windows! Under Windows, you need to subtract the 
> birthyear from the current year and 
> determine if the current month/day is later than the birth month/day and 
> subtract one year if necessary. 
> Conveniently, this methods does work on all platforms. 

function doAge tDOB
  -- assumes format of m/d/yy
  set the itemdelimiter to "/"
  put item 3 of tDOB into DOByr
  put item 2 of tDOB into DOBmo
  put item 1 of tDOB into DOBdy
  put item 3 of the short date into nowYr
  put item 2 of the short date into nowMo
  put item 1 of the short date into nowDy
  if DOByr > nowYr then -- prev century
 -- assumes no one with age > 100
 put "19" before DOByr
  else
 put "20" before DOByr
  end if
  put "20" before nowYr
  put nowYr - DOByr into tAge
  if nowMo > DOBmo then return tAge
  if nowMo < DOBmo then return tAge -1
  if nowDy < DOBdy then return tAge -1
  return tAge
end doAge

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


___
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 do I remove part of a path?

2011-08-01 Thread Peter Brigham MD
When you replace item 4 of tStr with empty, you don't delete the item itself, 
you just make the item empty:

put "a/b/c/d/e/f" into k
set itemdel to "/"
put "" into item 4 of k
put k

  -> a/b/c//e/f

What you need to do is delete the item itself:

put "a/b/c/d/e/f" into k
set itemdel to "/"
delete item 4 of k -- note the change
put k

  -> a/b/c/e/f

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



On Aug 1, 2011, at 1:11 PM, Pete wrote:

> Another variant might be:
> 
> replace "/" & item 4 of myURL with empty in myURL
> 
> As an aside, I have found a very frequent need to parse out tab-delimited
> strings and had been doing it by setting the itemdelimiter to tab and back
> again.  I got myself in trouble so many times by forgetting to set the
> itemdelimiter back to its original value that I wrote a short handler to do
> this:
> 
> function tabItem pitem,pstring
>   set the itemdelimiter to tab
>   return item pitem of pstring
> end tabItem
> 
> put tabItem(3,myString) into myColumn
> 
> Since the itemdelimiter setting is local to a handler, don't need to
> save/reset it.  Saved me a few hundred lines of coding and eliminated
> itemdelimiter debuggung issues.
> 
> I wish there was a tab-delimited chunk type native to LC.  I see there is a
> columndelimiter property that is set to tab but I think it's only use is for
> combine and split on arrays.  Would be great to be able to do "put column 3
> of myString into myColumn".
> 
> Pete
> Molly's Revenge 
> 
> 
> 
> 
> On Mon, Aug 1, 2011 at 8:38 AM, Michael Kann  wrote:
> 
>> Jim,
>> Now I get it. Good one-liner.
>> Mike
>> 
>> --- On Mon, 8/1/11, Jim Ault  wrote:
>> 
>> From: Jim Ault 
>> Subject: Re: How do I remove part of a path?
>> To: "How to use LiveCode" 
>> Date: Monday, August 1, 2011, 10:28 AM
>> 
>> "itemToParse" is a variable name I created that contains the string, such
>> as
>> 
>> "http://domain.com/subfolder/subfolder/page.html";
>> 
>> Sorry about the confusion.
>> Perhaps I should have used "tStringOfItemsToParse"
>> 
>> 
> ___
> 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] Flash is NOT Dead

2011-08-02 Thread Peter Brigham MD
On Aug 2, 2011, at 12:12 PM, Lynn Fredricks wrote:

>> It would appear Flash is dead or certainly critically ill. 
>> Happened much quicker than even I expected.
>> 
>> http://www.telecomtv.com/comspace_newsDetail.aspx?n=47914&id=e
>> 9381817-0593-417a-8639-c4c53e2a2a10
>> 
>> And all those people who thought banning Flash would be the 
>> end of Apple, and that it was stifling competition. I can't 
>> count the number of people who've told me they 'must have' 
>> Flash so I've said 'don't buy an iPhone/iPad', but they still 
>> did. Maybe that's why Adobe gave up so quickly, even they saw 
>> the people who wanted Flash weren't prepared to support it?
> 
> Hey Kay - wow, that site has an annoying pop up. If you don't want to join,
> that pop up doesn't go away and won't let you read the article.

furthermore, when I click to join and get the fields to fill in personal info, 
which I did not fill in, and I click "terms and conditions" (which I do before 
I join anything these days), nothing happens. No terms and conditions. Doing a 
search on "terms and conditions" gives me a list of articles but no telecomtv 
terms and conditions. And the "FAQ" consists of two introductory articles and 
nothing else. So needless to say, I ain't joining.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Nine digit zip codes

2010-11-30 Thread Peter Brigham MD
FWIW, I have a handler that feeds the address to Google Maps and then  
parses the HTML to extract the 5-digit zip code. Takes less than a  
second unless the traffic is high. I'm pretty good at text parsing but  
know very little about XML and GET/POST commands -- I had to look  
around to find a webpage that I could post the address using straight  
HTML rather than Java or SQL or whatever, and Google Maps was it. Only  
a 5-digit zip, though.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Nov 27, 2010, at 12:53 PM, James Hurley wrote:

I sent this message a while back, but I suspect it got lost in the  
RunRev-LiveCode changeover.


At the USPS web site (http://zip4.usps.com/zip4/) it is possible by  
entering the street address, the city and the state to obtain the 9  
digit zip code for that address.


This may be naive, but is it possible to do this from within  
LiveCode by script?


Jim



___
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: Ucranian spam [OT]

2010-12-02 Thread Peter Brigham MD
I once had a schizophrenic patient introduce himself to me by saying  
"Hello, I'm a visitor from planet Earth."


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Dec 2, 2010, at 3:18 PM, Richmond wrote:


On 12/02/2010 09:55 PM, Bob Sneidar wrote:
If you are from another planet, or otherwise not one of the species  
indigenous to planet earth, just know that we were here first and  
we aren't going anywhere without a fight!


Life would be SO much simpler if only I were from another planet.  
Why we cannot be like those

aquatic hydra and bud-off I just don't know.

Imagine; no mental problems about finding a mate, wondering if one  
were a 'real' man, no porn,

no silly spam about viagra . . . just pure Livecode . . .  :)


Bob


On Dec 2, 2010, at 11:51 AM, Richmond wrote:


On 12/02/2010 09:44 PM, J. Landman Gay wrote:

On 12/2/10 1:35 PM, Devin Asay wrote:
Not to worry. Heather informs me that our pal Vovan has already  
been

shipped off to virtual exile in wait for it... Cyberia.
LOL! I never understood the male fixation with becoming "real"  
anyway. Everyone knows fantasy men are always better.


Here in Bulgaria, the towns are full of "real" men; that probably  
accounts for the

proliferation of S*x shops catering exclusively to women . . .  :)

Personally I think that both men and women are grossly over-rated.
___


___
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: Cursors in a Revlet

2010-12-04 Thread Peter Brigham MD
FYI, though I know little about revlets, if you are setting cursors on  
a stack running on the desktop (in the IDE or as a standalone), it  
will work much better to set the defaultCursor. I used to lock the  
cursor and set it to something but ran into intermittent problems with  
it not unlocking. Try this in a stack script, so that the cursor  
changes to hand for all buttons and reverts reliably when leaving the  
button:


on mouseMove
   -- more reliable than mouseEnter
   if the name of the target contains "button" then
  set the defaultcursor to hand
   else
  set the defaultcursor to empty
   end if
   pass mouseMove
end mouseMove

on mouseLeave
   set the defaultcursor to empty
   pass mouseLeave
end mouseLeave

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Dec 3, 2010, at 6:05 PM, John Dixon wrote:



Rick...

You are not missing anything... the cursors are not included in the  
revlet when you compile it for the web, so they are not there to  
show...



Once again I know I am mising something really simple. I use:

on mouseEnter
  lock cursor
  set the cursor to hand
end mouseEnter

on mouseLeave
   unlock cursor
end mouseLeave

to, as the dictionary says -  indicate to the user what kind of data
the mouse pointer is over. It doesn't work in a Revlet on the Web.
The cursor remains the default arrow. What am I missing?
Thanks
Rick



___
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: Finding local minima and maxima of a graph

2010-12-04 Thread Peter Brigham MD
Do you have access to the data the graphs are based on? Or are you  
talking about trying to analyze the shape of a curve (bitmapped or  
otherwise)? The two problems will have quite different approaches.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Dec 4, 2010, at 12:56 PM, Bryan McCormick wrote:

I have a very large number of graphs to crunch through to find local  
minima and maxima. The data is regularly spaced, which eliminated  
one problem. I know too that the window value used has to be an  
adjustable variable as peak and trough significance may need to be  
found for a wide range of time periods within the data set.


I had thought of using a moving average to find a slope of zero and  
then use an offset function to find the peak and trough in time.


I've used stackoverflow to have a look and apparently the problem is  
a lot less trivial than I thought.


Any suggestions for fitting to a function, using the graphing  
functions in rev, etc would be most welcome.


___
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: PDF ?

2010-12-06 Thread Peter Brigham MD
If you only want to fill in the stamp and then print the result, what  
I do is import the pdf as an image, overlay fields wherever I need  
them, then fill them in by script, and print the result. If you want  
to export it instead of printing it, you could take a snapshot of the  
result and export that as jpg or, I guess, as a pdf file, though I'm  
not sure about the latter, maybe use the pdfLib for that.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Dec 6, 2010, at 1:34 AM, Anthony Howe wrote:


Thanks Jan,

Great to hear the detail around this one. The feature you mention  
that you're working on is actually all that we would require and  
sounds ideal!


We simply want to 'stamp' an existing document with a customers  
unique ID and details. The area of the document to be stamped will  
be blank space on each pageat a defined location (footer or  
header area, for example) and requires no interaction with the  
existing content.


From there, just a re-export of the PDF would be required.

What do you think?



On 06/12/2010, at 5:24 PM, Jan Schenkel  wrote:


--- On Sun, 12/5/10, Anthony Howe  wrote:

My question was also not really
around whether PDF export is possible, but rather if it was
possible to open an existing PDF file (which was created in
LC, or not) and add new data (like a personalized footer or
header from LC app data for example), then, reexport it...as
a PDF, ready for distribution.

The answer to this one so far seems to be no.but I'm
hoping for an angle:)

Hope that clarifies things, and perhaps I should have
started a separate thread on this question, as I accept it
does stray somewhat from the original post.

*gulp*

Cheers,
A.



While I have written a library to create new PDF files from  
scratch, by script, I'm not sure where to begin taking apart an  
existing PDF file and modifying its content.
The structure of a PDF file is completely unlike Word DOC or RTF  
files. Word processing files are structured around a flow of  
paragraphs, sentences and words. PDF files are a set of low-level  
instructions (draw a line here, draw this bit of text there, now  
switch to font 'Times', set the drawing color to 'red', etc.) and  
there is no rigid flow structure.
More precisely, PDF has no concept of paragraphs - you're at the  
mercy of the producing application printing each bit of text in the  
'right' order to ease extraction. In fact, PDF doesn't even have  
text styling concepts other than 'font'. You want an underline?  
Draw it yourself.
In fact, it's so complicated that the selection of text in Adobe  
Reader or Apple Preview is based on OCR (optical character  
recognition) algorithms: we know there's a bit of text here, and  
that other bit of text has the same baseline, so that could  
actually be a single line of text in the user's mind - let's select  
both!
So if you're looking to read an existing file, and modify the  
content - such as replacing placeholder text and expecting the  
whole flow of the text to update along with it - you have your work  
cut out for you.
One feature I have been working on, is the ability to open an  
existing PDF file, and use pages from it as a background on top of  
which you draw additional elements. In that scenario I'm not even  
really tweaking the content, and this is presenting its own  
gotchas...


Jan Schenkel.
=
Quartam Reports & PDF Library for LiveCode
www.quartam.com

=
"As we grow older, we grow both wiser and more foolish at the same  
time."  (La Rochefoucauld)






___
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: ANN: glx2 is now open source

2010-12-06 Thread Peter Brigham MD

On Dec 6, 2010, at 12:25 PM, Keith Clarke wrote:



On 6 Dec 2010, at 17:16, Bob Sneidar wrote:



On Dec 4, 2010, at 5:32 PM, Mark Wieder wrote:


Optimist - The glass is half full.
Pessimist - The glass is half empty.
Engineer - The glass is twice a large as it needs to be.

Mathmetician - The glass is BOTH half empty AND half full.

Zen monk - There is no glass... there is no monk.


Gourmand - the glass *was* half full I think it was a 2007 Cab, a  
bit too fruity, I'd give it an 89.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: PDF ?

2010-12-06 Thread Peter Brigham MD
Oh, right. Sorry, I guess I spoke too soon. I haven't actually  
imported pdf's as images, I always saved the pdf as an image first  
then imported that. I have a bunch of forms that I fill in that way  
and I've always been able to set everything up for the user first --  
I've never tried to do it "on the fly." Sorry to mislead you


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Dec 6, 2010, at 4:41 PM, Richmond wrote:


On 12/06/2010 11:35 PM, Peter Brigham MD wrote:
If you only want to fill in the stamp and then print the result,  
what I do is import the pdf as an image,


Wow! Hold it right there! My original 'seed' for this thread was a  
question as to how one

could import a PDF as an IMAGE . . .

. . . Please tell all . . . :)

overlay fields wherever I need them, then fill them in by script,  
and print the result. If you want to export it instead of printing  
it, you could take a snapshot of the result and export that as jpg  
or, I guess, as a pdf file, though I'm not sure about the latter,  
maybe use the pdfLib for that.




___
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: Code To Minick Control-A, Control-C, Control-V (Select All, Copy, Paste)

2010-12-06 Thread Peter Brigham MD

On Dec 6, 2010, at 5:00 PM, Bob Cole wrote:


Here is a script that I use to copy all the text in a field.
This works on Mac OS X and Windows (XP and 7).

  on mouseUp
 select the text of field "myList"
 copy
 wait 1 second
 select empty
 set the vscroll of field "myList" to 0  -- reset the scroll to  
the top of a long list

  end mouseUp

The select command highlights the text.
The wait command allows time for the user to get feedback
The select empty command removes the highlight
The vscroll is set to the top of a long list in the field.

With the text copied, it can be pasted into a different application.


Why not just:

set the clipboarddata{"text"] to the text of fld "myList"
answer "The text is on the clipboard." as sheet

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Opening documents with Quick Look on iPad?

2010-12-10 Thread Peter Brigham MD
Here's what I use on the desktop. Don't know squat about how this  
could be massaged for iPad.


-

on mouseUp tBtn
   answer file "Please choose a file to look at ..."
   if it is empty then exit mouseUp
   put it into theFile
   put empty into allowDrag
   quickLook theFile
end mouseUp

on quickLook theFile
   put apostrophe (theFile) into theFile
   --  put "qlmanage -t " & "-s 900 " & theFile into tcmd --  
apparently sets it to max orig size, white window
   --  put "qlmanage -t " & "-f 5 " & theFile into tcmd   
apparently sets it to max orig size, white window

   put "qlmanage -p " & theFile into tcmd -- shows it in a black window
   get shell(tCmd)
   if the result is not empty then beep
end quickLook

function apostrophe str
   return "'" & str & "'"
end apostrophe



-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



On Dec 10, 2010, at 10:33 AM, As_Simon wrote:



Has anyone figured out how to open, say a pdf, using iPads Quick  
Look?  I

mean via LC.
This would be great because Quick Look handles many types of files.

Thanks,
Simon
--
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Opening-documents-with-Quick-Look-on-iPad-tp3082167p3082167.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



___
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 to select image object instead of group

2010-12-11 Thread Peter Brigham MD


On Dec 10, 2010, at 11:28 PM, Scott Pepperdine wrote:


The image script is:
on mouseup
  answer file "Select your file:"
  if it is  empty exit to top
  set the filename of image "image" to it
end mouseup

The group script is as follows ( just to prove to me this what was  
happening:

on mouseup
  answer "1033"
end mouseup


You are missing a "then" in the image mouseup script. If this script  
doesn't compile then perhaps it's ignored and the mouseup message is  
passed to the group script? I'm surprised that you could close the  
script editor without an alert while the "if-then" statement lacks a  
"then", however.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: closeField and the clear command

2010-12-12 Thread Peter Brigham MD

On Dec 12, 2010, at 11:35 AM, Bill Vlahos wrote:

The docs say that if you "put" something from a script into a field  
no closeField message is sent.


This appears to be the same as if you delete (menuItem Clear) as  
well. Is this the correct behavior because the docs don't mention it?


This appears to be true. You will probably have to intercept the  
backspaceKey and deleteKey messages and add a "send closefield to the  
target" message after the deletion.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




___
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: Set Angle Bug?

2010-12-15 Thread Peter Brigham MD

On Dec 15, 2010, at 2:22 AM, Walt Brown wrote:

Thanks Klaus, I got back in to the QC center, I finally remembered  
what

username I was there :-)


You should be using InfoWallet! (Made in LC, by one of our own)

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: msg box Bug?

2010-12-15 Thread Peter Brigham MD

On Dec 15, 2010, at 1:46 PM, Scott Rossi wrote:


Might be worth noting that
"play accordion" returns the result "go to jail; that's the law".



"A gentleman is a man who can play the trumpet, but doesn't."
-- Lord Chesterfield

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


___
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: cmd key modifier not working?

2010-12-19 Thread Peter Brigham MD

On 12/18/10 3:57 PM, Sivakatirswami wrote:


OSX Livecode 4.5.2

I have this menu:

Stop/1
Back Up/2
Forward/3
Resume/4

the menu appears with "cmd +1" as expected and I could have sworn that
it used to work, but now when I hit the keys, nothing happens. The  
menu
is OK.. if I go to the menu and pull down and choose the item.. it  
works.


I'm in the IDE ...these same keys are slotted for card navigation;  
but I

have the development tools suspended

Any clues?


Where is the focus? If there is an insertion point in a field, or any  
other control has traversalOn = true and has the focus, and that  
control has a commandkeydown handler, then the commandkeydown message  
will be caught there and could be trapped.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Refer object with the value of a variable

2010-12-20 Thread Peter Brigham MD

On Dec 20, 2010, at 6:46 AM, Josep M Yepes wrote:


Hi,

Why this code don't run?

I want to assign the value of tX[tKey] to the fields that have the  
same name of the value.


pLanguage is passed by the user.


put "u" & pLanguage into tX

  repeat for each key tKey in the customproperties["u" & pLanguage]  
of this stack

 set the text of fld tKey to tX[tKey]
  end repeat


I think you have to put the customprop into a variable first:

  put "u" & pLanguage into cSet
  put the customproperties[cSet] of this stack into tPropArray
  put the keys of tPropArray into keysList
  repeat for each item tKey in keysList
 set the text of fld tKey to tX[tKey]
  end repeat

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Refer object with the value of a variable

2010-12-20 Thread Peter Brigham MD
Whoops -- another problem, maybe the chief problem: it's the  
customproperty[cSet], not the customproperties[cSet], see below


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Dec 20, 2010, at 8:29 AM, Peter Brigham MD wrote:


On Dec 20, 2010, at 6:46 AM, Josep M Yepes wrote:


Hi,

Why this code don't run?

I want to assign the value of tX[tKey] to the fields that have the  
same name of the value.


pLanguage is passed by the user.


put "u" & pLanguage into tX

 repeat for each key tKey in the customproperties["u" & pLanguage]  
of this stack

set the text of fld tKey to tX[tKey]
 end repeat


I think you have to put the customprop into a variable first:

 put "u" & pLanguage into cSet


   put the customproperty[cSet] of this stack into tPropArray


 put the keys of tPropArray into keysList
 repeat for each item tKey in keysList
set the text of fld tKey to tX[tKey]
 end repeat

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig





___
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: Dispatch and send

2010-12-22 Thread Peter Brigham MD

On Dec 22, 2010, at 12:56 PM, Richard Gaskin wrote:


David Bovill wrote:


Anyone got a reason for this being Appropriate behavior?

dispatch "beep" to this cd -- no beep

send "beep" to this cd -- a beep


Interestingly, running this in the Message Box:

 dispatch "beep" to this cd; put it

...yields "unhandled"

You get the same with any build-in command, e.g.:

 dispatch "go next" to this cd; put it

Whether this is a weakness in the engine or the documentation is a  
question of intention:


Is "dispatch" designed to handle only custom handlers? It appears to  
be, and if that's what's intended it's working fine and all that's  
needed is a note in the docs clarifying that.


Note to this effect submitted to the Dictionary entry on "dispatch".

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




___
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: Recursion warning: what's the owner of a background?

2010-12-23 Thread Peter Brigham MD

On Dec 23, 2010, at 6:34 AM, David Bovill wrote:

This one just caught me out. I have a script that checks a property  
of it's
owner and returns the value. Specifically it checks the owner for a  
property

of the same name to see when the local value is empty to see if it is
defined higher up in the object hierarchy. I thought this would be a  
safe

way of implementing object oriented stuff.

But you get recursion when the control is a background, because the  
owner of
a background is the card the background is on, but the card is  
actually
below the background in the message hierarchy, so the background  
script gets

triggered again when you look for it in the backgrounds owner.

A recursive tongue twister maybe - but just remember a background's  
owner is

itself in scripting terms!


On the other hand, this utility function works fine for me:

function masterBG theObjectRef
   put the long id of the owner of theObjectRef into onr
   if word 1 of onr = "card" then
  return theObjectRef
   else
  return masterBG(onr)
   end if
end masterBG

It returns the highest level group a control belongs to. I have a  
stack with two major backgrounds (switch between making one or the  
other visible with a button). In my custom find function I need to  
know which master background the foundfield is part of, and it may be  
nested in lower level groups, so this tells me which bg to show when a  
string is found, and it works reliably without the recursion problem  
above.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Recursion warning: what's the owner of a background?

2010-12-23 Thread Peter Brigham MD


On Dec 23, 2010, at 9:59 AM, David Bovill wrote:


Peter, not shure if I got you right?  Why not take:

word 1 to 3 of the long id of theObjectRef


Well, word 1 to 3 of theObjectRef gives:

field id 1072

since theObjectRef looks something like:

field id 1072 of group id 1052 of group id 1057 of group id 1004 of  
card id 1009 of stack "PDdata" of stack "/Users/pmbrig/Documents/ 
Revolution stacks/ PtData-rev/ Psychopharmica.rev"


but I want to extract the short name of group id 1004, the last one  
before the card. I could have parsed the long id by replacing " of "  
with comma, finding the itemoffset of "card id" and subtracting 1, but  
for whatever reason at the time* I chose a recursive function, and it  
works fine.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

* alas, I too often find myself saying, "It seemed like a good idea at  
the time" Story of my life, in scripting, at least.




___
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: Editing locked or List fields

2011-01-02 Thread Peter Brigham MD

On Jan 1, 2011, at 5:26 PM, Sivakatirswami wrote:

I'm all the time editing locked or list fields or fields where the  
traversal is off.


The "onerous" method is of course to switch to the select tool,  
double click on the fld; choose Contents from the drop down menu,  
resize the window if you need to see more of the contents... edit  
contents


Before i cook up my own widget, which would not be hard to do, I was  
wondering what do the rest of you do?


OT: is tRev working, bug-free, with the latest versions of LiveCode?

Sivakatirswami


I use a virtual property:

on mouseup theBtn
   if theBtn = 1 and "field" is in the target and the \
  commandkey is down and the shiftkey is down then
  set the writable of the target to not the writable of the target
   else
  pass mouseup
   end if
end mouseup

setprop writable tf
   if "field" is not in the target then exit writable
   try
  set the locktext of the target to not tf
  set the traversalon of the target to tf
  set the autohilite of the target to tf
  --  catch tError
  --beep
  --answer tError
   end try
end writable

getprop writable
   if "field" is not in the target then return ""
   try
  put the locktext of the target into L
  put the traversalon of the target into T
  put the autohilite of the target into A
  if T and A and not L then return true
  return false
   end try
end writable

Put this in a library stack or a frontscript and it will work  
everywhere -- command-shift-click on any field and toggle the writable  
of the field. I use it constantly. You can revise this to just toggle  
the locktext if you work with list fields a lot, so that the usual  
hiliting and line selection are preserved, locked or unlocked.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Happy New Year

2011-01-02 Thread Peter Brigham MD

On Jan 1, 2011, at 5:29 PM, Nonsanity wrote:


Happy 1293858000!

~ Chris Innanen
~ Nonsanity


LOL!!! Now that's a Happy LC New Year!

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Date bug?

2011-01-02 Thread Peter Brigham MD

On Jan 1, 2011, at 11:58 PM, Chipp Walters wrote:


Hey, can anyone try this or tell me why it doesn't work?
If I use any other date than 11/07/2010, it generates the next date.  
But for

some reason Nov 7 doesn't work?

on mouseUp
  put "11/07/2010" into tDate
  answer nextDayDate(tDate)
end mouseUp

function nextDayDate pDate
  convert pDate to seconds

  put 60*60*24 into tSecondsInDay
  add tSecondsInDay to pDate
  convert pDate to short date
  return pDate
end nextDayDate


I think it is related to the daylight savings shift, that's why it  
works if you add an hour. Here's what I use, to avoid all problems:


function nextDayDate pDate
   convert pDate to dateitems
   add 1 to item 2 of pDate
   convert pDate to short date
   return pDate
end nextDayDate

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Date bug?

2011-01-02 Thread Peter Brigham MD

Sorry: item 3 of the dateItems.

On Jan 1, 2011, at 11:58 PM, Chipp Walters wrote:


Hey, can anyone try this or tell me why it doesn't work?
If I use any other date than 11/07/2010, it generates the next date.  
But for

some reason Nov 7 doesn't work?

on mouseUp
 put "11/07/2010" into tDate
 answer nextDayDate(tDate)
end mouseUp

function nextDayDate pDate
 convert pDate to seconds

 put 60*60*24 into tSecondsInDay
 add tSecondsInDay to pDate
 convert pDate to short date
 return pDate
end nextDayDate


I think it is related to the daylight savings shift, that's why it  
works if you add an hour. Here's what I use, to avoid all problems:


function nextDayDate pDate
  convert pDate to dateitems
  add 1 to item 3 of pDate > correction
  convert pDate to short date
  return pDate
end nextDayDate

___
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: Editing locked or List fields

2011-01-03 Thread Peter Brigham MD


On Jan 3, 2011, at 4:49 AM, Sivakatirswami wrote:


Aloha Peter:

Now this what i call a Prime New Year gift!

Sweet.

And, yes, I do work a lot with list fields  and to make lists  
editable I had to add this to your script


 set the listBehavior of the target to not tf

but then this toggles all fields to listbehavior when locked... . so  
it required more


the problem is you can determine if a field has listbehavior when it  
is set, but if you turn listbehavior off, then one needs a way to  
preserve the fact that this is a list field, even when it's  
listbehavior is off.


So I added a custom prop to list fields so that they maintain their  
list property thru the editing session.   Perhaps there is a better  
way, but this works:


by adding this to your setProp handler

 if the listbehavior of the target is true then
set the uList of the target to true
 end if
 if the uList of target = true then
set the listBehavior of the target to not tf
 end if


Nice. I'm revising my library handlers accordingly, since I will  
probably by using list fields in the future.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Editing locked or List fields

2011-01-03 Thread Peter Brigham MD

A problem, though -- see below

On Jan 3, 2011, at 4:49 AM, Sivakatirswami wrote:


Aloha Peter:

Now this what i call a Prime New Year gift!

Sweet.

And, yes, I do work a lot with list fields  and to make lists  
editable I had to add this to your script


 set the listBehavior of the target to not tf

but then this toggles all fields to listbehavior when locked... . so  
it required more


the problem is you can determine if a field has listbehavior when it  
is set, but if you turn listbehavior off, then one needs a way to  
preserve the fact that this is a list field, even when it's  
listbehavior is off.


So I added a custom prop to list fields so that they maintain their  
list property thru the editing session.   Perhaps there is a better  
way, but this works:


by adding this to your setProp handler

 if the listbehavior of the target is true then
set the uList of the target to true
 end if
 if the uList of target = true then
set the listBehavior of the target to not tf
 end if




On 1/2/11 3:28 AM, Peter Brigham MD wrote:


I use a virtual property:

on mouseup theBtn
  if theBtn = 1 and "field" is in the target and the \
 commandkey is down and the shiftkey is down then
 set the writable of the target to not the writable of the target
  else
 pass mouseup
  end if
end mouseup

setprop writable tf
  if "field" is not in the target then exit writable
  try

 if the listbehavior of the target is true then
set the uList of the target to true
 end if
 if the uList of target = true then
set the listBehavior of the target to not tf
 end if

 set the locktext of the target to not tf
 set the traversalon of the target to tf
 set the autohilite of the target to tf
 set the listBehavior of the target to not tf # required for  
list fields


The line above will set the listbehavior of all fields to true when  
setting the writable to false, and it's not necessary.



 --  catch tError
 --beep
 --answer tError
  end try
end writable

getprop writable
  if "field" is not in the target then return ""
  try
 put the locktext of the target into L
 put the traversalon of the target into T
 put the autohilite of the target into A
 if T and A and not L then return true
 return false
  end try
end writable

Put this in a library stack or a frontscript and it will work  
everywhere -- command-shift-click on any field and toggle the  
writable of the field. I use it constantly. You can revise this to  
just toggle the locktext if you work with list fields a lot, so  
that the usual hiliting and line selection are preserved, locked or  
unlocked.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


So we have then:

setprop writable tf
   if "field" is not in the target then exit writable
   try
  if the listbehavior of the target is true then -- *** see below
 set the uListBehav of the target to true -- *** see below
  end if -- *** see below
  if the uListBehav of the target = true then
 set the listBehavior of the target to not tf
  end if
  set the locktext of the target to not tf
  set the traversalon of the target to tf
  set the autohilite of the target to tf
   end try
end writable

getprop writable
   if "field" is not in the target then return ""
   try
  put the locktext of the target into L
  put the traversalon of the target into T
  put the autohilite of the target into A
  if T and A and not L then return true
  return false
   end try
end writable

on mouseup theBtn
   if theBtn = 1 and "field" is in the target and the \
  commandkey is down and the shiftkey is down then
  set the writable of the target to not the writable of the target
   else
  pass mouseup
   end if
end mouseup

But you have to add the mouserelease handler below, since clicking on  
a blank line of a list field doesn't send mouseup, it sends  
mouserelease instead.


on mouserelease theBtn
   if theBtn = 1 and "field" is in the target and the \
  commandkey is down and the shiftkey is down then
  set the writable of the target to not the writable of the target
   else
  pass mouserelease
   end if
end mouserelease

The only problem with the final result is that if you set the  
listbehavior of a field to true, then toggle the writable, then set  
the listbehavior of the field to false, it is still flagged in the  
customprop as being a list field, and when you toggle writable again  
it will revert to being a list field again. So you have to delete the  
customprop by hand to get it to behave correctly. This could be solved  
with a preopencard handler as follows:


on preopencard
   if "field" is not in the target then pass preopencard
   re

Re: RevOnline: New version of Shell Command Help

2011-01-06 Thread Peter Brigham MD

On Jan 5, 2011, at 2:22 PM, Bob Sneidar wrote:

Thanks pretty useful if you know already what the command is you  
need help with. Looks like you are getting the man pages via a shell  
call yourself.


What would make this marketable is if there was a way to list all  
the shell commands available to the system and present them to the  
user in a list, have the user be able to click on a shell command  
and have the man page load, and then be able to insert the command  
into a rev script with the proper LiveCode syntax. I would pay money  
for that!


Bob


That was just my reaction to the stack -- great if you know what  
you're doing already, but you have to know shell commands. (I dropped  
it into my Plugins folder anyway)


Is there a shell command to get all the shell commands on the  
currently running system? If so, it should be a snap to expand the  
stack accordingly.



On Dec 28, 2010, at 1:55 AM, Phil Davis wrote:


Hi folks,

I just uploaded a new version of the Shell() Command Help plugin.

New features:
- Search for words in the displayed help text.
- Print the displayed help text.
- Use arrow keys to retrieve previous commands (like the LC message  
box).


Enjoy!
--
Phil Davis


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: RevOnline: New version of Shell Command Help

2011-01-07 Thread Peter Brigham MD

On Jan 6, 2011, at 5:09 PM, Mike Bonner wrote:

Closest thing I know of would be apropos. Not a complete list, but a  
more
'targeted' list. Could implement a search box that returns an  
apropos list

(on mac and linux) and use that for a clickable.

On Thu, Jan 6, 2011 at 3:02 PM, Peter Brigham MD   
wrote:



On Jan 5, 2011, at 2:22 PM, Bob Sneidar wrote:

Thanks pretty useful if you know already what the command is you  
need help
with. Looks like you are getting the man pages via a shell call  
yourself.


What would make this marketable is if there was a way to list all  
the
shell commands available to the system and present them to the  
user in a
list, have the user be able to click on a shell command and have  
the man
page load, and then be able to insert the command into a rev  
script with the

proper LiveCode syntax. I would pay money for that!

Bob



That was just my reaction to the stack -- great if you know what  
you're
doing already, but you have to know shell commands. (I dropped it  
into my

Plugins folder anyway)

Is there a shell command to get all the shell commands on the  
currently
running system? If so, it should be a snap to expand the stack  
accordingly.


On Dec 28, 2010, at 1:55 AM, Phil Davis wrote:


Hi folks,


I just uploaded a new version of the Shell() Command Help plugin


I'm playing with this to see if I can come up with something. One  
problem: when I use

   put shell("man cp") into fld "f"
I get output like this:

CP(1) BSD General Commands  
ManualCP(1)


NNAAMMEE
 ccpp -- copy files

SSYYNNOOPPSSIISS
 ccpp [--RR [--HH | --LL | --PP]] [--ffii | --nn] [--ppvvXX]  
_s_o_u_r_c_e___f_i_l_e _t_a_r_g_e_t___f_i_l_e
 ccpp [--RR [--HH | --LL | --PP]] [--ffii | --nn] [--ppvvXX]  
_s_o_u_r_c_e___f_i_l_e _._._. _t_a_r_g_e_t___d_i_r_e_c_t_o_r_y


DDEESSCCRRIIPPTTIIOONN
 In the first synopsis form, the ccpp utility copies the contents  
of the
 _s_o_u_r_c_e___f_i_l_e to the _t_a_r_g_e_t___f_i_l_e.  In the  
second synopsis form, the con-
 tents of each named _s_o_u_r_c_e___f_i_l_e is copied to the  
destination
 _t_a_r_g_e_t___d_i_r_e_c_t_o_r_y.  The names of the files  
themselves are not changed.  If
 ccpp detects an attempt to copy a file to itself, the copy will  
fail.


 The following options are available:

 --ffFor each existing destination pathname, remove it and  
create a new
   file, without prompting for confirmation regardless of its  
permis-
   sions.  (The --ff option overrides any previous --nn  
option.)


   The target file is not unlinked before the copy.  Thus,  
any exist-

   ing access rights will be retained.


As you can see, the section titles and commands consist of doubled  
letters. How can I get a good clear text out of this? Does it have  
something to do with the text encoding? Pardon my ignorance, I'm a  
newbie to messing around with system calls.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: RevOnline: New version of Shell Command Help

2011-01-07 Thread Peter Brigham MD

On Jan 7, 2011, at 2:39 AM, Phil Davis wrote:


I just uploaded a new version of Shell Command Help to RevOnline.

New features added just now (thanks to suggestions on this list):

  * You can pick your command from the scrolling list of commands!
  * You can adjust the width of the list as needed.
  * If retrieving info about a listed command causes LC to quit, you  
can
reopen this plugin in LC and right-click on the command to  
permanently
remove it from the list. (To restore all commands to the list,  
delete the

prefs file. It lives at specialFolderPath() /pdslabs/prefs.)

I was not able to test it on Linux, but it works as expected on Mac  
& Windows.


Best -
Phil


Great! Now my ignorance has some structure to it!

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: RevOnline: New version of Shell Command Help

2011-01-08 Thread Peter Brigham MD
So, no way of decoding this easily, huh? If you do a char by char pass  
through the text and replace every doubled letter with its single,  
then you'll get sily comands How do the "geek apps" manage to  
parse it?


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jan 8, 2011, at 1:42 AM, Medard wrote:


Peter Brigham MD  wrote:


As you can see, the section titles and commands consist of doubled
letters.


I encountered this as I was trying to read the man for ls on the  
server

machine [On-Rev]... the text file I obtained was almost unreadable!

Nonetheless, "doubled" chars are interpreted as *bold* chars on geek
apps (you know, line command) ;-)

___
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: RevOnline: New version of Shell Command Help

2011-01-08 Thread Peter Brigham MD

On Jan 8, 2011, at 7:58 AM, Phil Davis wrote:


Try this:
put "ls" into tCommand
put shell("man " & tCommand & " | col -b") into fld 1

That is how my Shell Command Help plugin does it.

Phil Davis


Interesting. This trick is documented in the man page for "man" at the  
bottom, though nowhere in the syntax list does it list the "col" or "- 
b" parameters.


"To  get a plain text version of a man page, without backspaces and  
underscores, try

 # man foo | col -b > foo.mantxt"

Thanks.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: When is a Word not a Word?

2011-01-10 Thread Peter Brigham MD

On Jan 9, 2011, at 5:48 PM, Peter Haworth wrote:


Got weird things going on with the wordoffset function.  The code is:

put wordoffset(field "Selection",myLine) into mywordoffset

if field Selection contains xyz and myline contains abc def xyz,  
then wordoffset returns 3.


if field Selection contains xyz and myline contains abc def  
"xyz" (xyz in double quotes this time), wordoffset returns zero.


I've tried this with all combinations of casesensitive and  
wholematches true and false.


According to the dictionary, "A word is delimited by one or more  
spaces, tabs, or returns, or enclosed by double quotes" so why isn;t  
"xyz" recognised as a word?


Pete Haworth


Word 3 of
   abc def "xyz"
is
   "xyz"
not
   xyz

The business about "enclosed in double quotes" refers to the (to my  
mind) puzzling convention in RC, dating back to the old HC days, of  
considering anything in double quotes to be one word. So, word 3 of

   abc def "ghi jklmno"
is
   "ghi jklmno"
(with the quotes included). There was a debate about the merits of  
this convention a while back -- search the archives.


But you might have wholematches set to true.

If you do:
   put "abc def ghi" && quote & "xyz" & quote into tSentence
   put "xyz" into tWord
   put s & cr & wordoffset(tWord, tSentence)
then you get
   abc def ghi "xyz"
   4
unless the wholematches = true, in which case the wordoffset returns 0.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



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

2011-01-10 Thread Peter Brigham MD

On Jan 9, 2011, at 7:40 AM, Richmond wrote:


I want to disable the ability of Mac users to QUIT
by pressing Command-Q; tis is to force them to
use localised QUIT buttons (each with slightly
different characteristics) on cards within a stack.


This is in my saved tidbits stack, from a discussion a while back,  
maybe it will help:




From: Mark Schonewille 
Date: Fri, 16 Nov 2007 01:16:34 +0100
Re: Re: saving data in a standalone before quit
(Was Re: (mac) application menu)

Peter,

When you use the Quit menu item, Mac OS X sends an event to  
Revolution. You can catch this message with the AppleEvent handler or  
the shutdownRequest handler. On Mac OS X, I prefer to use the  
AppleEvent handler most of the time.


If you use either the AppleEvent handler or the shutdownRequest  
handler without a pass command, the application will not quit by  
itself (you can also lock messages and issue the quit command).


When you press command-Q, the Quit menu item should work just like  
when you use the mouse to select this menu item and you can catch the  
AppleEvent and shutdownRequest messages again. However, your script  
may catch the commandKeyDown message. If you don't pass this message  
with the pass command, your application may not quit.


There are versions of Revolution that don't pass the commandKeydown  
message because of a bug. There are also versions that don't pass the  
AppleEvent message.


If you are using Rev 2.8.1, problems with quitting are probably due to  
a script.


Best regards,

Mark Schonewille

Op 15-nov-2007, om 23:08 heeft Peter Brigham het volgende geschreven:

Now, the other mystery -- I convert my stack to a standalone (now  
with the correct application name in the Mac manubar!) and when I  
select "quit  from the application menu, nothing happens.  
Anyone have any ideas what could cause this behavior? Per my  
previous experiments, this is probably *not* due to anything in my  
scripting, as it seems that the quit command is handled by the  
system. So what could be the problem?





From: Marty Knapp 
Date: Sat, 17 Nov 2007 11:04:20 -0800
On: How to use Revolution 
Re: (mac) application menu

This was driving me crazy too. After messing around with it, I pieced
the following together and it's worked for me (I am using Rev 2.6.1):

on appleEvent pClass,pID,pSender  --I got this from Ken Ray's web site
  switch (pClass & pID)
  case "aevtquit"
answer "Save changes?" with "Don't Save" or "Save"
if it is "Save" then
  doSaveStuff
  pass appleEvent
else pass appleEvent
break
  default
pass appleEvent
break
  end switch
end appleEvent

on closeStackrequest
  Global homeStack
  if the short name of this stack is homeStack then
answer "Save changes?" with "Don't Save" or "Save"
if it is "Save" then
  doSaveStuff
end if
  end if
  pass closeStackrequest
end closeStackrequest

on shutdownRequest --I only use this for Windows
  Global homeStack
  if the platform contains "Win" then
if the short name of this stack is homeStack then
  answer "Save changes?" with "Don't Save" or "Save"
  if it is "Save" then
doSaveStuff
  end if
end if
  end if
  pass shutdownRequest
end shutdownRequest

Marty Knapp


___
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] time to change your iTunes password?

2011-01-11 Thread Peter Brigham MD

On Jan 10, 2011, at 11:45 AM, Mike Kerner wrote:

(In fact, in Texas, I'm allowed to shoot a robber as he's carrying  
out a
TV, in the back, who is robbing my neighbor's house...while they're  
away...
Yep, we don't have too many home invasions here. And we balance our  
budget

each year).
:-p



LIKE!


Actually, Texans are about to discover that their state faces an  
enormous budget crisis stemming from their regressive tax policy. But  
this is getting wy off topic, and I think we should keep politics  
off this list.


Besides, Texas doesn't have any cheese worth mentioning:-)

(now I've crossed the line!)

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




___
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: Somewhat OT: Revolutionaries, Scotland and Texas

2011-01-12 Thread Peter Brigham MD

On Jan 11, 2011, at 6:50 AM, David Bovill wrote:

 ... "penal policy", has nothing whatsoever to do with the "male  
member". The Latin routes are quite distinct with penal deriving  
from from the "poenalis" - that is pertaining to punishment, and not  
"penis" (the male member or "tail")


"poenalis" -- those are on the little wiggly things on your feet,  
right? Different body part entirely.   :-)


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Layers, revNavigator, & DataGrids

2011-01-12 Thread Peter Brigham MD

On Jan 12, 2011, at 2:43 PM, Tereza Snyder wrote:


On Jan 12, 2011, at 1:20 PM, Paul Looney wrote:


So, two questions:
1. Can you recommend something for layering objects in LC 4.5.1 and  
later?


Chipp’s AltLayerTools does it for me!


Is this still available? I can't find it on the Altuit website.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Layers, revNavigator, & DataGrids

2011-01-13 Thread Peter Brigham MD

On Jan 13, 2011, at 11:25 AM, Chipp Walters wrote:


AltLayerTools
http://www.gadgetplugins.com/altplugins/altLayerTools.rev
It keeps you from moving objects in and out of groups. It only move  
groups

around.

just put in msg box:
go URL "http://www.gadgetplugins.com/altplugins/altLayerTools.rev";
then save to plugins. I use with my toolbar palette.

here's another which is most helpful:
AltGroupMgr
http://www.gadgetplugins.com/altplugins/altGroupMgr.txt

It does a great job of placing and removing groups on different cards.

Both use ZERO frontscripts in favor of a 'refresh button,' mostly for
robustness and lack of conflict with some of my other frontscripts.  
I really
need to create a single frontscript library which manages  
everything. C'est

la vie.


But no replacement for the really great ability that revNavigator used  
to have, of moving a control (or a group) in or out of a group? That's  
what I miss!


Geoff Canyon, can you convince that developer of yours to do something  
about this...?  :-)


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Import Snapshot Broken in 4.5.3?

2011-01-13 Thread Peter Brigham MD

On Jan 12, 2011, at 9:07 PM, Scott Rossi wrote:


Houston, I think we have a problem.

This script works in LC (Rev) 4 OS X but generates an error in 4.5.3:
 import snapshot from rect (rect of the selobj) of the selobj

Message execution error:
Error description: value: error executing expression
Hint: import snapshot from rect (rect of the selobj) of the selobj


I must be missing something: the the syntax "rect of the selobj" seems  
to be what you would use for a LC property. If selobj is a variable  
then this would not be expected to work, and if it's a customprop then  
it should be "rect of the selobj of this stack" or some such. If on  
the other hand selobj contains a long id then shouldn't you use "rect  
of selobj" ? As it stands now, this is new syntax to me


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Import Snapshot Broken in 4.5.3?

2011-01-16 Thread Peter Brigham MD
Thanks. As usual, I discovered this for myself in the dictionary about  
4 minutes after I hit the "send" button. Another way that this list is  
useful for learning -- all I need to do is post a question and then I  
find that I already have the answer! Apparently I inadvertently  
installed an LC-uselist external in my brain. Did you create that  
utility too, Scott?


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jan 13, 2011, at 11:25 AM, Scott Rossi wrote:


Hi Peter:

"the selObj" is short for "the selectedObject".  It returns the long  
id of
whatever object is selected.  Like other LC functions, you must  
either use

the form "the xyz" or "xyz()".  In this case, both "the selObj" and
"selObj()" are the correct forms.

I found that the script works as expected when run from a control on  
the
current card, but fails when run from the message box, so it seems  
something

has broken in recent versions of the message box's script processing.

Regards,

Scott Rossi
Creative Director
Tactile Media, UX Design



Recently, Peter Brigham MD wrote:


On Jan 12, 2011, at 9:07 PM, Scott Rossi wrote:


Houston, I think we have a problem.

This script works in LC (Rev) 4 OS X but generates an error in  
4.5.3:

import snapshot from rect (rect of the selobj) of the selobj

Message execution error:
Error description: value: error executing expression
Hint: import snapshot from rect (rect of the selobj) of the selobj


I must be missing something: the the syntax "rect of the selobj"  
seems

to be what you would use for a LC property. If selobj is a variable
then this would not be expected to work, and if it's a customprop  
then

it should be "rect of the selobj of this stack" or some such. If on
the other hand selobj contains a long id then shouldn't you use "rect
of selobj" ? As it stands now, this is new syntax to me

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




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

2011-01-20 Thread Peter Brigham MD

On Jan 17, 2011, at 9:29 AM, Björnke von Gierke wrote:

For example the entry about the selectionChanged message claims that  
it's not triggered by arrow keys, but it is.


Not on my machine -- MacBook, OSX 10.5.8, Rev Studio 4.0.0-gm-1, build  
950. Arrowkeys don't trigger selectionChanged. Maybe it's different in  
4.5?


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



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

2011-01-21 Thread Peter Brigham MD

On Jan 20, 2011, at 2:12 PM, J. Landman Gay wrote:


On 1/20/11 10:21 AM, Peter Brigham MD wrote:

On Jan 17, 2011, at 9:29 AM, Björnke von Gierke wrote:


For example the entry about the selectionChanged message claims that
it's not triggered by arrow keys, but it is.


Not on my machine -- MacBook, OSX 10.5.8, Rev Studio 4.0.0-gm-1,  
build
950. Arrowkeys don't trigger selectionChanged. Maybe it's different  
in 4.5?


The field needs to have focus first.


If the insertion point is in the field then it has focus, right?

I just double-checked: created a new mainstack, put a new field in it,  
put some text into it, and put this in the field script:


on selectionchanged
   beep
end selectionchanged

and when I click anywhere in the text to change the insertion point I  
get a beep, but when I use the arrowkeys to move the insertion point I  
get no beep, just a silent shift of the insertion point.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



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

2011-01-24 Thread Peter Brigham MD


On Jan 24, 2011, at 2:23 PM, J. Landman Gay wrote:


On 1/21/11 1:00 PM, J. Landman Gay wrote:

On 1/21/11 12:47 PM, Peter Brigham MD wrote:


I just double-checked: created a new mainstack, put a new field in  
it,

put some text into it, and put this in the field script:

on selectionchanged
beep
end selectionchanged

and when I click anywhere in the text to change the insertion  
point I
get a beep, but when I use the arrowkeys to move the insertion  
point I

get no beep, just a silent shift of the insertion point.


I finally checked on this, and you're right, selectionChanged isn't  
sent in an unlocked, non-list field. Instead, arrowkeys are treated  
as keypresses like any other character, so you need to trap key- 
related messages instead.


If the field is a list field, then arrowkeys do trigger  
selectionChanged.


That makes sense, since that is the whole point of list fields, right?  
to be able to select a line or lines for various purposes.


I'm always happy with any element of consistency -- we live in a  
universe of increasing entropy and local order is to be treasured


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




___
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: LiveCode for e-book production

2011-01-30 Thread Peter Brigham MD

On Jan 29, 2011, at 10:31 AM, Javier Miranda V. wrote:

Dear friends, can you please give me your opinions on using LiveCode  
for e-book production?.  I know LiveCode, being so powerful, can  
handle complex projects involving lots of logic and structures, but  
is it suitable / practical to use it for e-book production?.  The  
possibility of compile for the new mobile operating systems is  
something wonderful that I would like to to use coupled with the  
multimedia capabilities.


I will be looking forward for your impressions about this.

Saludos,

Javier Miranda V.


If you're talking about a system to prepare ebooks for publishing in  
various formats, I would be optimistic about LC's ability to manage  
text processing -- that is one of its strengths. The question is  
getting at the APIs for the ebook formats, unless you just want to  
prepare plain text in a decent format to be uploaded as is. Others  
will know more about the technical end of the various formats, but as  
far as text and string manipulation goes, LC is very flexible and fast.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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@lists.runrev.com

2011-01-30 Thread Peter Brigham MD

On Jan 29, 2011, at 9:28 PM, John Patten wrote:

Thanks for looking into this with me!  The way you (Jim) appear to  
take what I did and turn it around in a fraction of the lines is  
amazing! Someday I want to be able to do that :-)


Jacqueline is correct. The fields make up a mixed up paragraph. I  
have it working where it lines up the mixed up fields nicely across  
and down the window. The user is to put the fields back in order. If  
one of the fields is a pixel lower on a line, or when the user has  
to start another line of fields below the first, there is a problem.  
I like your idea Jacqueline about the drop down fields but I'm  
afraid not being able to see all parts of the paragraph will make it  
too challenging at a beginning level.


I thought I could make each row of fields on the window a separate  
group. This could be done when the stack creates the fields for each  
line. However, that would mean that I would only have mixed up  
content for each line going across, and I couldn't make the user  
drag fields between lines. I want more mixed up flexibility...


Maybe I could have the fields snap to alignment some how when the  
user checks their answer and before the sort...but that still would  
not eliminate the issue with the subsequent lines of fields and  
their order over all...


LiveCode doesn't do character recognition does it (OCR)? I could do  
a screen capture, covert the pict to text and then check its  
content ;-) ...


Hmmm? What if the user drags the fields over a target...the target  
could "suck the text" out of the field and spit it out in another  
field. (This essentially would be eliminating the user to type out  
their words on a keyboard.) However, how would I handle the user  
wanting to change their order? Could the text chunks they drag into  
the target be "special chunks" that act as quasi buttons that when  
clicked on by the users recreates that specific chunk text and  
deletes itself from the answer field? The user could still drag  
their fields around on the screen to order them the way they want,  
and then just drag them into the target one at a time. What do you  
think? This seem doable?


Sure. Create a number of small text fields with behavior set to a  
behavior button and a target button. In the behavior button script set  
up mousedown and mousemove handlers to handle dragging (see the  
archives for how to do this), and in the mousemove handler include a  
'if the mouseloc is within the rect of btn "target then eatme" '. Then  
the on eatme handler in the card script takes the text of the target  
field and appends it to the display field and deletes the target  
field. In the display field, put a mouseup handler that hilites the  
clicked line briefly for user feedback then creates a new small field,  
sets it behavior to the behavior button, loads it with the line text,  
then deletes the clicked line.


If that's what you want to do. Not sure why you prefer this to just  
dragging the lines around to reorder them in the display field. I  
guess it's a game that you have in mind?


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Enhancement Vote

2011-02-01 Thread Peter Brigham MD
Looks as if Mark Waddingham has already started implementing this for  
the next build.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jan 31, 2011, at 3:56 PM, Peter Haworth wrote:

I submitted a request a while back to have an option to sort the  
substacks of a main stack in alpha name order in the IDE Application  
Browser Window.  It's report number 9299.  I have no idea if the dev  
team place any weight on the number of votes a request receives but  
if this is something you would like to see, give it a vote at http://quality.runrev.com/qacenter/show_bug.cgi?id=9299


Thanks,

Pete Haworth








___
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: No dial command

2011-02-02 Thread Peter Brigham MD

On Feb 1, 2011, at 5:29 PM, dunb...@aol.com wrote:


HC sends DTMF tones with the "dial" command through the speaker jack.
These can connect to a dialer gadget called a "TurboDialer", which  
connects to a

telephone handset.

Nothing like that in LC at all? Never mind the hardware.

It is actually possible to   make calls that way by holding the  
receiver up

to the computer speaker.

Shades of Captain Crunch.


I used this in an old HC stack. When I joined my current group  
practice I discovered that the modern phone system here (apparently a  
LAN with its own server, all self-contained) wouldn't recognize the  
tones played through the receiver. So I retired that feature. The loss  
is now somewhat mitigated by my being able to use voice-activated  
dialing on my iPhone


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

It was all so different before everything changed.


___
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 to get current text hiliteColor in Linux?

2011-02-02 Thread Peter Brigham MD

On Feb 2, 2011, at 12:44 AM, Mark Wieder wrote:


put line 6 of the effective colors of button x into tHiliteColor


The colors property! -- very handy, and not just for Linux. I should  
spend more time reading the dictionary. (I think I just revealed my  
essential geekiness.)


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Image object not existing ?

2011-02-14 Thread Peter Brigham MD
May try adding the stack specifier to the image and btn references in  
your script?

   img "imgFondSliderIntensité" of stack "myStackName", etc.
-- it sounds as if when that script is running the defaultstack has  
been set to a different stack.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Feb 13, 2011, at 9:23 AM, René Micout wrote:


Hello everybody,
I have a one card stack (LiveCode 4.5.3 build 1210 / Mac OS X  
10.6.6) named "Exagofon".
In my stack I have an image object named "imgFondSliderIntensité" to  
which reference is made from some buttons > all works perfectly.
When I put into the stack script (into "on openStack" script) this  
line :
put (the left of img "imgFondSliderIntensité") + round((the width of  
btn "btnThumbVolumeGénéral")/2,0) + vpValeur - 1 into vxX

everything continues to work well, but...
when I save the stack, I have this error message :
Chunk: no such object
Object: Exagofon
Line: put (the left of img "imgFondSliderIntensité") + round((the  
width of btn "btnThumbVolumeGénéral")/2,0) + vpValeur - 1 into vxX

Hint: imgFondSliderIntensité
Why ?
Rene(é)
___
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: Stackfiles followup

2011-02-15 Thread Peter Brigham MD

On Feb 14, 2011, at 3:01 PM, Peter Haworth wrote:

The behaviors are specified in the form "button id 1234 of stack  
"xyzSub".  I tried adding "of stack "xyz" after the behavior  
specifications but the IDE simply removes that text.


Behavior references have to be in the form of a long id:

   set the behavior of btn "testBtn" to the long id of (button id  
1234 of stack "xyzSub")


Is that the problem?

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Problem transferring focus to another object

2011-02-15 Thread Peter Brigham MD

On Feb 14, 2011, at 8:24 PM, Terry Judd wrote:

Hi there - I’m trying to build a ‘fake’ optionmenu control where the  
menu is
a list field object that is popped up over the control. I have a  
mouseMove
handler in the field to set the hilitedLines of the field and this  
all works
well provided the user clicks the control to popup the menu (field)  
and
releases the mouse before selecting an option. However, if the mouse  
is held
down then the focus stays with the control and there doesn’t seem to  
be any

way to hand it over to the menu (field).

Any suggestions?


Try grouping the control and the list field and putting the mousemove  
handler into the group script?


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: LiveCode & google maps...

2011-02-15 Thread Peter Brigham MD

On Feb 15, 2011, at 8:41 AM, John Dixon wrote:



Could some please point me in the right direction...

I
would like to use the browser object in a stack to display a google
map… that I can do. I would like to be able to choose a postcode or  
the

name of a town or village from a list in a field in the stack to place
the two markers, showing the start and finish location, get the
direction drawn on the google map and the total distance put into
another field in the stack...

If someone could point me in the
the right direction (no pun intended !) of how to go about doing this
from within LiveCode… it would be appreciated as I don't know really  
where to start..


Here is a function I have used to fetch the total distance between two  
addresses from Google maps. The function returns the distance without  
displaying any map, but you could play with the script to also display  
the map.




function getMileage
   put "http://maps.googleapis.com/maps/api/directions/xml?"; & \
  "origin=&destination=&sensor=false" into tURL
   put fld "from" into tStart
   put fld "to" into tEnd
   replace "" with urlEncode(tStart) in tURL
   replace "" with urlEncode(tEnd) in tURL
   put URL tURL into t
   put lineoffsets("",t) into startSect
   put item -1 of startSect into startSect
   put lineoffsets("",t) into endSect
   put item -1 of endSect into endSect
   if startSect = 0 or endSect = 0 then
  beep
  exit to top
   end if
   put line startSect+1 to endSect-1 of t into tSect
   put lineoffset("",tSect) into dLine
   if dLine = 0 then
  beep
  exit to top
   end if
   put sr(line startSect + dLine of t) into tMiles
   --   3.6 mi
   replace "" with empty in tMiles
   delete word -1 of tMiles
   return tMiles
end getMileage

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




___
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: LiveCode & google maps...

2011-02-15 Thread Peter Brigham MD

On Feb 15, 2011, at 11:57 AM, Devin Asay wrote:



On Feb 15, 2011, at 8:56 AM, Peter Brigham MD wrote:


On Feb 15, 2011, at 8:41 AM, John Dixon wrote:



Could some please point me in the right direction...

I
would like to use the browser object in a stack to display a google
map… that I can do. I would like to be able to choose a postcode or
the
name of a town or village from a list in a field in the stack to  
place

the two markers, showing the start and finish location, get the
direction drawn on the google map and the total distance put into
another field in the stack...

If someone could point me in the
the right direction (no pun intended !) of how to go about doing  
this

from within LiveCode… it would be appreciated as I don't know really
where to start..


Here is a function I have used to fetch the total distance between  
two

addresses from Google maps. The function returns the distance without
displaying any map, but you could play with the script to also  
display

the map.



function getMileage
  put "http://maps.googleapis.com/maps/api/directions/xml?"; & \
 "origin=&destination=&sensor=false" into tURL
  put fld "from" into tStart
  put fld "to" into tEnd
  replace "" with urlEncode(tStart) in tURL
  replace "" with urlEncode(tEnd) in tURL
  put URL tURL into t
  put lineoffsets("",t) into startSect
  put item -1 of startSect into startSect
  put lineoffsets("",t) into endSect
  put item -1 of endSect into endSect
  if startSect = 0 or endSect = 0 then
 beep
 exit to top
  end if
  put line startSect+1 to endSect-1 of t into tSect
  put lineoffset("",tSect) into dLine
  if dLine = 0 then
 beep
 exit to top
  end if
  put sr(line startSect + dLine of t) into tMiles
  --   3.6 mi
  replace "" with empty in tMiles
  delete word -1 of tMiles
  return tMiles
end getMileage



Peter,

Thanks for sharing this code. Can you tell us what format the origin  
and distance argument values need to be in? City, State, Country?  
Postal Code?


Devin


Look at the Google API. I just paid attention to the case of inputting  
addresses -- other values might be do-able. I didn't check out the  
alternative, but the API seems pretty informative.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


___
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: LiveCode & google maps...

2011-02-15 Thread Peter Brigham MD

On Feb 15, 2011, at 4:27 PM, James Hurley wrote:


Peter,

Thanks. Very interesting.

A couple of questions.

Is "lineoffsets" a custom function or a typo?

And what is the "sr" function?

Thanks again,

Jim Hurley


On Feb 15, 2011, at  10:00 AM, use-livecode-requ...@lists.runrev.com  
wrote:



function getMileage
  put "http://maps.googleapis.com/maps/api/directions/xml?"; & \
 "origin=&destination=&sensor=false" into tURL
  put fld "from" into tStart
  put fld "to" into tEnd
  replace "" with urlEncode(tStart) in tURL
  replace "" with urlEncode(tEnd) in tURL
  put URL tURL into t
  put lineoffsets("",t) into startSect
  put item -1 of startSect into startSect
  put lineoffsets("",t) into endSect
  put item -1 of endSect into endSect
  if startSect = 0 or endSect = 0 then
 beep
 exit to top
  end if
  put line startSect+1 to endSect-1 of t into tSect
  put lineoffset("",tSect) into dLine
  if dLine = 0 then
 beep
 exit to top
  end if
  put sr(line startSect + dLine of t) into tMiles
  --   3.6 mi
  replace "" with empty in tMiles
  delete word -1 of tMiles
  return tMiles
end getMileage


Ah, sorry, I forgot. A couple of other utility functions from my  
personal library that I use constantly -- so much so that it didn't  
register that they weren't LC-native. The offsets() function can be  
expanded if desired to wordoffsets(), itemoffsets(), etc. Exercise  
left to the reader, as they say (or email me off list if you need them  
and you're too busy to do it yourself).




function offsets str,ctr
   -- returns a comma-delimited list of all the offsets of str in ctr
   -- if none found, returns 0
   put "" into mosList
   put 0 into startPoint
   repeat
  put offset(str,ctr,startPoint) into os
  if os = 0 then exit repeat
  add os to startPoint
  put startPoint & "," after mosList
   end repeat
   if char -1 of mosList = "," then delete last char of mosList
   if mosList = "" then return "0"
   return mosList
end offsets

-- To find the last of multiple matches for str in ctr, use
--   item -1 of lineoffsets(str,ctr)
-- (which is what is done above in the getMileage handler.)

function sr str
   -- strips returns and other white space from str, fore & aft
   return word 1 to (the number of words of str) of str
end sr

-

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: selecting the selected

2011-02-16 Thread Peter Brigham MD

On Feb 16, 2011, at 10:10 AM, Richmond wrote:


Umm . ..

so I have a field [called fld "TEKST"]full of text and I select some  
of it with my mouse


I then click on a button that contains the following script:

on mouseUp
   copy the selected of fld "TEKST"
end mouseUp

nix!

now, I've tried "the selectedText" and "the selectedChunk" to no  
avail . . .


Please advise


First, the traversalon of the button must be false or the selection in  
the field will be wiped out by the mouseclick before it can to used.  
With this in place, if you just use:


on mouseUp
   copy
end mouseUp

if should work. An alternative is to put this in the button script:

on mouseenter
   set the selText of me to the selectedtext
end if

on mouseup
   put the selText of me into sText
   set the clipboarddata{"text"] to sText
end if

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Sample code for reading a CSV file

2011-02-17 Thread Peter Brigham MD

On Feb 17, 2011, at 3:01 PM, Paul Dupuis wrote:

First, thanks to everyone who replied, but especially to Nosanity.  
Your code reminded me that you can effectively tell when you are  
inside an encapsulated bit of data by an odd/even count of the  
encapsulation character. So, for anyone who wants it, here is a  
generalized function that I just wrote to parse a CSV file,  
regardless of the field or record delimiters (commas, tabs or  
whatever) and to deal with encapsulation appropriately.


This assumes you read the entire CSV file into a variable you pass  
into pData, so a call would look like:


put csvToArray(myEntireCSVData,return,comma,quote) into myDataAsArray

I have tested it a bit in the last 30 minutes and it working in the  
cases I tried, but did not test exhaustively and have not checked  
performance on large datasets. If any one uses this and run into an  
issue, please let me know.


function csvToArray pData, pRecordDelimiter, pFieldDelimiter,  
pEncapsulationDelimiter

 local tReservedRecordDelimiter, tReservedFieldDelimiter, tArray

 # Initialize the temporary record and field delimiters. Change  
these if your CSV file may contain them.
 put charToNum(1) into tReservedRecordDelimiter; put charToNum(2)  
into tReservedFieldDelimiter;


 # Step 1: Replace any Record or Field delimiters that are  
encapsulated with temporary characters

 set itemdel to pEncapsulationDelimiter
 repeat with i = 1 to the number of items in pData
   if trunc(i/2) = (i/2) then
 replace pFieldDelimiter with tReservedFieldDelimiter in item i  
of pData
 replace pRecordDelimiter with tReservedRecordDelimiter in item  
i of pData

   end if
 end repeat

 # Step 2: Replace all occurances of the encapsulation delimiter
 replace pEncapsulationDelimiter with empty in pData

 # Step 3: Parse records and fields into the array, replace any  
occurances of the reserved record and field delimiters for each  
element

 set itemdel to pFieldDelimiter
 set lineDel to pRecordDelimiter
 repeat with i = 1 to the number of lines in pData
 repeat with j = 1 to the number of items in line i of pData
get item j of line i of pData
replace tReservedRecordDelimiter with pRecordDelimiter in it
replace tReservedFieldDelimiter with pFieldDelimiter in it
put it into tArray[i][j]
 end repeat
  end repeat

  # Step 4: return the array
  return tArray
end csvToArray


Here's an extension of your handler that will find appropriate  
reservedDelimiters that do not appear in the csv text, so you don't  
have to hope that numtochar(1) and numtochar(2) are not in the data:


function csvToArray pData, pRecordDelimiter, pFieldDelimiter,  
pEncapsulationDelimiter

   local tReservedRecordDelimiter, tReservedFieldDelimiter, tArray
   # Initialize the temporary record and field delimiters. Change  
these if your CSV file may contain them.


   put getDelimiters(pData) into tDelim -- ## see below
   put numtochar(line 1 of tDelim) into tReservedRecordDelimiter
   put numtochar(line 2 of tDelim) into tReservedFieldDelimiter

# Step 1: Replace any Record or Field delimiters that are  
encapsulated with temporary characters

set itemdel to pEncapsulationDelimiter
repeat with i = 1 to the number of items in pData
 if trunc(i/2) = (i/2) then
  replace pFieldDelimiter with tReservedFieldDelimiter in  
item i of pData
  replace pRecordDelimiter with tReservedRecordDelimiter  
in item i of pData

 end if
end repeat

# Step 2: Replace all occurances of the encapsulation delimiter
replace pEncapsulationDelimiter with empty in pData

# Step 3: Parse records and fields into the array, replace any  
occurances of the reserved record and field delimiters for each element

set itemdel to pFieldDelimiter
set lineDel to pRecordDelimiter
repeat with i = 1 to the number of lines in pData
   repeat with j = 1 to the number of items in line i of pData
 get item j of line i of pData
 replace tReservedRecordDelimiter with  
pRecordDelimiter in it
 replace tReservedFieldDelimiter with pFieldDelimiter  
in it

 put it into tArray[i][j]
   end repeat
 end repeat

 # Step 4: return the array
 return tArray
end csvToArray

function getDelimiters tCSV
   -- return 2 non-printing ASCII characters not found in the  
variable tCSV

   put "1,2,3,4,5,6,7,8" into dList
   -- could use other non-printing ASCII values
   put false into foundOne
   repeat with i = 1 to the number of items of dList
  put item i of dList into testNbr
  if numtochar(testNbr) is not in tCSV then
 put true into foundOne
 put testNbr into delimOne
 exit repeat
  end if
   end repeat
   if not foundOne then
  doAlert
  exit to top
   end if
   delete item i of dList
   put false into foundOne
   repeat with i = 1 to the number of items of dList
   

Re: Custom cursors

2011-02-18 Thread Peter Brigham MD

On Feb 18, 2011, at 1:46 PM, David C. wrote:


Hi Richmond,
How about:
on mouseEnter
  set the lockCursor to true
  set the cursor to 1005 -- your image id
end mouseEnter

on mouseLeave
  set the lockCursor to false
  set the cursor to arrow
end mouseLeave

Best regards,
David C.



Best to not lock and unlock the cursor but rather use:
   set the defaultcursor to 1005
on mousemove (occasionally with rapid mouse movement the mousenter  
message doesn't fire off)

and then
   set the defaultcursor to empty
on mouseleave

I used to lock the cursor then unlock it, but then sometimes the  
cursor stays locked and it's very annoying to the user.


Can you use any png for a cursor? or are there constraints? I know  
that if you want transparency you need a png with alpha channel -- a  
jpg will give you an opaque square with your cursor inside it. I seem  
to remember having to do some tricks with the png image before trying  
to use it as a cursor


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Getting current OS language

2011-02-26 Thread Peter Brigham MD

On Feb 26, 2011, at 9:10 AM, Medard wrote:


Klaus on-rev  wrote:


OK, it was not Monsieur Medard, but another french man :-)


;-)


Did you know...?   Homer didn't write the Iliad, it was someone else  
with the same name.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Print No Dialog

2011-02-26 Thread Peter Brigham MD
PROGRAM, n. A series of instructions that tells a computer to turn  
one's input into error messages.
PROGRAM, tr.v. To engage in a pastime similar to banging one's head  
against a wall, but with fewer opportunities for reward.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Feb 25, 2011, at 6:27 PM, Bob Sneidar wrote:


I blame Gremlins.

Bob


On Feb 25, 2011, at 2:22 PM, Rick Harrison wrote:


Hi Bob,

Well that was very odd.  I retrieved the name of the printer.
It told me it was "Brother..."  So, I tried to print again.  This
time it worked flawlessly without any dialogs whatsoever.
Go figure.  The problem has somehow solved itself.  I guess
Livecode just needed a reminder kick in the pants in order
to know what to do!

Thank you for your help!

Rick



___
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: Inserting Image into html text of Field

2011-02-28 Thread Peter Brigham MD

Look at "imageSource" in the dictionary.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Feb 28, 2011, at 2:21 AM, RevList wrote:


It has been a while since I have done this, but I am building a help
system and want to include images in the body of some of my text  
fields.
I have a card (hidden) in my stack that has all of the images in  
it.  now

I want to reference those images inline with the html text on a field.
I have done this before, but it is late and I can't remember how I did
this.
Can anyone help?


**
Stewart Lynch
CreaTECH Solutions
sly...@createchsol.com
604.484.8499
Skype:StewartLynch

There are only 10 kinds of people.  Those who understand binary and  
those

who don't.
**

___
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: A curious case

2011-03-02 Thread Peter Brigham MD

On Mar 2, 2011, at 11:26 AM, Richard Gaskin wrote:


Andre Garzia wrote:
I tend to  work on the same way. longer forms makes shorter  
understanding
time. I'd rather write more and understand more than write faster  
and then

one week from now, be completely lost in nested mazes


Well said.

And sometimes lengthy deeply-nested IFs are good candidates for a  
switch block.


I once stumbled across two tips about code style that have been very  
helpful:


1. If a given function has nested IFs more than three levels deep,  
it may be a good candidate for breaking it up into smaller functions.


2. If a function is longer than can be viewed in one screen, it may  
be a good candidate for breaking it up into smaller functions.


Sometimes those can't be applied for sound practical reasons, but  
where they can oh boy does it make code more readable.


I grapple with this all the time. My status with LC is "dedicated  
amateur," so I may not use the best practices, but One other  
consideration is breaking out a chunk of code when it needs to be  
reusable, but this is not without problems too.


I have a number of text-processing handlers that parse out various  
context-sensitive options for constructing pop-up menus, inserting  
text strings that are themselves constructed using various if-else- 
then scenarios, etc, and these tend to result in very long handlers  
with lots of conditional branching. I keep trying to break up my long  
handlers into smaller chunks. What I run into is that to do this I  
often face trying to construct functions that require 8-10 parameters,  
which are cumbersome to call, since you have to keep careful track of  
the order in which to list things in the calling statement. Whereas  
within a long handler I can make use of multiple variables that  
already contain pieces of data and make use of them without having to  
pass them anywhere. I usually end up splitting off a chunk of code  
into a function when I find that I need to use it a number of times in  
different contexts. I end up with some handlers and functions that  
require lots of parameters but can be called from many different  
buttons, fields, menus, etc., in which case living with a long  
parameter list is well worth it for the flexibility.


I have not yet found very many tricks to avoid long multivariable  
handers, given that I'm trying to provide extremely context-sensitive  
behavior. I do end up with some very sophisticated features, eg,  
constructing a prescription for printing or just logging, checking to  
ensure the med is not in the patient's allergy list, checking if a  
telephoned prescription is a controlled drug and therefore needs a  
faxed copy and if so then setting up a reminder to fax the copy (but  
only if there is a fax number listed for the patient's pharmacy, if  
not, then a reminder to get the fax number), logging the prescription  
in the notes field and the current meds list, calculating and noting  
the expected date the med will expire, loading the med into the  
prescription history, and checking to see if a serum blood level is  
(a) necessary and (b) overdue -- all with a mouseclick on the med  
listing line, and a couple of keypresses.


It turns out that it is hard to break this kind of thing down into one- 
page handlers, but I keep trying. I tend to use switch blocks for long  
complex conditionals and if-else-then for the shorter conditionals,  
but I'm fairly sloppy about when I do one or the other. But I almost  
always construct if-else-then structures using the long form -- I  
heartily agree that it is much, much more readable.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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


new trick, for me

2011-03-04 Thread Peter Brigham MD
Just discovered a trick I didn't know about. This is in the IDE, BTW.  
I needed to have the first card of one of my stacks as the current  
card, while I do something from another stack (a utility stack). If I  
"go card 1 of stack " then the stack  comes to  
the front, but I want to keep the utility stack as the topstack, so  
even following this by "go back" or some such looks messy on screen.  
Instead, I can do this:


   set the currentcard of stack  to \
   the short name of card 1 of stack 

and it all happens in the background.

Probably others knew about this, but I didn't, so I'm posting it for  
those like me for whom it is a new trick.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


___
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: new trick, for me

2011-03-04 Thread Peter Brigham MD

It appears not to trigger openCard.

FYI, the reason that I needed to do this is that I am trying to do  
something with long id's and found what seems to be a bug in how the  
engine handles this. If I do this while on the first card of the stack:


   put the long id of control 76 of card 1 of stack 

I get something like this:

field id 1051 of group id 1045 of group id 1004 of card id 2276 of  
stack "PDdata" of stack 


But if I move to any other card of the stack, and execute the same  
command, I get:


field id 1051 of group id 1045 of group id 1004 of card id 2675 of  
stack "PDdata" of stack 


Note that the card id number in the long id is different, depending on  
which card is current -- despite that fact that I asked specifically  
for "the long id of control 76 of ***card 1*** " both times.


I know that occasionally executing commands via msg box give anomalous  
results, but that appears not to be a factor here.


So I need to be on the same card of the stack every time I fetch long  
id's for controls of that stack, or else my handlers won't work  
properly.


Bug, or what?

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Mar 4, 2011, at 1:48 PM, J. Landman Gay wrote:


On 3/4/11 12:38 PM, Bob Sneidar wrote:

I wonder if that triggers an openCard event?


No. I don't think it triggers any messages.



Bob


On Mar 4, 2011, at 10:05 AM, Peter Brigham MD wrote:

Just discovered a trick I didn't know about. This is in the IDE,  
BTW. I needed to have the first card of one of my stacks as the  
current card, while I do something from another stack (a utility  
stack). If I "go card 1 of stack" then the  
stack  comes to the front, but I want to keep the  
utility stack as the topstack, so even following this by "go back"  
or some such looks messy on screen. Instead, I can do this:


  set the currentcard of stack  to \
  the short name of card 1 of stack

and it all happens in the background.

Probably others knew about this, but I didn't, so I'm posting it  
for those like me for whom it is a new trick.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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


Re: new trick, for me

2011-03-04 Thread Peter Brigham MD

On Mar 4, 2011, at 2:17 PM, Bob Sneidar wrote:

Is the field a part of a background group? A background group  
belongs to a stack, not to a card. (I might be wrong but I doubt  
it ;-)


"belongs to" is what sense? The owner of the background group is the  
card. Can you say what you mean operationally?



Also try:

send "put the long id of control 76" to card 1 of stack 
get the result
What does that produce?


the result is empty
executing just the first line gives (for some reason) just the short  
name of the control. I'm not even going to try to decipher that anomaly.



On Mar 4, 2011, at 11:04 AM, Peter Brigham MD wrote:


It appears not to trigger openCard.

FYI, the reason that I needed to do this is that I am trying to do  
something with long id's and found what seems to be a bug in how  
the engine handles this. If I do this while on the first card of  
the stack:


 put the long id of control 76 of card 1 of stack 

I get something like this:

field id 1051 of group id 1045 of group id 1004 of card id 2276 of  
stack "PDdata" of stack 


But if I move to any other card of the stack, and execute the same  
command, I get:


field id 1051 of group id 1045 of group id 1004 of card id 2675 of  
stack "PDdata" of stack 


Note that the card id number in the long id is different, depending  
on which card is current -- despite that fact that I asked  
specifically for "the long id of control 76 of ***card 1*** " both  
times.


I know that occasionally executing commands via msg box give  
anomalous results, but that appears not to be a factor here.


So I need to be on the same card of the stack every time I fetch  
long id's for controls of that stack, or else my handlers won't  
work properly.


Bug, or what?



This still strikes me as a bug.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Efficiency question for list modification

2011-03-16 Thread Peter Brigham MD

On Mar 12, 2011, at 6:13 PM, Alex Tweedly wrote:

You're right. Sorry - I was misled by the docs, which describe the  
order of the combine following the description of the 'first' form  
of the combine command, and then go on to describe the second form,  
including the fact that the keys of the array must be all numeric.   
I put 2 + 2 together and got a much too large answer :-(


"2 + 2 = 5, for sufficiently large values of 2."

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: Getting a single column of a datagrid

2011-03-22 Thread Peter Brigham MD


On Mar 21, 2011, at 11:56 PM, Trevor DeVore wrote:




*private* *function* _printCharXTimes pChar, pTimes

  *local* theStr



  *repeat* with i = 1 to pTimes

 *put* pChar after theStr

  *end* *repeat*

  *return* theStr
*end* _printCharXTimes


A way to do this without a loop (don't know if it's faster):

private function printCharXtimes pChar, pTimes
   set the linedelimiter to pChar
   put pChar into line pTimes of tVar
   return tVar
end printCharXtimes

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




___
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: newbie script question re Find command

2011-03-22 Thread Peter Brigham MD

On Mar 22, 2011, at 5:31 PM, Timothy Miller wrote:


Hiya,

I guess I never tried to write a script like this before. Thought it  
would be simple... Well, it is simple, probably, just not simple in  
a way that I actually understand.


How do I find multiple instances of a string in a given field of a  
given card and record each foundchunk in a variable, and then stop  
repeating the find command when the last instance is found?


I want to do this in the context of a repeat loop that goes to all  
the cards in the stack in sequence.


Sooo, I also need to know... How do I tell the repeat loop to move  
on to the next card:


- if no instance of the string is found on the card

- and

- after the last instance of the string is found on the card

Hope that's clear.

I understand I'll probably want to nest a repeat loop using the find  
command on each card, with exits when certain conditions are met.  
I'm choking on the details.


I don't need a complete and accurate script. Just the general idea.

Thanks in advance.

Tim (the world's oldest newbie)


It's never too late to be a newbie!   :-)

Here is a function that returns the all the offsets of a string in a  
container:


   function offsets tStr,tCntr
  -- returns a comma-delimited list of all the offsets of tStr in  
tCntr

  put "" into mosList
  put 0 into startPoint
  repeat
 put offset(tStr, tCntr,startPoint) into os
 if os = 0 then exit repeat
 add os to startPoint
 put startPoint & "," after mosList
  end repeat
  if char -1 of mosList = "," then delete last char of mosList
  if mosList = "" then return "0"
  return mosList
   end offsets

Using that, you could first

   mark cards where fld  contains 

then loop through the marked cards and find the full list of  
foundchunks:


   put empty into foundList
   put length(tStr) into strLength
   repeat with c = 1 to the number of marked cards
  put the name of marked cd c into cdName
  put fld  of marked cd c into fldContents
  put offsets(tStr, fldContents) into offsetList
  replace comma with cr in offsetList
  repeat for each line f in offsetList
 put f & "|" & f+strLength-1 & "|" & cdName & cr after  
foundList

 -- use pipe char as delimiter,
 -- or any other char not found in data
  end repeat
   end repeat
   if char -1 of foundList = cr then delete char -1 of foundList

this will give you the full list of foundchunks in the form:

78|85|card id 1016
266|273|card id 1016
13|20|card id 1018
... etc.

and you can parse this by setting the itemdelim to "|" and referring to

   char (item 1 of line n of foundList) to (item 2 of line n of  
foundList) of  of (item 3 of foundList)


to get the chunks.

Not tested, and can probably be streamlined, but you get the idea

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig





___
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: Weird script behaviour (was libUrlDownloadToFile & urlProgress)

2011-03-22 Thread Peter Brigham MD
You don't have a "do" statement in there somewhere, do you? The only  
way I could imagine that kind of behavior happening would be with  
something like "do script of this card."


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Mar 22, 2011, at 9:38 PM, Gerry Orkin wrote:


Jacqueline,

As I mentioned, it goes crazy. Setting a breakpoint in the referring  
button script jumps me to the top line of the card script, but not  
to the handler being called. The trace shows that LiveCode is  
attempting to evaluate every line of code in the card script,  
starting from the top, and including blank lines.


Gerry

-- http://gerryorkin.com

On 23/03/2011, at 8:02 AM, "J. Landman Gay"  
 wrote:



On 3/22/11 1:10 AM, Gerry wrote:

So more messing about reveals that my problem wasn't with
libUrlDownloadToFile at all - but it's still weird.

I have a button that calls a command - upDateSongs - from its  
script.


If upDateSongs is in the stack script everything works fine. However
if it's in the card script the app goes mad - it starts processing  
the

card script from the top, running any code it encounters (my
urlProgress code was at the top of the card script, so it was
triggered by the sending of upDateSongs from the button - hence my
suspicions about libUrlDownloadToFile and urlProgress).

Crazy. And it makes me wonder if my stack is somehow corrupt. Anyone
seen that before?


Never. You may have some duplicate handlers somewhere, or handlers  
that call others you aren't expecting. The best thing would be to  
set a breakpoint near the beginning of the code sequence and step  
into every line until you see what's calling the wayward code.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.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


mileage -- re tax time

2011-03-31 Thread Peter Brigham MD
A little utility I put together that I use for totaling deductible  
milage for tax purposes. Enter a "from" address and a "to" address,  
click a button to fetch the mileage for that trip (uses Google Maps  
and parses the HTML), click another button and add the trip to a  
cumulative list of trips, with total mileage updated as you go.


Available for anyone who might find it useful, at:
http://home.comcast.net/~pmbrig/mileage.rev.zip

Let me know if there are problems

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


___
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: mileage -- re tax time

2011-03-31 Thread Peter Brigham MD

On Mar 31, 2011, at 8:47 AM, dunb...@aol.com wrote:


Hi.


Couldn't access the page. I am not authorized.


You probably caught a 45 second window when I was uploading a minor  
change to the file. Try again.



Craig Newman

A little utility I put together that I use for totaling deductible  
milage for
tax purposes. Enter a "from" address and a "to" address, click a  
button to fetch
the mileage for that trip (uses Google Maps and parses the HTML),  
click another
button and add the trip to a cumulative list of trips, with total  
mileage

updated as you go.


Available for anyone who might find it useful, at:
http://home.comcast.net/~pmbrig/mileage.rev.zip

Let me know if there are problems


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




___
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: mileage -- re tax time

2011-03-31 Thread Peter Brigham MD

On Mar 31, 2011, at 8:52 AM, Klaus on-rev wrote:


Hi Peter,

A little utility I put together that I use for totaling deductible  
milage for tax purposes. Enter a "from" address and a "to" address,  
click a button to fetch the mileage for that trip (uses Google Maps  
and parses the HTML), click another button and add the trip to a  
cumulative list of trips, with total mileage updated as you go.

Available for anyone who might find it useful, at:
http://home.comcast.net/~pmbrig/mileage.rev.zip


Cool!


Let me know if there are problems


Yep, I don't have a car! :-D


Yeah, I don't think that you can deduct mileage walked:-)

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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: mileage -- re tax time

2011-03-31 Thread Peter Brigham MD

On Mar 31, 2011, at 12:12 PM, Bob Sneidar wrote:


Now THAT would make a GREAT iPhone app!


Feel free to use it as the basis for something. I haven't tried to  
delve into the iPhone/iPad/mobile platform, as I have my hands full  
with my full-time job and LC desktop. If someone wants to take this  
and run with it on mobile, please contact me off list.



On Mar 31, 2011, at 5:25 AM, Peter Brigham MD wrote:

A little utility I put together that I use for totaling deductible  
milage for tax purposes. Enter a "from" address and a "to" address,  
click a button to fetch the mileage for that trip (uses Google Maps  
and parses the HTML), click another button and add the trip to a  
cumulative list of trips, with total mileage updated as you go.


Available for anyone who might find it useful, at:
http://home.comcast.net/~pmbrig/mileage.rev.zip

Let me know if there are problems


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig




___
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: novice question re "marked" and customkeys

2011-03-31 Thread Peter Brigham MD
I suspect that using a customproperty of the card would be faster for  
large numbers of cards. Accessing the contents of a field is slow,  
relative to pulling customprops. But it probably doesn't matter unless  
you have >1000 cards.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Mar 31, 2011, at 1:26 PM, Bob Sneidar wrote:

I think you are right Mark. A hidden field with the word "barked" or  
"darked" in it and some use of the find command would serve you  
better. Undarking all cards though would definitely require a repeat  
loop or a recursive call, with Exit to top when you cannot find any  
more.


Bob


On Mar 31, 2011, at 10:18 AM, Timothy Miller wrote:


Hey dudes,

The "marked" property is so easy to use. "go next marked" and  
"unmark all cards" are so fast and foolproof! Very handy.


I'm wondering if I can somehow define my own versions of "marked"

E.g., in a hypothetical stack, the "marked" of cards 3, 10, 22 and  
99 is "true"


I somehow define my own properties, like "barked" and "darked"

In the same hypothetical stack, the "barked" of cards 1,2, 3 and 4  
is "true"


the "darked" of cards 2,4,6,8 and 99 is "true"

Somehow I could "go next barked" or "go next darked" just as fast  
and easy as I could "go next marked"


In this perfect world, I could "unbark" or "undark" all cards as  
easily as I could unmark them.


I suspect this isn't really possible. I suspect the closest  
equivalent would be to use customkeys and repeat loops, to find the  
next card with a certain value of a certain customkey, and so on. I  
suspect this would be somewhat slower than "go next marked" or  
"unmark all"


The marked of a card resembles a customkey, but I suspect it works  
differently. True?


Is it possible to "go next" to a card with a certain value of a  
certain customKey? Or is it necessary to use a repeat loop to  
inspect the each card until I encounter the customKey and value I  
want?


Is it possible to "set the poodleNose of all cards to empty"? I  
suspect not.


Am I getting this right? Am I missing anything important?

Thanks in advance,

Tim
___
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: novice question re "marked" and customkeys

2011-03-31 Thread Peter Brigham MD
"mark cards where..." is very fast and very flexible. Using a  
(possibly hidden) checkbox button should be quite feasible even with  
lots of cards. To "unbark all" you can loop through all the cards and  
set the hilite of the button to false -- be sure not to *go* to the  
cards, just loop through them by reference -- and that should be quite  
fast as well. (set the hilite of btn "barked" of marked card n to  
false) Or, 'mark cards where the hilite of btn "barked" = true' and  
then loop through the marked cards, set the hilite of btn "barked" to  
false, then unmark all cards. Cycling through the cards by reference  
is fast ('set the hilite of btn "barked" of marked card n to false')  
-- always, always, always avoid things like "go card n" within a loop,  
since that takes lots of time.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Mar 31, 2011, at 7:07 PM, Pete wrote:

I think Mike's solution is the best.  I didn't know you could mark  
cards in
the way he suggested - doesn't seem much point in rolling your own  
when LC
can do it for you.  I guess the performance thing could be an issue  
if you

can't use a custom property and there's a large number of cards.
Pete

On Thu, Mar 31, 2011 at 1:33 PM, Timothy Miller <
gand...@doctortimothymiller.com> wrote:


A big thankya goes out to Peter, Mike, Bob and Peter. Good ideas all.

Tim


On Mar 31, 2011, at 10:49 AM, Peter Brigham MD wrote:

I suspect that using a customproperty of the card would be faster  
for
large numbers of cards. Accessing the contents of a field is slow,  
relative
to pulling customprops. But it probably doesn't matter unless you  
have >1000

cards.


-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig



___
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





--
Pete
Molly's Revenge <http://www.mollysrevenge.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


  1   2   >