Re: How to create a hyperlink within a text field?

2016-02-03 Thread Peter Brigham
Two ways to do it. The first and simplest is to lock the screen and do 2
finds in succession, as you suggested. The second is to get the lineoffsets
of the link text and scroll to the second occurrence of it. Once you find
the line offset of the actual chapter heading, use "the formattedheight of
line 1 to chapterLineNbr of fld xxx" to get the scroll, and then set it
accordingly.

-- Peter

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


On Wed, Feb 3, 2016 at 8:39 AM, Tiemo Hollmann TB 
wrote:

> Alternativly I also tried to work with lineOffset and setting the vScoll of
> the field. The lineOffset gives me the number of the found textline, but
> not
> the visible line number of a scrolling field with word wrap, which can be
> resized. In such a field the "effective" line number can vary, depending on
> the current size of the field.
> Is there anything such as the "effective lineOffset", or even better a
> direct approach to scroll to the found chunck? Probably I don't see the
> obvious.
> Tiemo
>
> -Ursprüngliche Nachricht-
> Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im
> Auftrag
> von Tiemo Hollmann TB
> Gesendet: Mittwoch, 3. Februar 2016 12:07
> An: LiveCode User Liste senden 
> Betreff: How to create a hyperlink within a text field?
>
> Hello,
>
> just not to invent the wheel again. I have a long text field with a table
> of
> contents at the beginning and headlines for chapters and I would like to
> make the table of content clickable as hyperlinks, so that the user is
> forwarded to the wanted chapter in the same field.
>
> I can set the textstyle of each chapter in the table of content to "link"
> and handle the  click in "on linkClicked pLink", no problem about that.
>
> The question is, how to handle the field scrolling to the wanted chapter
> headline after clicking on the hyperlink. When using "find whole pLink in
> the target", the find command finds first the chapter headline in the table
> of content and stops at the top. I could cheat this, by doubleing the find
> command, so that the second find command goes on searching and finds the
> real chapter headline and scrolls the field to the wanted chapter.
>
> But I think that there must be a more straight forward way to realize this
> kind of hyperlink.
>
> Thanks
>
> Tiemo
>
>
>
>
>
>
>
> ___
> 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 create a hyperlink within a text field?

2016-02-03 Thread Peter Brigham
A third alternative: split off the chapter title list into another field --
a list field -- and then you can just do a simple find in your text field
when the user clicks in the chapter list field.

-- Peter

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


On Wed, Feb 3, 2016 at 8:39 AM, Tiemo Hollmann TB 
wrote:

> Alternativly I also tried to work with lineOffset and setting the vScoll of
> the field. The lineOffset gives me the number of the found textline, but
> not
> the visible line number of a scrolling field with word wrap, which can be
> resized. In such a field the "effective" line number can vary, depending on
> the current size of the field.
> Is there anything such as the "effective lineOffset", or even better a
> direct approach to scroll to the found chunck? Probably I don't see the
> obvious.
> Tiemo
>
> -Ursprüngliche Nachricht-
> Von: use-livecode [mailto:use-livecode-boun...@lists.runrev.com] Im
> Auftrag
> von Tiemo Hollmann TB
> Gesendet: Mittwoch, 3. Februar 2016 12:07
> An: LiveCode User Liste senden 
> Betreff: How to create a hyperlink within a text field?
>
> Hello,
>
> just not to invent the wheel again. I have a long text field with a table
> of
> contents at the beginning and headlines for chapters and I would like to
> make the table of content clickable as hyperlinks, so that the user is
> forwarded to the wanted chapter in the same field.
>
> I can set the textstyle of each chapter in the table of content to "link"
> and handle the  click in "on linkClicked pLink", no problem about that.
>
> The question is, how to handle the field scrolling to the wanted chapter
> headline after clicking on the hyperlink. When using "find whole pLink in
> the target", the find command finds first the chapter headline in the table
> of content and stops at the top. I could cheat this, by doubleing the find
> command, so that the second find command goes on searching and finds the
> real chapter headline and scrolls the field to the wanted chapter.
>
> But I think that there must be a more straight forward way to realize this
> kind of hyperlink.
>
> Thanks
>
> Tiemo
>
>
>
>
>
>
>
> ___
> 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: Probably a pointless question about using sort to search..

2015-12-10 Thread Peter Brigham
Someone on this list at some point posted an array sorting function that
might be relevant here for some applications. See below.

-- Peter

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

"Why is the alphabet in that order? Is it because of that song?"
-- Steven Wright


function sortArray @pArray, sortMode
   -- sort the values of an array, returning a numerically-keyed array
   --   whose values increase as the keys increase
   -- call it as follows
   --   put sortArray(tArray) into sortedArray
   -- pArray is referenced to avoid duplicating large arrays in memory
   --but pArray is not changed by this function
   -- sortMode = {"text"|"textCaseSens"|"numeric"|"dateTime"}
   --textCaseSens sets caseSensitive to true before sorting by text
   --if sortMode = empty, defaults to numeric
   -- not sure who wrote this

   if sortMode = empty then put "numeric" into sortMode
   # create a list of the array entry values
   put the keys of pArray into keyList
   repeat for each line k in keyList
  put pArray[k] & cr after valueList
   end repeat
   delete char -1 of valueList
   # sort the list as directed
   switch sortMode
  case "textCaseSens"
 set the casesensitive to true
  case "text"
 sort lines of valueList
 break
  case "numeric"
 sort lines of valueList numeric
 break
  case "dateTime"
 sort lines of valueList dateTime
 break
   end switch
   # transform the sorted list back to a numerically indexed array
   split valueList by return
   return valueList
end sortArray


On Thu, Dec 10, 2015 at 11:36 AM, Bob Sneidar 
wrote:

> You can get the keys of an array and sort them before accessing them. The
> array itself cannot be sorted, and there would be no benefit to doing so
> that I can see.
>
> Bob S
>
>
> On Dec 9, 2015, at 07:56 , Mike Bonner > wrote:
>
> I was just thinking how useful sort could be to find things (in an array or
> whatever)
>
> ___
> 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: list field not getting arrowkey msg

2015-07-20 Thread Peter Brigham
Unfortunately, I still get nothing with the hilitedlines of me in the
field script. The arrowkey message is not going to the field.

Here's the arrowkey handler in the card script. This works fine but I don't
know why it should be necessary.

on arrowkey what
   put hilitedline of fld notesList into lineNbr
   put the number of lines of fld notesList into totNbr
   switch what
  case left
  case right
 pass arrowkey
 break
  case up
 if lineNbr = 1 then
put totNbr into nextLineNbr
 else
put lineNbr - 1 into nextLineNbr
 end if
 break
  case down
 if lineNbr = nextLineNbr then
put 1 into nextLineNbr
 else
put lineNbr + 1 into nextLineNbr
 end if
 break
   end switch
   set the hilitedline of fld notesList to nextLineNbr
   put line nextLineNbr of fld notesList into listEntry
   put getItem(listEntry, 1, tab) into noteTitle
   displayNote noteTitle
   pass arrowkey
end arrowkey

-- Peter

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


On Mon, Jul 20, 2015 at 2:14 PM, J. Landman Gay jac...@hyperactivesw.com
wrote:

 On 7/19/2015 10:17 PM, Peter M. Brigham wrote:


 There is a line selected. If I put the following into the field script:

 on arrowkey
 put the hilitedlines
 end arrowkey

 then click in the field to select a line, then hit up- or
 down-arrowkey, nothing happens. The field is apparently not getting the
 arrowkey message. It's acting as though the traversalon of the field is
 false, but it's not.



 What do you get if you put this into the field script:

 on mouseUp
  put the hilitedlines of me
 end mouseUp

 BTW, I think your arrowkey test needs of the target. Hilitedlines
 without an object reference is probably always empty.

 --
 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: Insertion point problems

2015-06-24 Thread Peter Brigham
What I do for this is store the selectedchunk in a customprop or a script
local on mouseEnter in the button script that will be doing the pasting.
That way if the mousedown removes the current selection you already have
the info you need. BTW, if you set the traversalon to false for the button,
the current selection should be preserved, which will obviate the need for
this workaround.

-- Peter

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


On Tue, Jun 23, 2015 at 7:35 PM, Bob Sneidar bobsnei...@iotecdigital.com
wrote:

 On a Mac, I opened two stacks, one with a button, one with a field. I
 palletized the first stack, then set the insertion point in the field in
 the second one. Clicking the button in the palletized stack still causes
 the field on the second stack to lose focus.

 I don’t think there is a way to change this behavior. The workaround that
 comes to my mind is to have an exitField handler in the field which saves
 the selection in a property or global variable that the palette stack can
 access. Alternatively you could have an exitField handler inserted as a
 front script when the palette opens, so that the selection can be saved
 somewhere.

 That is how I would go about this.

 Bob S


  On Jun 23, 2015, at 15:06 , J. Landman Gay jac...@hyperactivesw.com
 wrote:
 
  On 6/23/2015 4:49 PM, dfepst...@comcast.net wrote:
  I want a menu button in a palette to paste the clipboard's contents
  to the topStack at the selectedChunk.  This works if the
  selectedChunk actually includes some hilited text (char 1 to 4...),
  but not if the selectedChunk is an insertion point (char 4 to
  3...).  In the second case, but not in the first, the insertion
  point disappears and the selectedChunk property loses its value when
  a palette button is pressed, so the paste fails.
 
  This looks like a bug to me. If selectedchunk is valid in one case, it
 should also be valid in the other.
 
  --
  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

Re: Insertion point problems

2015-06-24 Thread Peter Brigham
The difference may be that in Bernd's case the traversalon of the button is
false, whereas in David's case the traversalon of the button is true, which
will void the current selection in the field on mousedown.

-- Peter

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


On Tue, Jun 23, 2015 at 7:30 PM, BNig bernd.niggem...@uni-wh.de wrote:

 this works for me from a palette stack for both selected text or blinking
 cursor

 on mouseUp
put the topStack into tTop
go stack tTop
put the selectedChunk into tSC

if tSC   then -- or whatever
   paste
end if

 end mouseUp

 Kind regards
 Bernd



 --
 View this message in context:
 http://runtime-revolution.278305.n4.nabble.com/Insertion-point-problems-tp4693251p4693267.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: Cyclomatic complexity

2015-06-08 Thread Peter Brigham
Despite my inclinations, however, my accountant reminds me I'm not getting
any younger, and that I need to remain mindful of little things down the
road like retirement.

Retirement? Oh yeah, seems to me I've heard of that.

-- Peter

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

I *am* retired -- I was tired yesterday and I'm tired again today.


On Sun, Jun 7, 2015 at 12:08 PM, Richard Gaskin ambassa...@fourthworld.com
wrote:

 Skip wrote:

  Richard wrote:
 
  Here's that thrown-together result:
  http://fourthworld.net/lc/4w-projprofiler.png
 
  I think there might be several people interested in your stack,
  if you are willing to share :)

 Very - whenever I post a screen shot of a tool I'm working on the
 intention is to make that tool available once it's been sufficiently
 debugged and productized.

 As Steven McConnell reminds us in his book Code Complete, the difference
 in level of effort between a personal tool and a product can be an order of
 magnitude, because with a tool it need only be possible to use it
 correctly, but with a product it should be impossible to use it
 incorrectly.

 My inclination is to give tools and code away at no cost, and sometimes
 even under GPL or other open source licenses when they're a good fit for
 the project's goals, so folks can use them and share them easily.

 Despite my inclinations, however, my accountant reminds me I'm not getting
 any younger, and that I need to remain mindful of little things down the
 road like retirement.

 Like most of us, I toss together ad hoc solutions to help with whatever I
 need to do in my professional work, and now and then things are either so
 trivial that they don't require much polishing to be worth sharing (e.g.
 gZipper and DeskView), or are so necessary to my professional work that
 they're already at least polished enough for others to use (e.g. devolution
 and Flight Recorder).

 But other things require a bit of work to turn them from something useful
 only to me into something that can benefit others as well.

 Looking at the GBs of PBIs (Partly-Baked Ideas) on my hard drives I
 realize some of those would be useful to share - if I can find a way to
 make the time for that away from client work.

 I've considered various forms of crowd-funding, but for small things like
 dev tools it's often more work to set up a campaign and manage it within
 Kickstarter or even IndieGoGo than to just finish the tool itself.

 So while I'm focused right now on meeting some hefty client deadlines, I
 wanted to at least confirm that yes, the code base analysis tool and others
 will become available at first opportunity (devolution 4.0 is very close to
 testable release), and to let you know I'm considering a donation-based
 system to gauge the community's interest in these sorts of things.

 I'm open to other ideas, but at the moment donations seem a good balance
 of flexibility for both myself and anyone interested in the tools.

 There will likely be multiple donation levels to choose from, so if you
 want email support that would be available at a certain minimum, and other
 incentives for higher amounts, yet still allow a gratis option for those
 who may not yet have income streams the tools contribute to.

 There are risks with any model, and I don't expect any donations from dev
 tools to do as much for my retirement as consumer apps do.  But every
 little bit helps so that's my intention at the moment, unless someone here
 has a better idea for both making more money to keep such efforts viable
 while also making the tools very easily available for anyone who can
 benefit from them.

 --
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  
  ambassa...@fourthworld.comhttp://www.FourthWorld.com

 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: Forcing 'paste' to paste plain text

2015-05-06 Thread Peter Brigham
Try this:
   put the clipboarddata[text] into the selection

-- Peter

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



On Wed, May 6, 2015 at 12:00 PM, Graham Samuel livf...@mac.com wrote:

 I want to make sure that any text pasted by my ‘paste’ menu gets pasted as
 plain (unstyled) text whether or not it is styled to start with. Probably a
 dumb question but I can’t quite see how to do this with ‘the
 clipboardData’. Can anyone suggest how this should be done?

 TIA

 Graham
 ___
 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: Something like charIndex, but in a variable...

2015-04-30 Thread Peter Brigham
Here's a function I use all the time, which may come in handy:


function offsets str, pContainer
   -- returns a comma-delimited list of all the offsets of str in pContainer
   -- returns 0 if not found
   -- note: offsets(xx,xx) returns 1,3,5 not 1,2,3,4,5
   -- ie, overlapping offsets are not counted
   -- note: to get the last occurrence of a string in a container (often
useful)
   -- use item -1 of offsets(...)
   -- by Peter M. Brigham, pmb...@gmail.com — freeware

   if str is not in pContainer then return 0
   put 0 into startPoint
   repeat
  put offset(str,pContainer,startPoint) into thisOffset
  if thisOffset = 0 then exit repeat
  add thisOffset to startPoint
  put startPoint  comma after offsetList
  add length(str)-1 to startPoint
   end repeat
   return item 1 to -1 of offsetList -- delete trailing comma
end offsets


-- Peter

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


On Thu, Apr 30, 2015 at 10:48 AM, J. Landman Gay jac...@hyperactivesw.com
wrote:

 Will the offset function work?

 put the number of chars in line 1 to 14 of tVar into tCount
 put offset(startChar, line 15 of tVar)  + tCount into tStart
 put offset(endChar, line 15 of tVar)  + tCount into tEnd


 On April 30, 2015 3:07:05 AM CDT, Malte Brill revolut...@derbrill.de
 wrote:
 Hi all,
 
 I need to find the start and end character of chuncks in a variable. If
 we are in a field we can use charIndex for that. However, in a variable
 I have no good idea on how to do something similar to
 
 get charIndex(token 7 of line 15 of field „myField“)
 
 
 Any ideas?
 
 All the best,
 
 Malte
 
 
 ___
 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

 --
 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: Power Status (was Re: Because LC can't do two things at once.)

2015-03-05 Thread Peter Brigham
So the Unix case should be:

 if there is a file /sys/class/power_supply/BAT0/ then
put url /sys/class/power_supply/BAT0/ into tStatus
 else if is a file /sys/class/power_supply/BAT1/ then
put url /sys/class/power_supply/BAT1/ into tStatus
 else
return no battery
 end if
 put word 1 of tStatus into tStatus
 return
caseSwitch(tStatus,discharging=Battery,charging,unknown,full=AC, \
   =no battery,*=*)

Double-check me on this.

-- Peter

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


On Thu, Mar 5, 2015 at 11:27 AM, Mark Wieder mwie...@ahsoftware.net wrote:

 Peter-

 Wednesday, March 4, 2015, 5:10:53 AM, you wrote:

  and what I see on my Thinkpad running linux Mint 17 is status returns
 one of
  three states:
 
  Unknown if the laptop is plugged into the AC adapter
  Discharging if running off the battery power
  Charging if it's (wait for it) charging the battery.

  Please clarify: Unknown if using the AC adapter, and Charging
  if it's charging the battery. How could you be charging the battery
  if you're not using the AC adapter?

  Is Unknown reserved for when you're plugged in and the battery is
  fully charged?

 Yes. The battery is in place but neither charging nor discharging. I
 do see that the Unknown description is ambiguous there.

  If I remove the battery and run the laptop off AC power there is no BAT0
  directory.

  OK, so a test for no such file is called for.

 Yes, there are four possible states. And then I guess in Richard's
 case you'd also have to check for BAT1.

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

 This communication may be unlawfully collected and stored by the National
 Security Agency (NSA) in secret. The parties to this email do not
 consent to the retrieving or storing of this communication and any
 related metadata, as well as printing, copying, re-transmitting,
 disseminating, or otherwise using it. If you believe you have received
 this communication in error, please delete it immediately.


 ___
 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: Power Status (was Re: Because LC can't do two things at once.)

2015-03-02 Thread Peter Brigham
What gets returned in
   get URL /proc/acpi/battery/BAT1/state on Unix?
If you give me a sample to work with I will finish the handler and post it.

-- Peter

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


On Mon, Mar 2, 2015 at 11:15 AM, Richard Gaskin ambassa...@fourthworld.com
wrote:

 Michael Doub wrote:

 Looking around in /proc I found no acpi on the Pi.


 Thanks for checking, Michael.

 That would make sense, because AFAIK the Pi has no Advanced Configuration
 and Power Interface in its chip set, and hence the absence of that key in
 /proc would accurately reflect a non-discharging battery state (since there
 ain't no battery at all).

 I'll explore further to see if I can find a definitive reference on that,
 but so far it looks like we're on our way.

 For any Linux-using laptop owners here (that means you, Mark Wieder g):
 do you find your charging status in:

  /proc/acpi/battery/BAT1/state

 ...or:

  /proc/acpi/battery/BAT0/state

 ?

 --
  Richard Gaskin
  Fourth World Systems
  Software Design and Development for the Desktop, Mobile, and the Web
  
  ambassa...@fourthworld.comhttp://www.FourthWorld.com

 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: 7.0.1-RC1 selectively not obeying open card in script?

2014-11-07 Thread Peter Brigham
On Nov 6, 2014, at 4:58 PM, Peter Haworth wrote:

 I spent an hour yesterday trying to track down a bug that turned out to be
 caused by a misspelled variable name.

I don't use explicit variables, so I avoid misspelling variable names by using 
Jaques' scriptPaint handler. Put this into a universal (frontscript) library 
script, so it's available everywhere in LC:

on controlkeydown which
  if which = space and the shiftkey is down then
 put the long name of the target into targRef
 if field is not in targRef then pass controlkeydown
 if revNewScriptEditor is not in targRef then pass controlkeydown
 put the mouseText into the selection
  else
 pass controlkeydown
  end if
end controlkeydown

Then just set the insertion point in a script and hover over a variable name 
and hit the spacebar (with control + shift) and the variable name is copied 
over for you. Adjust the modifier keys as needed -- in my workflow I use 
control-shift-key for all my scripting shortcuts.

-- 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: Shared Doc

2014-11-05 Thread Peter Brigham
It surely is malware -- a number of people in my address book have gotten
this message. I am very sorry for the annoyance. This is the very first
time in 20 years on the Mac I've had a problem with my machine getting
hijacked. It looks as if this originates from google Docs, which I have
never used, but someone recently sent me a link to a google Doc file, which
I opened. I wonder if this somehow triggered something? Anyone using google
Docs who knows something about this, I'd appreciate some insight.

-- Peter

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


On Mon, Nov 3, 2014 at 6:00 PM, PystCat pyst...@gmail.com wrote:

 I know… I’ve been getting a LOT of these the past month.  They are getting
 VERY annoying.


  On Nov 3, 2014, at 5:59 PM, J. Landman Gay jac...@hyperactivesw.com
 wrote:
 
  On 11/3/2014, 4:54 PM, Pyst Cat wrote:
  What is this..?  Is this some kind of phishing expedition..?
 
  Probably malware on his computer. Ignore it.
 
  --
  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

Re: scrollbars for a stack?

2014-11-05 Thread Peter Brigham
Here's one solution, no scrollbars but allows scrolling using the
scrollwheel or two-finger touchpad scrolling if available. Put the
following into the card script of your stack (or the stack script if more
than one card):

on rawkeydown what
  put the top of stack myStack into t
  if what = 65308 then -- scroll down
set the top of stack myStack to t-12
-- adjust the parameter as desired
  else if what = 65309 then -- scroll up
set the top of stack myStack to t+12
  else
pass rawkeydown
  end if
end rawkeydown

-- Peter

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


On Tue, Nov 4, 2014 at 12:13 PM, Dr. Hawkins doch...@gmail.com wrote:

 My application generates pdf full pages (it has to; the forms are specified
 by the courts, and the program is to prepare them)


 Some of the text can be small (remember, I can't change that!), so I have
 coded to use scaleFactor to allow zooming.  On even a 15 screen, this will
 rapidly create a stack taller than the screen.  In other cases, someone
 might simply want to zoom yet use less screenspace.

 Currently, the rendering is done by placing the groups on card 1 of the
 output stack.  It would seem simpler to simply slap scrollbars onto the
 stack, and let the user scroll when desired--but this doesn't seem to be a
 supported feature of livecode, unless I've missed something.

 The cleanest (least dirty?) way I see to achieve this at the moment is to
 create yet another group containing all of my display groups, and resize
 that group each time the window resizes.

 Or is there a better way?
 --
 Dr. Richard E. Hawkins, Esq.
 (702) 508-8462
 ___
 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


Fwd: Shared Doc

2014-11-05 Thread Peter Brigham
Ah, found out something about this:

From McAfee:

-

The Google Docs phishing scam is a textbook example: it aims to trick you
into handing over sensitive login details, and it does exceptionally well
http://gizmodo.com/beware-of-this-dangerously-convincing-google-docs-phish-1546278702.
The scam starts with an email referring to an “important document” stored
on Google Docs. Clicking on the link in this message will take you to what
appears to be a Google Docs login page—but it’s not. This fake login page
allows scammers to collect your username and password for their own
malicious use.

Unfortunately for Gmail users, the page in this case is remarkably
convincing—emulating Google’s typical login page. And here’s the clincher:
because this scam is hosted on Google’s servers (the scam is, after all, a
public folder on Google Drive) it effectively sidesteps one of the more
reliable ways to detect a phishing scam. Generally speaking, phishing URLs
are one or two characters different from the official website that they’re
masquerading as. To top things off, because the scammers were hosting this
attack on Google’s servers, the URL appears to be secure.

This attack on Google Doc users is especially troubling as Google uses a
single login across all of their services. If the scammers successfully
obtained login credentials for your Google Docs, they’d also be able to
access your email, Chrome browsing history (including searches), YouTube
account, and perhaps even be able to make purchases through the Google Play
store if you’ve previously registered your payment information.

Despite the sophistication of this scam, there’s light at the end of the
tunnel. After its discovery earlier this week, Google has successfully
removed the phishing pages. They’ve also stated that their “abuse team is
working to prevent this kind of spoofing from happening again.”
-

I have changed my google password.

-- Peter

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


-- Forwarded message --
From: Peter Brigham pmb...@gmail.com
Date: Wed, Nov 5, 2014 at 9:34 AM
Subject: Re: Shared Doc
To: How to use LiveCode use-livecode@lists.runrev.com


It surely is malware -- a number of people in my address book have gotten
this message. I am very sorry for the annoyance. This is the very first
time in 20 years on the Mac I've had a problem with my machine getting
hijacked. It looks as if this originates from google Docs, which I have
never used, but someone recently sent me a link to a google Doc file, which
I opened. I wonder if this somehow triggered something? Anyone using google
Docs who knows something about this, I'd appreciate some insight.

-- Peter

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


On Mon, Nov 3, 2014 at 6:00 PM, PystCat pyst...@gmail.com wrote:

 I know… I’ve been getting a LOT of these the past month.  They are getting
 VERY annoying.


  On Nov 3, 2014, at 5:59 PM, J. Landman Gay jac...@hyperactivesw.com
 wrote:
 
  On 11/3/2014, 4:54 PM, Pyst Cat wrote:
  What is this..?  Is this some kind of phishing expedition..?
 
  Probably malware on his computer. Ignore it.

___
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

Shared Doc

2014-11-03 Thread Peter Brigham
Hi,
 I've shared an item with you.


Gmail Signups
Click Here http://budlebaybookings.co.uk/amen/index.php for slideshows(2)
Gmail sheets: create and edit spreadsheets online.
___
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


Shared Doc

2014-11-03 Thread Peter Brigham
Hi,
 I've shared an item with you.


Gmail Signups
Click Here http://budlebaybookings.co.uk/amen/index.php for slideshows(2)
Gmail sheets: create and edit spreadsheets online.
___
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: Tools Bar In The Way

2014-10-20 Thread Peter Brigham
in the messagebox: set the topleft of  stack revApplicationOverview to
150,150

-- Peter

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


On Mon, Oct 20, 2014 at 3:30 AM, Brahmanathaswami bra...@hindu.org wrote:

 Back into some stack work again after doing server side scripting (in lc)
 for nearly 2 years. I have a lot of catch up to do...

 Some things in the IDE are still very wonky (even irritating)

 e.g. I dragged the application browser window up underneath the tools bar
 that is underneath the OS menu bar (OSX)

 Now I cannot access it to get it back down without using some msg cmd to
 reset the topleft.

 There used to be a way to minify the top of window tool set... now it
 seems the only thing you can do is suspend dev tools, but if you do that
 the application browser also disappears.

 Swasti Astu, Be Well!
 Brahmanathaswami

 Kauai's Hindu Monastery
 www.HimalayanAcademy.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: the effective me?

2014-08-07 Thread Peter Brigham
I'm already using it, since it will be done at some point and then it works
in the past too. I will have downloaded it some time ago. The future me
will have, that is.

-- Peter

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



On Wed, Aug 6, 2014 at 10:55 PM, J. Landman Gay jac...@hyperactivesw.com
wrote:

 On 8/6/2014, 9:05 PM, Mark Wieder wrote:

 What if I want to refer to that me or the other me or the me next
 door or the me that used to be?


 That won't be an issue until the time warp stack is done.

 --
 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: popUp a button with itself on modified mouseDown?

2014-07-02 Thread Peter Brigham
I'm late to this discussion but here's what I do. It's a modular solution,
and I use it a lot. It's great for contextual menus for right-clicking in a
field (customize the button contents depending on context) and I've often
used it for just what you are doing, to offer a popup list on
right-clicking a standard button. Once it's set up you will likely find
yourself using it for lots of things, since calling it is as simple as:
   put popChoose(Vera,Chuck,Dave,-,Lovely Rita,Nowhere Man)
into uChoice

function popChoose
   -- create a popup button in your mainstack or a library stack
   --button style = menu, menumode = popup, name = contextualMenu
   --button script:
   --  on menupick what
   -- set the uSelection of me to what
   --  end menupick
   -- make the button invisible when you're done, if needed

   -- then paste this handler into a suitable stack script, so it's
available anywhere
   --could be the same stack the button is in, but that's not necessary
   -- enter the short name of the stack containing the button
   --into the constant declaration below.

   -- popChoose() can accept a cr-delimited list of choices
   --or a comma-delimited list
   -- eg: put Vera  cr  Chuck  cr  Dave into choiceList
   -- put popChoose(choiceList) into userChoice
   -- or: put popChoose(choice1,choice2,choice3) into userChoice
   -- or: put popChoose(One,Two,Three) into userChoice

   constant popChooseStackName = yourLibraryStack

   put the params into tList
   put offset((,tList) into q
   delete char 1 to q of tList
   delete char -1 of tList
   replace comma  space  quote with comma  quote in tList
   replace quote  comma  quote with cr in tList
   if char 1 of tList = quote then delete char 1 of tList
   if char -1 of tList = quote then delete char -1 of tList
   put empty into u
   set the uSelection of btn contextualMenu of stack popChooseStackName
to empty
   put tList into btn contextualMenu of stack popChooseStackName
   popup btn contextualMenu of stack popChooseStackName
   put the uSelection of btn contextualMenu of stack popChooseStackName
into u
   set the uSelection of btn contextualMenu of stack popChooseStackName
to empty
   put empty into btn contextualMenu of stack popChooseStackName
   -- belt and suspenders, don't leave contents hanging around
   select empty
   if u = empty then
  exit to top
  -- ie, mouseRelease, no action
   end if
   return u
end popChoose

-- Peter

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


On Mon, Jun 30, 2014 at 7:36 PM, Michael Doub miked...@gmail.com wrote:

 create a popup button
 move it to -100,-100

 create your standard visible button with the following script:

 on mousedown thebutton
   popup button x
else
   beep
end if
 end mousedown

 Does this do what you want?

 -= Mike



 On Jun 30, 2014, at 7:19 PM, Dr. Hawkins doch...@gmail.com wrote:

  On Mon, Jun 30, 2014 at 4:17 PM, Michael Doub miked...@gmail.com
 wrote:
 
  Take a look at the button style, menumode and general appearance
  properties.  I would think that you could dynamicly change the style and
  menu mode and general appearance.   Just a thought….
 
 
  Within limits, it does that so far.
 
  The code I have successfully changes the button type; my problem is
 getting
  the now-popup to pop.
 
  --
  Dr. Richard E. Hawkins, Esq.
  (702) 508-8462
  ___
  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: New chunks

2014-03-13 Thread Peter Brigham
On Wed, Mar 12, 2014 at 9:32 PM, Paul Dupuis p...@researchware.com wrote:

 Can someone probably construct some sequence of characters that could be
 called a sentence that might get mis-parsed? Possibly - I am familiar
 with the library RunRev is using only by reputation, so I can't say for
 sure. However for most text you will work with where you want to return
 sentence 2 of paragraph 5 of fld X you will get exactly what you expect.


How about this:

In later years, P.G. Wodehouse always went by P.G. Wodehouse might have
thought that Pelham Grenville sounded snooty.

No algorithm is going to manage this kind of thing, where the reader has to
understand the meaning of the sentences to parse them correctly. The
question is how seldom will mistakes occur.

-- 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] 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=47914id=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: 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 http://www.mollysrevenge.com
 
 
 
 
 On Mon, Aug 1, 2011 at 8:38 AM, Michael Kann mikek...@yahoo.com wrote:
 
 Jim,
 Now I get it. Good one-liner.
 Mike
 
 --- On Mon, 8/1/11, Jim Ault jimaultw...@yahoo.com wrote:
 
 From: Jim Ault jimaultw...@yahoo.com
 Subject: Re: How do I remove part of a path?
 To: How to use LiveCode use-livecode@lists.runrev.com
 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: 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 p...@mollysrevenge.com 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 http://www.mollysrevenge.com
 
 
 
 
 On Sat, Jul 30, 2011 at 11:48 AM, Jeff Massung mass...@gmail.com 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 p...@mollysrevenge.com 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 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
 
 
 ___
 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: 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: 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 effe...@wanadoo.fr
 To: use-livecode use-livecode@lists.runrev.com
 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,
 I don't know anybody who programs (although most of my acquaintances
 have computers and Google all day, 

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
   ... rest of your initialization here ...
   ...
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: 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 k...@sonsothunder.com 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 pmb...@gmail.com
 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
 
 
 __**_
 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
 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

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 rene.mic...@numericable.com 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: 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):

-- script snippet
local dvdr =   -- or whatever

-- tEntry contains the template for an entry

replace timestamp with tTime in tEntry
replace firstName with tFirstName in tEntry
replace lastName with tLastName in tEntry
replace message with msgText in tEntry
repeat while cr is char -1 of fld msgList
   delete char -1 of fld msgList
   -- make sure no empty lines in fld
end repeat
if line -1 of fld msgList  dvdr then
   put cr  dvdr after fld msgList
end if
put the number of lines of fld msgList into startLineNbr
put cr  tEntry after fld msgList
set the textFont of line startLineNbr+1 to -1 of fld msgList \
   to empty -- start with no formatting
-- on timestamp
set the textSize of line startLineNbr+1 of fld msgList to 8
set the forecolor of line startLineNbr+1 of fld msgList \
   to gray
-- firstName lastName: wrote:
set the textStyle of word 1 to -2 of line startLineNbr+2 of \
   fld msgList to bold
-- message
set the textSize of line startLineNbr+3 to -1 of fld msgList \
   to 16
set the forecolor of line startLineNbr+3 to -1 of fld msgList \
   to blue
-- /script snippet

HTH,
-- Peter

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


On Jul 9, 2011, at 12:53 AM, Ian McKnight wrote:

 Hi John
 
 I would look at the HTMLtext property in the Manual/Dictionary.
 
 You would take your text, line by line, and wrap each one with the
 appropriate HTML code
 eg
 put font color=grey size=1dateStamp/fontcr into myMsg
 put font color=black size=2bfirstNamesurName/b/fontcr after
 myMsg
 put font color=bluetheMessage/fontcr after myMsg
 set the HTMLText of fld myField to myMsg
 
 To get the size 16 point text you may have too set the default text size of
 the field to 16 - the HTML should vary it.
 To get the ruled line I think it will be necessary to produce a graphic line
 and use the img src tag to reference it.
 
 
 I haven't tried this so you may have to change the colour references to
 numeric values but this hopefully will put you on the correct track
 
 
 On 9 July 2011 08:22, John Allijn john.all...@alice.nl wrote:
 
 Hi,
 
 I have a textfield where I want to present a chunk of text, formatted in a
 few different styles.
 
 This is what the text looks like:
 
 ---
 On timestamp
 firstname Lastname wrote:
 message text
 ---
 
 and this is how I like to represent it:
 
 - the text on timestamp should be gray and 8 points
 - the firstname and lastname should be 10 points, black and bold
 - the message should be 16 points, blue, regular.
 - put in a divider-line
 
 The problem is that the message-text varies in length and that there may be
 multiple messages in the field. This means (but maybe I'm wrong) that I have
 to set the TextColor and TextSize properties while populating the field and
 that I cannot do this afterwards.
 
 So:
 - How can I set the style of the text, put some text in the field and
 change the style again?
 - how can I put in a horizontal line that separates the messages?
 
 thank you for your thoughts!
 John.
 ___
 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
 
 
 
 
 -- 
 Regards
 
 
 Ian McKnight
 
 iangmckni...@gmail.com
 ===
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your subscription 
 preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode


___
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:
 
  a href=TestThis is a test/a
 
 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: 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: 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 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


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: [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 j...@siphonophore.comwrote:
 
 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.comuse-livecode-requ...@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-livecodehttp://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: 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 the90% 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: 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 p div without links, or with a 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 td valign=top align=center 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 p with lineChar in tText
   replace /font/tdtd valign=topfont face=Arial size=-1 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: [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: 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:
 
 http://quality.runrev.com/show_bug.cgi?id=3157
 
 :)
 
 --
 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: 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: Happy International Geek Pride Day!!!

2011-05-25 Thread Peter Brigham MD
You know you're a geek when you see a movie trailer and you think, 'I have 
that typeface.'

-- Peter

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



On May 25, 2011, at 11:52 AM, Jonathan Lynch wrote:

 Hi everyone,
 
 I just wanted to wish any of the folks on this list who might be a geek,
 nerd, dork, dweeb, or even a goon, a happy International Geek Pride Day :)
 
 Today, in celebration, I wore a short sleeve button up shirt, a tie that is
 tied too short, and fake horn rimmed glasses with tape in the middle!
 
 May you all rejoice in the joys of geekiness,
 
 Jonathan
 
 -- 
 Do all things with love
 ___
 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] MacDefender

2011-05-21 Thread Peter Brigham MD
On May 21, 2011, at 4:13 AM, Martin Baxter wrote:

 On 19/05/2011 19:50, Richmond Mathewson wrote:
 
 My father (78-9) touched the 'update' thing on Ubuntu and fairly
 effectively hosed his
 laptop; now into week 4 of a trans-Europe (England-Bulgaria) e-mail
 attempt to unhose
 things . . .
 
 I've done that with ubuntu too, the impressive part is how it hoses the
 update thing itself. I assume that's to prevent you making the same
 mistake again.
 
 Updates, pah! We don't need no stinkin' updates.

Definition:

Update, n. In software, a program revision that introduces a new set of bugs, 
typically even more unexpected and serious than the user has been accustomed to.

-- 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: Staying on a field

2011-05-06 Thread Peter Brigham MD
On May 3, 2011, at 9:14 PM, Bill Vlahos wrote:

 I do a validity check on a field to see if the user entered a valid date. If 
 the user entered a valid date and presses TAB or RETURN the focus moves on to 
 the next field. However, if the user enters an invalid date I want to keep 
 the focus on the field to try again.
 
 This field script does everything correctly except that it doesn't set the 
 focus back on the field. What am I doing wrong?
 
 on closeField
   if me is not a date then
  answer error Not a valid date. Retry? with No or Yes
  if it is Yes then 
 focus on me
 exit closeField
  end if
   end if
   pass closeField
 end closeField

Is there some reason you use focus on me as opposed to select text of 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: CustomProperties

2011-05-06 Thread Peter Brigham MD
On May 5, 2011, at 8:37 PM, dunb...@aol.com wrote:

 You can. You can even set a custom property to an entire stack.
 
 
 I use these all the time, they are incredibly powerful and convenient.
 
 
 But I do not understand what it means to set a property to an object, as 
 opposed to a chunk of text (or maybe a video file?). So you can set the xxx 
 of btn b1 to btn b2. And if you then get the xxx of btn b1, you will 
 get empty, unless you have made button b2 into a container, and put some 
 text into it. In that case you get that text back. But that is not the same 
 thing as having the button itself as the contents of the property, is it?
 
 
 It is a disconnect between what I think of as a property, and what I think of 
 as a container.
 
 
 Can't wait to see how this works; I have always wondered...
 
 
 Craig Newman

Apparently it's not possible. I pulled this out of the list archives:

--

Ian McKnight wrote:

  On 30/03/07, Richard Gaskin ambassador at fourthworld.com wrote:
 
 You can store a stack file in a custom property, but I don't know of a way 
 to 
 store individual controls there.
 
 You may find the copy command will do what you need quite handily, since it 
 lets you specify a target for the copy:
 copy obj to dest
 
  e.g.:
 
 copy grp 1 of stack TemplateParts to this cd of stack UserStack
 
 When using the to option with the copy command it doesn't affect the 
 user's clipboard, making it really convenient for both you and your user.
 
 Hi Richard
 
 I tried your suggestion with
 
 copy grp mygroup of this stack to the umycustomProp
 
 and got a Script Compile error
 Error description: Function: missing '('
 
 So I guess that controls can't be stored there.
 
 Correct. As I'd written, I know of no way to 
 store controls in custom properties.
 
The copy command can be used by simply storing your groups in some other 
stack as a repository, copying them into the user's stack as needed.



If you don't want to use a storage stack, which is really the easiest thing to 
do, you can approximate storing a control as a customprop with something like 
this:

put the properties of btn myBtn into btnProps
-- btnProps is an array of properties
set the storedBtn of stack myStack to btnProps

The, to reconstitute the control (I think of this as adding water to a 
freeze-dried stew and sticking in in the microwave...),

put the storedBtn of stack myStack into btnProps
create invisible button
set the properties of it to btnProps

(will also make the new button visible if the original was visible)

-- 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: Find restricted to the current card?

2011-05-01 Thread Peter Brigham MD
On May 1, 2011, at 11:50 AM, James Hurley wrote:

 I have a field with the script:
 
 on mouseUP
   put the value of the clickline into tText
   set itemdel to tab
   put item 1 of tText into tText
   find string  tText in field thetext
 end mouseUP
 
 
 When I click on a line in the field RR finds the string in the field 
 theText and a second click on the same line finds the next instance of the 
 string in the same field. 
 
 But if, on subsequent clicks, it fails to find the string in the field 
 theText on the current card, it goes looking for the string on any other 
 card with a field named theText
 
 Is there a way to do something like:
 
 find string tText in field theText ON THIS CARD
 
 So that it will not jump to other cards containing a field of the same name 
 and the same text. (Without having to go through the stack and rename fields 
 so that there are no duplicates?)
 
 In short, restrict the search to the current card.
 
 Jim Hurley

Try this (untested, but should work):

on mouseup
   put the value of the clickline into tText
   set the itemdelimiter to tab
   delete item 2 to -1 of tText
   put the short id of this card into origCdID
   lock screen
   find string tText in fld theText
   if the short id of this card  origCdID then
  go cd id origCdID
  beep
  find empty
   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: FORMalizer -- form printing utility

2011-04-30 Thread Peter Brigham MD
On Apr 30, 2011, at 9:37 AM, william humphrey wrote:

 Formalizer is very nice. I too have to do that all the time and your layout
 is an improvement. The only steps still remaining are the conversion of the
 PDF to a jpg or png. That is a time-consuming process in Photoshop. All the
 forms tend to be PDF's. It's too bad LiveCode doesn't work better with
 PDF's.

On the Mac at least, Preview (the default native app for opening PDFs, will 
save as... JPG or PNG. Very easy. Or, you should be able to print the 
document to a PDF file instead of sending it to a printer driver. Either way, 
Photoshop should not be necessary.

Glad you find the utility useful.

-- 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: comparing content of two fields

2011-04-28 Thread Peter Brigham MD
On Apr 27, 2011, at 11:55 PM, Ronald Zellner wrote:

 I  have two data fields that have multiple tabbed columns,
 I want to determine which items in the main field (1247 lines)  also appear 
 in the second field (436 lines).
 
 Using this code to compare line by line:
 
 on mouseUp
 
   set the itemDelimiter to tab
   repeat with x = 1 to the number of lines in field All -- there are 1247 
 lines
 
  repeat with y = 1 to the number of lines in field Rural  --there are 
 436 lines
 if item 1 of line x of field All = item 1 of line y of field 
 Rural then
put Rural into item 4 of line x of field All
set the textColor of line x of field All to red
exit repeat
 else
put - into item 4 of line x of field All
 end if
 
  end repeat
   end repeat
 end mouseUp

Try this:

on mouseUp
  put fld All into allEntries
  put fld Rural into ruralEntries
  set the itemDelimiter to tab
  repeat with x = 1 to the number of lines in allEntries -- there are 1247 lines
 if cr  (item 1 of line x of allEntries)  tab is in cr  ruralEntries then
   put Rural into item 4 of line x of field All
   set the textColor of line x of field All to red
   exit repeat
else
   put - into item 4 of line x of field All
 end if
  end repeat
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


FORMalizer -- form printing utility

2011-04-26 Thread Peter Brigham MD
As I just used this utility stack of mine again recently and was reminded of 
how much it streamlines a particular task, I thought I'd make it available to 
anyone who would like to use it.

In this age of electronic everything, there are still situations when you have 
to fill out a paper form for some reason. If you have to do this repeatedly it 
gets onerous, and it's particularly annoying if you are just rewriting 
information you have in a stack. FORMalizer allows you to print out a form with 
fields automagically filled in with data from a Rev stack. I use it because I 
have to print out and fax stuff to insurance companies, etc. I used to have to 
fill in all the fields by hand -- now I click a button and the form pops up 
with all the fields filled in for me, and I print it and send it out.

FORMalizer automates creating a built-in form as a substack of your mainstack. 
How it works: Open your data stack, then open the FORMalizer palette, then 
click a button to import a PNG or JPG of the form you need. (Multiple page 
forms are supported.) Adjust the rect of the image(s) if necessary. Next, click 
a button on the palette to create a field overlaying the form, name the field, 
move it to the correct position on the form, resize it if required, and repeat 
until all the fields you need are created. You can set the font and fontsize 
for the fields as desired. FORMalizer also makes it easy to create checkboxes 
(actually small locked square fields) and even groups of checkboxes that behave 
like radiobuttons (clicking one member of the group checks that button and 
unchecks the others in the group).

Then, click the clone and attach... button on the palette to clone the form 
stack and attach it as a substack of your data stack. Finally, click a button 
to put a pre-made script snippet on the clipboard, and paste the snippet into 
your data stack script (or wherever is appropriate in your message path). You 
can then edit the script, which will look something like this:

on emailReleasePrint
   set the label of btn FMprint of stack emailRelease to print
   put empty into fld id 1960 of card 1 of stack emailRelease -- clinName
   put empty into fld id 1961 of card 1 of stack emailRelease -- clinEmail
   put empty into fld id 1963 of card 1 of stack emailRelease -- anc1name
   put empty into fld id 1964 of card 1 of stack emailRelease -- anc1relp
   put empty into fld id 1965 of card 1 of stack emailRelease -- anc1phone
   put empty into fld id 1966 of card 1 of stack emailRelease -- anc1email
   put empty into fld id 1967 of card 1 of stack emailRelease -- anc2name
   etc.
   put show into tMode
   send printForm  quote  tMode  quote to stack emailRelease
end emailReleasePrint

Replace those emptys with anything you like -- fld clinName, 
firstLast(ptName, true), item 3 of fld ancillary -- and when you call the 
handler the fields will be filled appropriately and the form will appear for 
review (and for filling in other fields by hand if you need to) and for 
printing.

This is a specialized need, to be sure, but if you have the need, here is a 
solution that will save you time and aggravation.

Download at:
http://home.comcast.net/~pmbrig/FORMalizer.rev.zip

-- 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: Popup menu menuhistory

2011-04-22 Thread Peter Brigham MD
On Apr 22, 2011, at 12:44 PM, Marty Knapp wrote:

 Thanks for the suggestion Craig. I did tinker with this some more:
 
 So in my test field I have this script:
 
 on mousedown whichButton
   if whichButton is not 3 then exit mousedown
   put the mouseLoc into ML
   get lineOffset(the text of me,btn myPopUpButton)
   if it is not 0 then
  --For the X coordinate: move the menu over to the left a bit so it's 
 under the cursor
  subtract 8 from item 1 of ML
 
  --For the Y coordinate: take the line number and multiply by apparent 
 line
  --height of menu text and adjust so the menu pops up at the correct line
  subtract (it*19)-10 from item 2 of ML
   end if
   popup btn myPopUpButton at ML
 end mousedown
 
 
 Then in my hidden test popup menu, I have numbers 1 through 35. This works 
 until I type in a number that causes the popup menu to hit the top of the 
 screen. Unlike an option menu, it does not truncate itself with a scroll 
 arrow - it just stops at the top of the screen with the first menu item at 
 the top. Interesting, it will truncate with a scroll arrow if it hits the 
 bottom of the screen.
 
 Any thoughts or suggestions?

The formattedrect function will give you the location (relative to the window) 
of a chunk of text. Don't know if that would help.

-- 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: Data-Entry in a LiveCode form using the tab key

2011-04-19 Thread Peter Brigham MD
Solved one part of the problem -- there has to be a wait with messages after 
the mouseclick. Without this the mousecontrol always returns empty. I have no 
idea why.

I haven't yet figured out how to change the cursor to ensure the user knows 
s/he is still in the doFieldOrder mode -- it doesn't stick after the first 
click. If you will be actually using this technique then I can investigate 
further to find a fix for that.

The following works except for the cursor problem. Right clicking ensures that 
the mouseclick is sent even with unlocked fields.

on doFieldOrder
   answer RIght-click on the fields in the order you want. \
  When done, press the commandkey. as sheet
   repeat
  set the defaultcursor to hand
  -- why does this only work the first time??
  wait until (the mouseclick or the commandkey is down)
  if the commandkey is down then exit repeat
  wait 1 tick with messages
  put word 2 of the mousecontrol into mc
  put the long id of control mc into fID
  if not (fID begins with field) then -- not a field
 answer You must click on a field!
 set the defaultcursor to hand -- try again
 next repeat
  end if
  select the text of fID -- user feedback
  wait 5
  select empty
  put word 3 of fID  cr after fldList -- short id
  set the defaultcursor to hand -- try again
   end repeat
   delete char -1 of fldList
   put fldList
   --  set the tabOrderList of this card to fldList
   set the defaultcursor to empty
   beep -- user feedback
end doFieldOrder

-- Peter

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


On Apr 18, 2011, at 6:39 PM, Bob Sneidar wrote:

 
 Also to test this I made a simple stack with this in the card script and a 
 button that calls it:
 
 on doFieldOrder
   put empty into theFieldList
 
   repeat
   if the commandkey is down then exit doFieldOrder
   wait until the mouseclick
   put the clickfield  cr after theFieldList
   wait 1 second
   select empty
   end repeat
   put theFieldList
 end doFieldOrder
 
 WHOOPS! Should be: 
 if the commandkey is down then exit REPEAT
 
 But theFieldList still returns empty, even after I put this into a mouseUp 
 handler. Also, I noticed that the selection did not change. Apparently, 
 mouseUp messages are not getting sent to the object I am clicking on because 
 I am within a mouseUp message already I guess?? Doesn't sound right though. 
 
 Bob
 
 
 
 ___
 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: Rev/Livecode project and GPL Licenses

2011-04-18 Thread Peter Brigham MD
On Apr 17, 2011, at 7:15 PM, Richard Gaskin wrote:

 Peter Brigham wrote:
 
 On Apr 15, 2011, at 10:14 AM, Richard Gaskin wrote:
 
 Scott McDonald wrote:
 Where I was getting it mixed up, was that I was equating selling
 commercially with not making the source code available.
 
 But of course, they are not the same thing.
 
 Not exactly the same, but how many people pay for milk when they can get 
 the cow for free?
 
 Many, many people. If it means they don't have to milk the cow themselves, 
 and feed it, and stable it, and call the vet when it's ill There's value 
 added by the coder who puts something useful together and maintains it, even 
 if the product is open license and could be hacked at will.
 
 Can you think of three examples of software governed by the GPL has its
 development expenses met by sales of the software itself?
 
 It seems most of the FOSS world is doing something very different

I expect that you are right, and I actually don't know all the ins and outs of 
the licensing schemes, much less have any experience with choosing any of them. 
I guess I was just responding to the general point. How it plays out in 
practice I'll defer to you and others who know more.

-- Peter

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

In theory, theory and practice are the same. In practice, they're
different.
-- Yogi Berra


___
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: Data-Entry in a LiveCode form using the tab key

2011-04-18 Thread Peter Brigham MD
On Apr 18, 2011, at 12:43 PM, Bob Sneidar wrote:

 Or you can get a list of fields whose focusable is true and locktext is false 
 (because you don't want to tab to labels now do you) and then present the 
 developer with an interface where they can click sequentially on the fields 
 in the order that they want to tab through, then save that list in a property 
 of the card. Your tab through function can then get the short name of the 
 current target, find it in the property list, check to see if it's the last 
 one, get the first item if so, the next item if not, and then focus on that 
 field. 
 
 The advantage to this approach is that it will work universally for any card. 
 Ideally you would want to copy every editable field on the card to a new one, 
 along with a Cancel and Save button, and then save the list of fields in a 
 property of the original card. 

You wouldn't have to make a whole new card, just a menuitem which launches 
something like (not tested):

on doFieldOrder
   answer Click on the fields in the order you want. When done, press the 
commandkey.
   repeat
  if the commandkey is down then exit repeat
  wait until the mouseclick
  put word 2 of the clickfield into cf -- fld nbr
  if cf = empty then -- not a field
 answer You must click on a field!
 next repeat
  end if
  select the text of fld cf -- user feedback
  wait 5
  select empty
  put the short id of fld cf  cr after fldList
   end repeat
   delete char -1 of fldList
   set the tabOrderList of this card to fldList
   beep -- user feelback
end doFieldOrder

then use the customprop to find the id of the next field in the list when the 
user tabs out of the field.

-- 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: Palette question

2011-04-18 Thread Peter Brigham MD

On Apr 18, 2011, at 12:58 PM, Scott Rossi wrote:

 Even better: quit LiveCode and your stack will be COMPLETELY not resizable

Quit LiveCode??? You can do that

-- 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: Rev/Livecode project and GPL Licenses

2011-04-17 Thread Peter Brigham MD
On Apr 15, 2011, at 10:14 AM, Richard Gaskin wrote:

 Scott McDonald wrote:
 
 Thanks Mark for clarifying that.
 
 Where I was getting it mixed up, was that I was equating selling
 commercially with not making the source code available.
 
 But of course, they are not the same thing.
 
 Not exactly the same, but how many people pay for milk when they can get the 
 cow for free?

Many, many people. If it means they don't have to milk the cow themselves, and 
feed it, and stable it, and call the vet when it's ill There's value added 
by the coder who puts something useful together and maintains it, even if the 
product is open license and could be hacked at will.

-- 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: Currently playing song on iPod Touch

2011-04-01 Thread Peter Brigham MD
Tom McGrath put together an iTunesLibrary in LC. I can't seem to find  
it in my LC files, but I'm sure he would make it available to you. I  
used his library to make a little thing called iTunesWidget. Pop it  
into your plugins folder, and any time you're running in the IDE, you  
can open it up and use it to control iTunes without leaving LC. It's a  
little 32-pixel round customwindowshape stack that can be set as a  
systemwindow if you want, uses AppleScript to manage iTunes' basic  
functions. Very simple: click to start/pause iTunes, cmd-click to go  
to iTunes, opt-drag to move widget, ctrl-click or right-click for  
option menu. Hovering over the widget displays the current track,  
album, and artist in a tooltip. You can get it at:


http://home.comcast.net/~pmbrig/iTunesWidget.rev.zip

I haven't tried to pass this around much, because for reasons I can't  
track down, clicks sometimes disappear into emptiness with no  
response, sometimes mousemove doesn't trigger the tooltip display,  
etc. Something is swallowing system messages, or maybe the AppleScript  
messages are going awry, anyway it's occasionally a bit unpredictable.  
But I use it when I'm working in the IDE and want to listen to some  
MP3s. Handy because I don't have to change gears when the phone rings,  
just click to pause, and answer the call.


If you can't find Tom's library stack, look at the stack script in the  
widget for ideas on what you're trying to do. Tom did the real work  
for this, I really just adapted his scripts.


-- Peter

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

On Apr 1, 2011, at 12:02 PM, Terry Vogelaar wrote:

I want to make an app that uses data from the currently playing song  
on my iPod Touch, like song title, artist, comments, etc.


Is there a way to see data like that in a LiveCode app? Probably not  
'out of the box'. Is there a workaround? I know Xcode can do it. So  
is there someone who can make an external to do this? At what cost?  
Can LiveCode for iOS use externals?


Any help is greatly appreciated.

Terry
___
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: Currently playing song on iPod Touch

2011-04-01 Thread Peter Brigham MD

On Apr 1, 2011, at 1:44 PM, Bob Sneidar wrote:

I will say that I have had a long staning issue in Livecode where I  
have to hold the mouse button a bit longer for the click to  
register. That may be your problem. I have not troubleshot this at  
all, but of course the first thing to do is remove all your plugins  
(except the one you are testing) and restart Livecode.


I've not seen this except in this one stack. That's why I wonder about  
something going funky with the AppleScript messages.


-- Peter

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


Bob


On Apr 1, 2011, at 10:23 AM, Peter Brigham MD wrote:


http://home.comcast.net/~pmbrig/iTunesWidget.rev.zip

I haven't tried to pass this around much, because for reasons I  
can't track down, clicks sometimes disappear into emptiness with no  
response, sometimes mousemove doesn't trigger the tooltip display,  
etc. Something is swallowing system messages, or maybe the  
AppleScript messages are going awry, anyway it's occasionally a bit  
unpredictable. But I use it when I'm working in the IDE and want to  
listen to some MP3s. Handy because I don't have to change gears  
when the phone rings, just click to pause, and answer the call.



___
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-04-01 Thread Peter Brigham MD

On Apr 1, 2011, at 2:37 PM, Bob Sneidar wrote:

Okay sorry dislexia has set it. I saw 1022 and it looked like 1002.  
I looked at it 20 times and saw them as identical. I am so  
embarrassed.


Bob


I make stupid mistakes all the time, especially when I've just hit the  
send button. :-)
As I get older, I get less embarrassed, though the curve will probably  
never hit 0. I think it's because, more and more, I sort of don't give  
a sh*t.


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


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


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 tFld contains tStr

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 tFld 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 tFld 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  
jac...@hyperactivesw.com 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


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 stackName then the stack stackName 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 stackName to \
   the short name of card 1 of stack stackName

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 myStack

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 stackPath


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 stackPath


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 stackstackName then the  
stackstackName  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 stackstackName  to \
  the short name of card 1 of stackstackName

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

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 stackPath


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 stackPath


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


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: 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: 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: 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=tOrigdestination=tDestsensor=false into tURL
   put fld from into tStart
   put fld to into tEnd
   replace tOrig with urlEncode(tStart) in tURL
   replace tDest with urlEncode(tEnd) in tURL
   put URL tURL into t
   put lineoffsets(distance,t) into startSect
   put item -1 of startSect into startSect
   put lineoffsets(/distance,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(text,tSect) into dLine
   if dLine = 0 then
  beep
  exit to top
   end if
   put sr(line startSect + dLine of t) into tMiles
   --   text3.6 mi/text
   replace text 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=tOrigdestination=tDestsensor=false into tURL
  put fld from into tStart
  put fld to into tEnd
  replace tOrig with urlEncode(tStart) in tURL
  replace tDest with urlEncode(tEnd) in tURL
  put URL tURL into t
  put lineoffsets(distance,t) into startSect
  put item -1 of startSect into startSect
  put lineoffsets(/distance,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(text,tSect) into dLine
  if dLine = 0 then
 beep
 exit to top
  end if
  put sr(line startSect + dLine of t) into tMiles
  --   text3.6 mi/text
  replace text 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: 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: 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: 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: 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


Re: Getting Contents of Multiple fields in order (Left-to-RightDown)

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: 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: 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: 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: 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: 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 m.schonewi...@economy-x-talk.com
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 myApp 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 martykn...@comcast.net
Date: Sat, 17 Nov 2007 11:04:20 -0800
On: How to use Revolution use-revolut...@lists.runrev.com
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: 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 pmb...@gmail.com 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: 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 pmb...@gmail.com  
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.
snip

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


  1   2   >