Re: Collisions

2012-03-25 Thread Jim Hurley
P.S.

That simple picture of the velocities being exchanged applies only in a frame 
of reference in which the center of mass is fixed.



___
use-livecode mailing list
use-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: Need an example of how to use try and catch

2012-03-23 Thread Jim Hurley
Mark,

Yes! I agree with you about throw. 

Do you,  or dose anyone, have an example that shows the use of the throw 
command in conjunction with the try-catch structure?

Jim


 
 Message: 4
 Date: Thu, 22 Mar 2012 22:33:42 -0700
 From: Mark Wieder mwie...@ahsoftware.net
 To: use-livecode@lists.runrev.com
 Subject: Re: Need an example of how to use try and catch
 Message-ID: 33780499187.2012033...@ahsoftware.net
 Content-Type: text/plain; charset=us-ascii
 
 Jacque-
 
 Thursday, March 22, 2012, 10:19:59 PM, you wrote:
 
 P.S. There really ought to be an illustration of the try-catch syntax
 in the dictionary.
 
 I just looked, and I'm amazed there isn't. Myabe you could add a user note.
 
 Yeah - the throw command should be mentioned there as well.
 
 -- 
 -Mark Wieder
 mwie...@ahsoftware.net
 


___
use-livecode mailing list
use-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 for a slider

2012-03-22 Thread Jim Hurley
It is not just the arrays. It omits things like the foregroundcolor and 
backgroundcolor.

I get a rough count of 34 properties using the properties of for a scrollbar 
and Richard shows 57.

Jim

 
 Message: 19
 Date: Wed, 21 Mar 2012 18:02:35 -0700
 From: Mark Wieder mwie...@ahsoftware.net
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Text formatting for a slider
 Message-ID: 3677832125.20120321180...@ahsoftware.net
 Content-Type: text/plain; charset=us-ascii
 
 stephen-
 
 Wednesday, March 21, 2012, 4:05:46 PM, you wrote:
 
 I think what broke Smart properties was that some of the newer properites
 in never versions are multi-dimensional - and SP was written early in the
 2000's.
 
 And some of the multidimensional ones don't appear in the list when
 you get the properties of. Luckily, the list of missing items is
 short if you don't include custom properties.
 
 -- 
 -Mark Wieder
 mwie...@ahsoftware.net
 
 


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


Need an example of how to use try and catch

2012-03-22 Thread Jim Hurley
The dictionary needs an example of how the try command is used to catch an 
error.

Anyone have an illustration? 

For example, suppose one wanted to catch an error in the statement:

  put the {some built-in property of an object] of button soAndso into tProp

Where the built in property may not exist.How would one catch the error and 
perhaps proceed on the basis of the particular error message?

Thanks,

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


Re: Need an example of how to use try and catch

2012-03-22 Thread Jim Hurley
Bob, 

Yes that would be fine, except that I get a compilation error at the line:

  catch theError, theNum

RR says:  (try: not a command), char 7

Jim


 Bob Sneidar wrote:

 try
   put foo into myVar
   put the value of myVarr
 catch theError, theNum
   -- breakpoint
   answer theNum  cr  line1 of theError as sheet
   exit to top
 end try
 
 Is that what you mean?
 
 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


Re: Need an example of how to use try and catch

2012-03-22 Thread Jim Hurley
It does give an error here. I get the error message:

   button Button: execution error at line n/a (Object: object does not have 
this property)

Jim

 
 Message: 2
 Date: Thu, 22 Mar 2012 09:55:20 -0700
 From: Pete p...@mollysrevenge.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Need an example of how to use try and catch
 Message-ID:
   CABx6j9=UY=3n6-vjpmxastopezh0ewj6kpopa01vxcxke3t...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 You're getting an error because the catch part of try takes only 1
 parameter - the variable that holds the error - not two as in the script.
 
 Also, as noted by Peter, the try statement doesn't help you with the
 specific example you used since getting a non-existant custom property
 doesn't cause an error.  I've sometimes wished there was a preference
 similar to the Strict Compilation Mode to deal with that.
 
 Pete
 
 *


___
use-livecode mailing list
use-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: Need an example of how to use try and catch

2012-03-22 Thread Jim Hurley
Thanks Peter.

The problem now is what do these bloody error numbers translate into.
Is the a list somewhere?

When I try:

on mouseUP
   try
  put the cantdelete of me into temp 
catch tErr
--- if tErr is ??
end try
end mouseUP

I get an error of 348,0,0

Jim




 Peter Brigham wrote: 
 
 The syntax for the try construction is
 
 try
command here
 catch tError
other commands here
 end try
 
 and the error number is put into the variable tError. So the other commands 
 could be, eg,
 
if tError = 314 then
   answer range error in loading array
else if ...
   etc.
end if
 
 -- Peter
 
 Peter M. Brigham
 
 pmbrig at 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: Need an example of how to use try and catch

2012-03-22 Thread Jim Hurley
The following script will provide a start in finding all the property values of 
a given object, in this case the button button

It starts with the propertynames which is a list of ALL built-in property 
names in LC. 

It then attempts to put the value of each of these properties for the given 
object.

If the attempt was successful, it goes into the object property list, otherwise 
not.


on mouseUp
   put the propertynames into tProps
   repeat for each line tLine in tProps
  put  into tErr
  try
 put the  tLine of button button into tPropVal
  catch tErr
 put tLine  cr after tOmits
 next repeat
  end try
  if tPropVal is not empty then put tLine  tab  tPropVal  cr after tSaves
   end repeat
   put tSaves into field saves
   put tOmits into field omits
end mouseUp
___
use-livecode mailing list
use-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: Need an example of how to use try and catch

2012-03-22 Thread Jim Hurley
Jacque,

Thanks.

LC is an English muffin. So many nooks and crannies.

Jim

P.S. There really ought to be an illustration of the try-catch syntax in the 
dictionary.

 
 Message: 5
 Date: Thu, 22 Mar 2012 12:32:01 -0500
 From: J. Landman Gay jac...@hyperactivesw.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Need an example of how to use try and catch
 Message-ID: 4f6b6211.3070...@hyperactivesw.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 On 3/22/12 12:21 PM, Jim Hurley wrote:
 Thanks Peter.
 
 The problem now is what do these bloody error numbers translate into.
 Is the a list somewhere?
 
 The list is explained in the errordialog entry in the dictionary. You 
 can retrieve the list with the line of script the dictionary provides.
 
 There is also this utility for manual lookups:
 http://dl.dropbox.com/u/23431607/LiveCode%20Error%20Lookup.livecode.zip
 
 -- 
 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


Re: Text formatting for a slider

2012-03-21 Thread Jim Hurley
Stephen,

What has me puzzled, maybe you have the answer, is a function to return ALL the 
properties of a given object.

As many have said, the properties function is incomplete. For one thing it 
omits the foregroundcolor of the scrollbar. (I wonder whether those properties 
in the inspector palette for which there is an opening but no property are 
those among those missing from put the properties of ...)

So I wonder where Rinaldi and Richard Gaskin got their lists from? This would 
be the first task in reconstruction Rinaldi's plug-in.

Jim 

 
 Message: 7
 Date: Tue, 20 Mar 2012 15:03:04 -0700
 From: stephen barncard stephenrevoluti...@barncard.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Text formatting for a slider
 Message-ID:
   cafmqfh+-b-uzupsezoofvp8dnypwrpbjzjdb4y3olkby9n3...@mail.gmail.com
 Content-Type: text/plain; charset=UTF-8
 
 I made an attempt at 'fixing' Smart properties a while back, but found it's
 not as simple as it might seem to be. Three objects created for each
 property in real time made to scroll together and some other trickery going
 on. It's a project I do want to tackle one of these days.
 
 On 19 March 2012 15:34, stephen barncard 
 stephenrevoluti...@barncard.comwrote:
 
 JIm, I'm a fan of Mr. Rinaldi as well - he supplied the first serial xcmds
 for hypercard back in 89 -
 however I can't get Smartproperties to work these days - have you used it
 lately?
 
 sqb


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


Text formatting for a slider

2012-03-19 Thread Jim Hurley
I have a slider in which the showValue is set to true.

Unfortunately, the card background is gray and the black slider value is very 
difficult to read.

The inspector for the slider does not display an option for the foreground 
color. Why not?

Using 4W Properties (thank you RIchard) the foreground color is listed as an 
option (and can be changed there, or from the msg box.)

Why this omission in the Inspector? (LC version 4 AND 5.)


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


Re: Text formatting for a slider

2012-03-19 Thread Jim Hurley
Pete,

Yes, my feeling exactly. It looks like there was a conscious effort to omit the 
foregroundColor  for the slider (and scollbar as well). I was worried that it 
was to be deprecated.

(I wasn't concerned about ALL the properties being in the Inspector. It is odd, 
however, that there is a place for the foreGroundColor property, an icon but no 
defining text, but no way to access it. I suspect RR got distracted while 
implementing the slider Inspector.)

You might want to check out Richard's 4wProps (under the Development/Plugins 
menu). Easy access to all the properties.

Occasionally I have found (legendary) Renaldi's SmartProperties invalueable. It 
allows one to compare side by side the properties to two objects. It is 
valuable in finding out why two, apparently identical, controls behave or look 
different.

Jim Hurley

 Message: 24
 Date: Mon, 19 Mar 2012 11:42:46 -0700
 From: Pete p...@mollysrevenge.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Text formatting for a slider
 Message-ID:
   CABx6j9mAJJtKUZneWCna5tP7fWxUMBvH7LqBsvxZgbJ=ybd...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 Yeah, but that displays all possible properties of any object.  The
 properties property of an object gets you an array of properties for a
 specific object.  Still a long list mind you, and not a complete list
 either according to the dictionary.
 
 I think you're probably right that it would make the inspector windows very
 unwieldy to include all properties.  The problem is that by leaving some of
 them out, arbitrarily, it gives the impression that they aren't available,
 especially to new users.  I remember when I first started using LC and
 wanted to set the behavior of an option menu button - there's no inspector
 window behavior field so I just assumed it wasn't possible for some reason
 and went down a different, much more complicated path.
 
 Seems like it would have been trivial to include one more option in the
 inspector option menu for All Properties or something similar.  I ended
 up writing my own plugin to show all the properties of a selected object
 and allow me to change any of them.
 
 Pete
 
 On Mon, Mar 19, 2012 at 11:09 AM, Richmond richmondmathew...@gmail.comwrote:
 
 On 03/19/2012 06:05 PM, Jim Hurley wrote:
 
 I have a slider in which the showValue is set to true.
 
 Unfortunately, the card background is gray and the black slider value is
 very difficult to read.
 
 The inspector for the slider does not display an option for the
 foreground color. Why not?
 
 Using 4W Properties (thank you RIchard) the foreground color is listed as
 an option (and can be changed there, or from the msg box.)
 
 Why this omission in the Inspector? (LC version 4 AND 5.)
 
 
 Almost all object have a vast number of options that one can fiddle around
 with; the Props Inspector only
 displays a subset of them; why? I don't know, but I can hazard a guess:
 
 a Props Inspector that displayed ALL the props of each object might be so
 unwieldy as to be virtually unusable.
 
 Just for fun . . .
 
 Set up a new stack with a scrollingListField field called PROPPS
 
 and try this in the MessageBox:
 
 put the propertyNames into fld PROPPS
 
 and blow your mind . . .   :)
 
 
 
 Jim
 __**_
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your
 subscription preferences:
 http://lists.runrev.com/**mailman/listinfo/use-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


Scott

2012-03-13 Thread Jim Hurley
Thanks Scott and Colin,

LiveCode and this list make it sooo easy. It is almost embarrassing.

Does anyone know what program, if there is ONE, that opens when you double 
click on a jpg or png image in Windows?

What happens when you click on an image.jpg? Does Windows present options?


Jim



 
 Message: 17
 Date: Mon, 12 Mar 2012 14:00:43 -0800
 From: Scott Rossi sc...@tactilemedia.com
 To: LiveCode Mail List use-livecode@lists.runrev.com
 Subject: Re: Exporting a snapshot directly to Preview
 Message-ID: cb83b20b.5b07d%sc...@tactilemedia.com
 Content-Type: text/plain; charset=US-ASCII
 
 Hi Jim:
 
 Here's an example for OS X:
 
 on mouseUp
   put specialFolderPath(desktop)  /exported.png into theFilePath
   export snapshot from img 1 to file theFilePath as PNG
   launch theFilePath with /Applications/Preview.app
 end mouseUp
 
 You can choose whatever image format you need, and you should probably make
 the script more robust by checking for the existence/path of the Preview
 app, confirm overwriting of the exported file, etc.
 
 For Windows, you might be able to use MS Paint but I haven't tested this.
 
 Hope this helps.
 
 Regards,
 
 Scott Rossi
 Creative Director
 Tactile Media, UX Design
 
 


___
use-livecode mailing list
use-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: Exporting a snapshot directly to Preview

2012-03-13 Thread Jim Hurley
(Forgot the Subject line.)

Thanks Scott and Colin,

LiveCode and this list make it sooo easy. It is almost embarrassing.

Does anyone know what program, if there is ONE, that opens when you double 
click on a jpg or png image in Windows?

What happens when you click on an image.jpg? Does Windows present options?


Jim



 
 Message: 17
 Date: Mon, 12 Mar 2012 14:00:43 -0800
 From: Scott Rossi sc...@tactilemedia.com
 To: LiveCode Mail List use-livecode@lists.runrev.com
 Subject: Re: Exporting a snapshot directly to Preview
 Message-ID: cb83b20b.5b07d%sc...@tactilemedia.com
 Content-Type: text/plain; charset=US-ASCII
 
 Hi Jim:
 
 Here's an example for OS X:
 
 on mouseUp
  put specialFolderPath(desktop)  /exported.png into theFilePath
  export snapshot from img 1 to file theFilePath as PNG
  launch theFilePath with /Applications/Preview.app
 end mouseUp
 
 You can choose whatever image format you need, and you should probably make
 the script more robust by checking for the existence/path of the Preview
 app, confirm overwriting of the exported file, etc.
 
 For Windows, you might be able to use MS Paint but I haven't tested this.
 
 Hope this helps.
 
 Regards,
 
 Scott Rossi
 Creative Director
 Tactile Media, UX Design
 
 


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


Exporting a snapshot directly to Preview

2012-03-12 Thread Jim Hurley
Is it possible to export a snapshot so that it opens directly in Preview? 
(Where it might be printed.)

What would be the comparable image viewer in Windows?   (Where it might be 
printed.)

Thanks,

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


Give some feedback that a field line has been clicked

2012-02-22 Thread Jim Hurley
The subject line says it all.

I would like the like  the clicked line to do something visual that tells the 
user that his action has been recognized.

Thanks,

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


Re: Give some feedback that a field line has been clicked

2012-02-22 Thread Jim Hurley
Peter,

Perfect. I was trying the following:

on mouseUp
   put the clickline into tClickline
   set the textStyle of line (word 2 of tClickline) of me  to bold
   wait   1 seconds
   set the textStyle of line (word 2 of tClickLine) of me to plain
end mouseUP

But LC ignored the wait time, setting the text to bold for just a flash and 
then back to plain.

I tried it again and now it works as expected. Moral: time heals all wounded 
scripts.

But text selection is much better then bold face. 

Thanks,

Jim



 Probably something like this will do:
 
 on mouseup
   put word 2 of the clickline into lineNbr
   select line lineNbr of me -- assumes autohilite = true
   wait 8 ticks
   select empty
 end mouseup
 
 -- Peter
 
 Peter M. Brigham
 
 pmbrig at 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 string xxx in field yyy OF THIS CARD

2012-02-02 Thread Jim Hurley
Hi Francis,

I have used this, suggestion by a list member some time ago, to restrict the 
find to a specific field.

You might substitute the card id in place of the field id.

on mouseUP
   put the value of the clickline into tText 
   put the id of field theText into tNum
   find empty
   find  string  tText in field id tNum
end mouseUP

Jim


 Hi from Beautiful Brittany,
 
 I have been having problems with the find command.
 In a stack with multiple cards, I want to find specific
 strings on a card of my choice (the card currently displayed),
 and NO other.
 
 If I code find string xxx in fld yyy of this card ..
 
 doesn't work.
 
 If I look in the dictionary for the find command, I find no
 information concerning a search on a specific card.
 However, a user comment (from Craig) shows that we can use :
 
 find yourtext in field yourfield of card cardOfInterest
 
 by which I understand that you can define a specific
 card by its number.  This does not work either.
 
 Has anybody had problems like this, or have I reached
 my first LiveCode bug ?
 
 Is there any way of restricting a find string to a
 specific card. I'm on LiveCode Build 1080 Version 4.5.0
 
 -Francis
 
 After nearly 50 years of dedicated computing, I still
 find that Windows is a pane ..:)
 


___
use-livecode mailing list
use-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:Revlets on the web

2012-01-27 Thread Jim Hurley
I guess the question must be asked: Given the lack of attention to the problem 
of running Revlets on the web, is RunRev abandoning Revlets, or just very busy 
with things that have a higher priority?

I can see that they have a lot on their plate. The neglect of the User Samples 
application is further evidence.





___
use-livecode mailing list
use-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:Revlets on the web

2012-01-25 Thread Jim Hurley
 
 Message: 20
 Date: Tue, 24 Jan 2012 09:56:25 -0600
 From: J. Landman Gay jac...@hyperactivesw.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Revlets on the web
 Message-ID: 4f1ed4a9.8050...@hyperactivesw.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 On 1/23/12 2:16 PM, Jim Hurley wrote:
 I think I knew how to do this at one time.
 
 I have an app saved for the Web as a revlet
 
 After saving as a standalone (for the web) a page opens in Safari
 that says it is a test page--BUT NOT APP. Is the app supposed to open
 in Safari as a RevLet?
 
 Yes, provided you have the plugin installed, but currently it only works 
 in 32-bit mode. I think Safari defaults to 64-bit now.

Thanks Jacque. I went over to Fire Fox and it works there, so that must be the 
problem.

Is there something I can do to get it working in Safari?

I don't know bits from bats. Is there a way to change an image from 32 to 64, 
or a way to change the mode in Safari?

Jim Hurley




___
use-livecode mailing list
use-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:Revlets on the web

2012-01-25 Thread Jim Hurley
Addendum to previous post.

I upgraded FireFox to the latest version and now I get a message that Fire Fox 
needs to restart in 32 bit mode to run my revlet.

What can I do to the image in the revlet to avoid this problem?

I am a BIT of a novice here.

Jim


 Message: 20
 Date: Tue, 24 Jan 2012 09:56:25 -0600
 From: J. Landman Gay jac...@hyperactivesw.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Revlets on the web
 Message-ID: 4f1ed4a9.8050...@hyperactivesw.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 On 1/23/12 2:16 PM, Jim Hurley wrote:
 I think I knew how to do this at one time.
 
 I have an app saved for the Web as a revlet
 
 After saving as a standalone (for the web) a page opens in Safari
 that says it is a test page--BUT NOT APP. Is the app supposed to open
 in Safari as a RevLet?
 
 Yes, provided you have the plugin installed, but currently it only works 
 in 32-bit mode. I think Safari defaults to 64-bit now.

Thanks Jacque. I went over to Fire Fox and it works there, so that must be the 
problem.

Is there something I can do to get it working in Safari?

I don't know bits from bats. Is there a way to change an image from 32 to 64, 
or a way to change the mode in Safari?

Jim Hurley




___
use-livecode mailing list
use-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:Revlets on the web

2012-01-25 Thread Jim Hurley
Bob, 

Thank you. Yes, I did miss it. 

That works well in Firefox, but, alas, not in Safari. (Mac OS 10.6.8, Safari 
5.1.2) 

Jim


Bob Sneidar wrote:
 I already posted but you must have missed it. Right-click Safari and get 
 info. Tell it to open in 32 bit mode.  Bob   On Jan 25, 2012, at 4:38 PM, 
 Andre 
 
 Garzia wrote:
 Jim,
 RevLets only work in 32bit mode. There is no way to solve that at this 
 moment.
 =/
 
 On Wed, Jan 25, 2012 at 10:34 PM, Jim Hurley jhurley0305 at sbcglobal.net 
 wrote:
 Addendum to previous post.  I upgraded FireFox to the latest version and now 
 I get a message that Fire Fox needs to restart in 32 bit mode to run my 
 revlet.  What can I do to the image in the revlet to avoid this problem?  I 
 am a BIT of a novice here.  Jim
 

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


Revlets on the web

2012-01-23 Thread Jim Hurley
I think I knew how to do this at one time.

I have an app saved for the Web as a revlet

After saving as a standalone (for the web) a page opens in Safari that says it 
is a test page--BUT NOT APP. Is the app supposed to open in Safari as a RevLet?

The file created on my drive consists as a folder (MyAppFolder) containing two 
files (MyApp.revlet and test.html)

I uploaded the folder to my web site.

Now, how would someone run it on the web? Assuming they have downloaded the 
player.

What is the url?

Jim



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


Re: OT Password protection of RR server?

2012-01-11 Thread Jim Hurley
Mark,

I finally got my password for cPanel  from Heather and  I plunged into password 
protecting a web page.

Or so I thought. I assumed that a web address was a directory and I thought I 
was protecting a web page but turned out locking up much more.

There is still one folder jamesphurley.com/District3 that I am locked out of. 
Is there a way in cPanel to unprotect a page? (It would be helpful to include 
this kind of info in the help link. Not any time soon, I afraid. I suspect that 
RR is bitten off more than they are able to chew at the moment. Witness the 
downtime on Rev OnLine User Samples.)

Also, the page I use for my neighborhood association is lvrmna.on-rev.comAt 
one point everyone in the neighborhood was locked out of that site due to a 
password protection I didn't realize I was making. Very embarrassing. A little 
knowledge is a dangerous thing. 

I recall in the beginning that my deal with RR was a web presence with the url 
jamesphurley.on-rev.com (I own a domain name jamesphurley.com) which they were 
able to shorten for me to jamesphurley.com. Is this just an alias for 
jamesphurley.on-rev.com? Is it possible through cPanel to shorten 
lvrmna.on-rev.com to simply lvrmna.com?

I hate this stuff. I have no idea what's going on under the hood.

Thanks,

Jim Hurley

 Mark,
 
 Thank you going into the details. They will be helpful when Heather returns 
 information about my user name and password..
 
 It has been months since I have used cPanel.
 
 Wish me luck.
 
 Jim Hurley
 
 
 
 Message: 24
 Date: Tue, 27 Dec 2011 17:04:59 -0800
 From: Mark Wieder mwie...@ahsoftware.net
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: As Matthias said, log on to on-rev's cPanel, then scroll down the 
 page
 to the Security section and click on Password Protect Directories.
 You'll probably want to click on the public_html icon (not the text)
 to open it and then navigate your way down to the folder you want to
 protect.
 
 When you finally find the right one, click on its text (not its icon),
 then place a check in the checkbox to verify that you want to protect
 it and (optionally) set a name for the directory. Then enter a
 username and password (both are necessary to unlock the directory) and
 click Add/modify authorized user. You're done unless you want to add
 more user/password pairs.
 
 -- 
 -Mark Wieder
 mwie...@ahsoftware.net
 Message-ID: 65943378687.20111227170...@ahsoftware.net
 Content-Type: text/plain; charset=us-ascii
 
 Jim-
 
 Tuesday, December 27, 2011, 11:03:52 AM, you wrote:
 
 I would like to password protect a page. Is there anything about
 the RR server that affects how that should be done?
 
 As Matthias said, log on to on-rev's cPanel, then scroll down the page
 to the Security section and click on Password Protect Directories.
 You'll probably want to click on the public_html icon (not the text)
 to open it and then navigate your way down to the folder you want to
 protect.
 
 When you finally find the right one, click on its text (not its icon),
 then place a check in the checkbox to verify that you want to protect
 it and (optionally) set a name for the directory. Then enter a
 username and password (both are necessary to unlock the directory) and
 click Add/modify authorized user. You're done unless you want to add
 more user/password pairs.
 
 -- 
 -Mark Wieder
 mwie...@ahsoftware.net
 
 

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


Oops

2012-01-11 Thread Jim Hurley
Oops. 

That last message of mine was intended for Mark, not the entire list.

Jim Hurley

___
use-livecode mailing list
use-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 Password protection of RR server?

2012-01-11 Thread Jim Hurley
Mark,

Thanks Mark. I did as you suggested without results. I am trying to unprotect 
the url:

jamesphurley.com/District3

but I still get this message:

To view this page, you must log in to area “District3” on 
jamesphurley.com:80.

I have no idea what the :80 suffix means.

District3 is a folder in my directory.

Jim


 
 
 Hi Jim,
 
 The easy way to unprotect a page is to log in with FTP and remove the 
 httpaccess file from the directory.
 
 --
 Best regards,
 
 Mark Schonewille
 
 

___
use-livecode mailing list
use-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 Password protection of RR server?

2012-01-11 Thread Jim Hurley
P.S.

Below the message (To view this page etc.) are the fields in which to enter a 
username and password.

Jim


 Mark,
 
 Thanks Mark. I did as you suggested without results. I am trying to unprotect 
 the url:
 
jamesphurley.com/District3
 
 but I still get this message:
 
To view this page, you must log in to area “District3” on 
 jamesphurley.com:80.
 
 I have no idea what the :80 suffix means.
 
 District3 is a folder in my directory.
 
 Jim
 
 
 
 
 Hi Jim,
 
 The easy way to unprotect a page is to log in with FTP and remove the 
 httpaccess file from the directory.
 
 --
 Best regards,
 
 Mark Schonewille
 
 

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


Rev Online--User samples broken?

2012-01-10 Thread Jim Hurley
Is Rev Online broken? It doesn't seem to be accepting user contributions.

Also, the Browse feature recognizes .rev but not .livecode 

Jim Hurley 

___
use-livecode mailing list
use-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: Setting the cursor

2012-01-03 Thread Jim Hurley
Thanks Jacque. 

I was hoping to present the user with vision of a cursor moving to the button 
and then clicking on it.

I think now that I will manufacture my own cursor, using RR's line graphic 
(with arrow attached) and thereby simulate a cursor.

It is perhaps the dark side of my nature that allows me this ruse, but at least 
I am not wresting control of the cursor from the user, and my intentions are 
honorable.

Ken's suggestion (using screenMouseLoc) would allow me to take control of the 
cursor. It is odd that there is a command to locate the mouse relative to the 
screen but not the card. I wonder whether this, and the notion of exercising 
power only for good,  might not date back to Scott Rainey. He had strong 
feelings about the rights and wrongs of programming. I remember a battle I had 
with him over repeat while the mouse is down, an instance where the 
programmer wrests control of the COMPUTER from the user. 

Jim

 
 Message: 16
 Date: Mon, 02 Jan 2012 15:26:40 -0600
 From: J. Landman Gay jac...@hyperactivesw.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Setting the cursor
 Message-ID: 4f022110.1000...@hyperactivesw.com
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 
 On 1/2/12 2:37 PM, Jim Hurley wrote:
 Thanks Ken,
 
 I see that the dictionary warns against taking control of the mouse,
 The discussion concludes with this admonishment: You must use this
 power only for good.
 
 I feel evil. I just wanted to simulate the clicking of a button in my
 help script.
 
 I will need to consult my spiritual advisor to see if this usage
 conforms with RR's ethical standards.
 
 :) You can avoid all evil by:
 
   click at the loc of btn whatever
 
 No cursor movement necessary. But even better, if you only need the 
 mouseup action (i.e., there is no need to simulate mousedown, 
 mousestilldown, etc.) then just:
 
  send mouseup to btn whatever
 
 Either of these methods avoids the need to consult with outside parties. :)
 
 -- 
 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


Re: Setting the cursor

2012-01-02 Thread Jim Hurley
Thanks Ken,

I see that the dictionary warns against taking control of the mouse, The 
discussion concludes with this admonishment: You must use this power only for 
good. 

I feel evil. I just wanted to simulate the clicking of a button in my help 
script. 

I will need to consult my spiritual advisor to see if this usage conforms with 
RR's ethical standards.

Jim



 
 Message: 22
 Date: Mon, 2 Jan 2012 11:03:35 -0600
 From: Ken Ray k...@sonsothunder.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Setting the cursor
 Message-ID: cde89a35-53f4-4faf-91d2-e0bd2f4fc...@sonsothunder.com
 Content-Type: text/plain; charset=us-ascii
 
 
 On Jan 2, 2012, at 1:23 AM, James Hurley wrote:
 
 How do I set the loc of the cursor? By script, of course.
 
 set the screenMouseLoc to location
 
 :D
 
 Ken Ray
 Sons of Thunder Software, Inc.
 Email: k...@sonsothunder.com
 Web Site: http://www.sonsothunder.com/
 


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


Re: OT Password protection of RR server?

2011-12-28 Thread Jim Hurley
Mark,

Thank you going into the details. They will be helpful when Heather returns 
information about my user name and password..

It has been months since I have used cPanel.

Wish me luck.

Jim Hurley


 
 Message: 24
 Date: Tue, 27 Dec 2011 17:04:59 -0800
 From: Mark Wieder mwie...@ahsoftware.net
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: As Matthias said, log on to on-rev's cPanel, then scroll down the 
 page
 to the Security section and click on Password Protect Directories.
 You'll probably want to click on the public_html icon (not the text)
 to open it and then navigate your way down to the folder you want to
 protect.
 
 When you finally find the right one, click on its text (not its icon),
 then place a check in the checkbox to verify that you want to protect
 it and (optionally) set a name for the directory. Then enter a
 username and password (both are necessary to unlock the directory) and
 click Add/modify authorized user. You're done unless you want to add
 more user/password pairs.
 
 -- 
 -Mark Wieder
 mwie...@ahsoftware.net
 Message-ID: 65943378687.20111227170...@ahsoftware.net
 Content-Type: text/plain; charset=us-ascii
 
 Jim-
 
 Tuesday, December 27, 2011, 11:03:52 AM, you wrote:
 
 I would like to password protect a page. Is there anything about
 the RR server that affects how that should be done?
 
 As Matthias said, log on to on-rev's cPanel, then scroll down the page
 to the Security section and click on Password Protect Directories.
 You'll probably want to click on the public_html icon (not the text)
 to open it and then navigate your way down to the folder you want to
 protect.
 
 When you finally find the right one, click on its text (not its icon),
 then place a check in the checkbox to verify that you want to protect
 it and (optionally) set a name for the directory. Then enter a
 username and password (both are necessary to unlock the directory) and
 click Add/modify authorized user. You're done unless you want to add
 more user/password pairs.
 
 -- 
 -Mark Wieder
 mwie...@ahsoftware.net
 


___
use-livecode mailing list
use-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: Re: Point at which speaking is stopped? and ANN: Text to Speech

2011-12-27 Thread Jim Hurley
Roger,

Very resourceful of you to discover, not just the typo, but the correction.

It is indeed a livecode file so:

   go url http://www.jamesphurley.com/TextToSpeech.livecode;

Jim Hurley


 
 Message: 14
 Date: Tue, 27 Dec 2011 12:49:24 -0500
 From: Roger Eller roger.e.el...@sealedair.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Point at which speaking is stopped? and ANN: Text to
   Speech
 Message-ID:
   CAAT6EXOjqBcFw+xNMOo6GwWO=+8oKJjUXNBJSiE+G=46xsf...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 It is a .livecode file:
 
 go url http://www.jamesphurley.com/TextToSpeech.livecode;
 
 
 
 On Tue, Dec 27, 2011 at 12:37 PM, Bob Sneidar wrote:
 
 I get No such card
 
 Bob
 
 
 On Dec 26, 2011, at 3:41 PM, Jim Hurley wrote:
 
 Roger,
 
 It is even better for proofreading.
 
 I have put my Text to Speech up on the web. Run this in the message box.
 
 go url http://www.jamesphurley.com/TextToSpeech.rev;
 
 Jim Hurley
 
 
 
 
 --
 
 Message: 15
 Date: Tue, 27 Dec 2011 09:50:28 -0800
 From: Pete p...@mollysrevenge.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: revOpenDatabase Problem
 Message-ID:
   CABx6j9=crfd2bruwkm0gvd3ypy3vwckgq5fepffxh5+arjn...@mail.gmail.com
 Content-Type: text/plain; charset=ISO-8859-1
 
 All good stuff but none of it tells me if I've opened an sqlite database
 :-)  You may have missed the post about opening the file as a regular file
 and checking the first 16 bytes - that's the solution I used, seems to work
 just great.
 
 On Tue, Dec 27, 2011 at 9:35 AM, Bob Sneidar b...@twft.com wrote:
 
 After opening it, and inside a try/catch statement just use select TRUE as
 connected and get the query as a string. If it throws an error you know
 something is wrong.
 
 One thing I like to do in database driven apps is create handlers called
 dbopen, dbclose, dbIdle isConnected. In those handlers I put the database
 commands inside try/catch constructs, and return false when I fail. Before
 any query I will call isConnected, which attempts to do some arbitrary
 thing with the database, like select TRUE as connected, which will return 1
 if it succeeds and throw an error if it doesn't. When I am done I call
 dbIdle which closes the connection (good practice because the server is
 going to disconnect you anyway after a certain amount of time).
 
 The Open function attempts a connection to the database with the options
 the user entered on a setup card. If successful, I set a global I can check
 in the future to make sure I successfully connected on startup. If the
 global is false, then I prevent any interaction with the app, sometimes
 quitting (if not in development).
 
 By doing this I don't have to recode error handling every place I need to
 query. isConnected, upon failing will exit to top after alerting the user
 that something is wrong. The close handler will close all cursors and
 database handlers, but this is not strictly necessary, as dbIdle.
 
 Since using sqlYoga, this is all rather moot anyway, as this kind of
 functionality is built into it.
 
 Bob
 
 
 On Dec 26, 2011, at 1:33 PM, Pete wrote:
 
 Using revOpenDatabase to open an sqlite database using a file that is not
 an sqlite database return an integer as if the database was successfully
 opened.  Any subsequent db accesses fail of course but I wonder why
 revOpenDatabase doesn't return an error?
 
 
 --
 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
 
 
 
 
 -- 
 Pete
 Molly's Revenge http://www.mollysrevenge.com
 
 
 --
 
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 End of use-livecode Digest, Vol 99, Issue 50
 


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


OT Password protection of RR server?

2011-12-27 Thread Jim Hurley
I am a novice at this sort of thing, so bear with me.

I have an account on RR's server. The domain servers are listed as: 

NS2.ON-REV.COM 
NS1.ON-REV.COM 

I would like to password protect a page. Is there anything about the RR server 
that affects how that should be done?

I'm not looking for anything serious; I don't mind if my protection is foiled; 
I just want the user know that the page was not designed for the general public.

Some simple HTML text in the header would be nice.

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


Re: Point at which speaking is stopped?

2011-12-26 Thread Jim Hurley
Mike,

Ingenious. Works like a charm. Thank you.

There will be problems, as I have discovered in an other app I am working on in 
parsing sentences. The period has multiple uses besides a sentence delimiter, 
for example in abbreviations and in decimal numbers. These can be parsed out 
however.

Thanks again, vert nice,

Jim Hurley


I have put my Text to Speech app up on the web:

go url http://jamesphurley.com/TextToSpeech.livecode;




 
 
 Mike Bonner wrote:
 
 Yep, in simplest form its not to bad.  I put a bunch of text into a field
 then to read it, set the itemdelimter to .  put the field text into a
 variable and replaced ?  with ?.  same with !  replaced with !.  (to
 ensure we still retain punctuation tone changes)
 
 So the following script placed in a button will read from field 1. Clicking
 the button again pauses, Reading picks up where it left off.
 
 local tReading, tCurrLine, tTotalLines,tText
 on mouseUp
if tReading is empty then put false into tReading
put not tReading into tReading
set the label of me to Reading:   tReading
startLooping
 end mouseUp
 
 command startLooping
set the linedelimiter to .
if tReading then
   if tCurrLine is empty then
  put field 1 into tText
  replace ?  with ?.  in tText
  replace !  with !.  in tText
  put the number of lines in tText into tTotalLines
  put 1 into tCurrLine
   end if
 
   if not revIsSpeaking() then
  revspeak line tCurrLine of tText
  if tCurrLine = tTotalLines then
 put false into tReading
 put empty into tCurrLine
  else
 add 1 to tCurrLine
  end if
   end if
   set the label of me to Reading:   tReading
   send startLooping to me in 20 milliseconds
end if
 end startLooping

___
use-livecode mailing list
use-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: Point at which speaking is stopped? and ANN: Text to Speech

2011-12-26 Thread Jim Hurley
Roger,

It is even better for proofreading.

I have put my Text to Speech up on the web. Run this in the message box.

go url http://www.jamesphurley.com/TextToSpeech.rev;

Jim Hurley

 
 Roger Eller wrote:
 
 I like it!  I used your post as the text to read aloud via your script.
  With a little more code to add active sentence highlighting, and handle
 other oddities in text like (? with ?.), it becomes a pretty nice
 screen reader that you can follow along visually.  I could see this growing
 into a great teaching aid for reading.
 
 ˜Roger
 
 

___
use-livecode mailing list
use-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: is among the words AND find words

2011-12-22 Thread Jim Hurley
Very good Hugh. This adds another level of versatility, first by the addition 
of a rule and then by returning a word count.

You are right about what constitutes a word. That is what is nice about having 
a rule.

BTW: The previous token method can be changed into a count by replacing this 
code

repeat for each item tWordNum in tNums
 put word tWordNum of tList into tTestWord  
if tWord is among the tokens of tTestWord then return true   
end repeat
   --If all the tests fail, then return false
 return false

With the following:

put 0 into tCount
repeat for each item tWordNum in tNums
 put word tWordNum of tList into tTestWord  
if tWord is among the tokens of tTestWord then add 1 to tCount  
end repeat
return tCount

Jim



 Aha. So we are now only testing 'exist', and not the word number? Since I've
 already written this, I'll post it anyway...
 
 The problem (as always when this topic is raised) is the definition of a
 'word', as indicated by the additional inclusion of 'token' in the language,
 and thus the definition of 'punctuation'. I believe LC inherited the
 definition of a 'word' from HyperCard for compatibility.
 
 Is $10 one word or two?
 Is my_Var one word or two?
 Is half-baked one word or two?
 Do the same rules apply across non-English languages? And unicode langauges?
 
 Perhaps there is no single definition and some modifiers are needed such as
 'strict'...
 
 on mouseUp
   put findWord(fld 1,men,strict)
 end mouseUp
 
 function findWord pContent,pStr,pRule
   if pRule=strict then
 put COMMAQUOTETABCR:;'. into tPunctuation
   else
 --| Adjust according to requirements...
 put COMMAQUOTETABCR:;'.^*()_-+={}[]@~#/|\!? into tPunctuation
   end if
   repeat for each char L in tPunctuation
 replace L with SPACE in pContent
   end repeat
   if pStr is among the words of pContent then
 return num of words of char 1 to offset(pStr,pContent) of pContent
   else return 0
 end findWord
 
 
 Hugh Senior
 FLCo
 
 
 Jim Hurley wrote:
 
 Strike most of my last message. It appears that most of the function can be
 replaced with an examination of the entire text (dah)  as in:
 
 put tWord is among the tokens of tList into tTest
 return tTest
 
 This tests the whole text; it is not necessary to test each string
 containing  the word individually.
 
 But remove the quotes and periods first.
 
 Jim
 
 
 
  Thanks to all for their help with this. I learned a new key word in
 token.
 
  So far the function below handles everything reasonable I have thrown at
 it, including finding time in the less than reasonable  text in field 1:
 
Now is timely the timeless time.-for, all good.
 
  on mouseUp
put field 1 into tText
put theWordIsAmongTheWords(time, tText) into msg box --returns true
  end mouseUp
 
  function theWordIsAmongTheWords tWord, tList
--The quote and period are irrelevant to the test for the word, so
 delete them.
replace quote with  in tList
replace . with  in tList
put empty into tNums
 
--Collect all the strings that wordOffset would find.
repeat
   put wordOffset(tWord,tList, last item of tNums) into tNum
   if tNum = 0 then exit repeat
   put the last item of tNums + tNum  comma after tNums
end repeat
 
--Test each of these strings aginst the word being tested.
--With the quotes and periods gone, the tokens of sting found work well.
repeat for each item tWordNum in tNums
   put word tWordNum of tList into tTestWord
   if tWord is among the tokens of tTestWord then return true
end repeat
 
--If all the tests fail, then return false
return false
  end theWordIsAmongTheWords

___
use-livecode mailing list
use-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: is among the words AND find words

2011-12-22 Thread Jim Hurley
Dave,

Ah! Those mighty regular expressions. Sm day I'll have to study up on them.

Yes that works very nicely. 

The other method (one that I understand ;) ) now boils down to this:

on mouseUp
   put field 1 into tText
   put containsWord(time, tText)
end mouseUp

function containsWord tWord, tList
   replace quote with  in tList
   replace . with  in tList
   return tWord is among the tokens of tList
end containsWord

Jim



 Late to the thread.
 
 If the purpose is just to see whether the word exists in a string, would this 
 work (using regular expressions)?
 
 on mouseUp
put Some timely text with time, and more. into tString
put time into tTarget
put containsWord(tTarget, tString) 
 end mouseUp
 
 function containsWord tWord, tString
put (?i)\b  tWord  \b into tRE
return matchText(tString, tRE)
 end containsWord
 
 \b is the regular expression word boundary pattern. 
 (?i) makes the match case insensitive.
 
 Cheers
 Dave

___
use-livecode mailing list
use-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: is among the words AND find words

2011-12-21 Thread Jim Hurley
Bob et. al.



 
 Message: 14
 Date: Wed, 21 Dec 2011 08:24:59 -0800
 From: Bob Sneidar b...@twft.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: is among the words AND find words
 Message-ID: ba41a52b-8b6e-4dc0-9996-1253098ea...@twft.com
 Content-Type: text/plain; charset=us-ascii
 
 I think this underscores the need for the words keyword to be upgraded to 
 reflect real text. For instance, word delimiters could be a property 
 containing all the characters which might be word delimiters, all the 
 punctuations for example. I don't know how you would treat a hyphen. 

That would work.

 
 Upon thinking about it, I am not sure what the application would be for 
 finding specific words in an english (or any other languages) phrase. It is 
 useful for finding keywords in a Livecode statement for sure. 

 Bob

The application would be one of gatering all the lines in a text field that 
contain a word or words and displaying them in a second field. The text might 
also include quotes and that messes up the wordOffset function. 

Turns out the tokens don't work since the period is not a token so the token 1 
of  time. is time.

Astonishingly, it turns out that LC all allows for 

Put time is among the tokens of Now is the time, for all good men.

That returns true.

But

 Put men is among the tokens of Now is the time, for all good men.

returns false--because of the period after men

I think I'll just strip the lead and trailing characters from the resulting 
wordOffset word, using something like:

function stripEnds tWord
   repeat 
  if charIsNotLetter (char 1 of tWord) then
 delete char 1 of tWord
 next repeat
  else
 exit repeat
  end if
   end repeat
   repeat
  if charIsNotLetter (char -1 of tWord) then
 delete char -1 of tWord
 next repeat
  else
 exit repeat
  end if
   end repeat
   return tWord
end stripEnds

function charIsNotLetter tChar
   put charToNum(tChar) into tNum
   switch
  case tNum = charToNum(a) and tNum = charToNum(z) 
 return false
 break
  case tNum = charToNum(A) and tNum = charToNum(Z) 
 return false
 break
  default
 return true
   end switch
end charIsNotLetter 

But I would prefer RR to implement your suggestion of augmenting  the 
delimiters for word to include all non-letters.
___
use-livecode mailing list
use-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: is among the words AND find words

2011-12-21 Thread Jim Hurley
Thanks, Hugh.

Unfortunately there are a couple of problems. It won't work for this line:

   Now is the time.

because of the period.

Nor for the line

   Now is the time for all

because of the quotes.

Stripping the lead and trailing characters is cumbersome, but fairly 
reliable--except for quotes, where I just replace the quote with a carrot or 
whatever.



 An alternative approach:
 
 Assuming that the phrase now is the time, for all good men is in fld 1,
 then this button script
 
 on mouseUp
   put findWord(fld 1,time)
 end mouseUp
 
 function findWord pContent,pStr
   if pStr is among the tokens of pContent then
 return num of words of char 1 to offset(pStr,pContent) of pContent
   else return 0
 end findWord
 
 reurns 4 as expected. Similarly for 'time-bomb' and other variants.
 
 Hugh Senior
 FLCo



___
use-livecode mailing list
use-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: is among the words AND find words

2011-12-21 Thread Jim Hurley
Thanks to all for their help with this. I learned a new key word in token.

So far the function below handles everything reasonable I have thrown at it, 
including finding time in the less than reasonable  text in field 1: 

   Now is timely the timeless time.-for, all good.

on mouseUp
   put field 1 into tText
   put theWordIsAmongTheWords(time, tText) into msg box --returns true
end mouseUp

function theWordIsAmongTheWords tWord, tList
   --The quote and period are irrelevant to the test for the word, so delete 
them.
   replace quote with  in tList
   replace . with  in tList
   put empty into tNums

   --Collect all the strings that wordOffset would find.
   repeat
  put wordOffset(tWord,tList, last item of tNums) into tNum
  if tNum = 0 then exit repeat
  put the last item of tNums + tNum  comma after tNums
   end repeat

   --Test each of these strings aginst the word being tested.
   --With the quotes and periods gone, the tokens of sting found work well.
   repeat for each item tWordNum in tNums
  put word tWordNum of tList into tTestWord
  if tWord is among the tokens of tTestWord then return true
   end repeat

   --If all the tests fail, then return false
   return false
end theWordIsAmongTheWords

 





___
use-livecode mailing list
use-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: is among the words AND find words

2011-12-21 Thread Jim Hurley
Strike most of my last message. It appears that most of the function can be 
replaced with an examination of the entire text (dah)  as in:

put tWord is among the tokens of tList into tTest
return tTest

This tests the whole text; it is not necessary to test each string containing  
the word individually.

But remove the quotes and periods first.

Jim



 Thanks to all for their help with this. I learned a new key word in token.
 
 So far the function below handles everything reasonable I have thrown at it, 
 including finding time in the less than reasonable  text in field 1: 
 
   Now is timely the timeless time.-for, all good.
 
 on mouseUp
   put field 1 into tText
   put theWordIsAmongTheWords(time, tText) into msg box --returns true
 end mouseUp
 
 function theWordIsAmongTheWords tWord, tList
   --The quote and period are irrelevant to the test for the word, so delete 
 them.
   replace quote with  in tList
   replace . with  in tList
   put empty into tNums
 
   --Collect all the strings that wordOffset would find.
   repeat
  put wordOffset(tWord,tList, last item of tNums) into tNum
  if tNum = 0 then exit repeat
  put the last item of tNums + tNum  comma after tNums
   end repeat
 
   --Test each of these strings aginst the word being tested.
   --With the quotes and periods gone, the tokens of sting found work well.
   repeat for each item tWordNum in tNums
  put word tWordNum of tList into tTestWord
  if tWord is among the tokens of tTestWord then return true
   end repeat
 
   --If all the tests fail, then return false
   return false
 end theWordIsAmongTheWords
 






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


is among the words AND find words

2011-12-20 Thread Jim Hurley
If the sentence:

  Now is the time, for all good men.

is within the field myField , then

   find word time in field myField 

is successful. The word time is found despite the fact that it is not 
delimited with spaces on either side.

But

   time is among the words of Now is the time, for all good men. 

returns false, since is among the words reads the comma after time.  It 
requires the spaces on either side of time as delimiters.

Has this come up before and has it been suggest that this be an enhancement?

That is to say, it would be helpful if is among the words and find word(s) 
behave the same with respect to the space delimiter.

Or am I missing something?

Jim Hurley
___
use-livecode mailing list
use-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: is among the words AND find words

2011-12-20 Thread Jim Hurley
Thanks Bob, Good thought, but it still doesn't work.

The script:

on mouseUp
   put now is the time, for all good men. into tText
   set wholematches to true
   --set wholematches to false
   put wordOffset(time, tText) into temp1
   put wordOffset(time, , tText) into temp2
end mouseUp

shows 0 for temp1 and 4 for temp2. The comma in time, is need to get a match.

What I need is

   put wordOffset(time, Now is the time, for all good men.) 

to show 4 when wholeMatches is true

It appears that there is no way in LiveCode to find whole words in a variable  
reliably.

Wish there were.

Jim Hurley



 From: Bob Sneidar b...@twft.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: is among the words AND find words
 Message-ID: f68e06ca-9008-483a-b6ad-d91e5ac1f...@twft.com
 Content-Type: text/plain; charset=us-ascii
 
 Not sure if wholeMatches affects the find command, but if you set 
 wholeMatches to true and then use wordOffset(time,field myField) then I 
 think you will get the results you are looking for. wordOffset() returns 0 
 when it fails to find a match. 
 
 Bob
 
 
 On Dec 20, 2011, at 4:42 PM, Jim Hurley wrote:
 
 If the sentence:
 
 Now is the time, for all good men.
 
 is within the field myField , then
 
  find word time in field myField 
 
 is successful. The word time is found despite the fact that it is not 
 delimited with spaces on either side.
 
 But
 
  time is among the words of Now is the time, for all good men. 
 
 returns false, since is among the words reads the comma after time.  It 
 requires the spaces on either side of time as delimiters.
 
 Has this come up before and has it been suggest that this be an enhancement?
 
 That is to say, it would be helpful if is among the words and find 
 word(s) behave the same with respect to the space delimiter.
 
 Or am I missing something?
 
 Jim Hurley
 ___
 use-livecode mailing list
 use-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: is among the words AND find words

2011-12-20 Thread Jim Hurley
Think I will try something like this.

Test to see if the word, as a string, is in the text.
If so, then strip out all characters not between a and z or A and Z  
and then check to see if the stripped-down word is the same as the test word.

That way I will find time even if it appears as (time) or time. or 
time, or with quotes on either side, etc.

I wonder what algorithm LC uses in Find word(s) to find only words.

Jim Hurley

 Thanks Bob, Good thought, but it still doesn't work.
 
 The script:
 
 on mouseUp
   put now is the time, for all good men. into tText
   set wholematches to true
   --set wholematches to false
   put wordOffset(time, tText) into temp1
   put wordOffset(time, , tText) into temp2
 end mouseUp
 
 shows 0 for temp1 and 4 for temp2. The comma in time, is need to get a 
 match.
 
 What I need is
 
   put wordOffset(time, Now is the time, for all good men.) 
 
 to show 4 when wholeMatches is true
 
 It appears that there is no way in LiveCode to find whole words in a variable 
  reliably.
 
 Wish there were.
 
 Jim Hurley
 
 
 
 From: Bob Sneidar b...@twft.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: is among the words AND find words
 Message-ID: f68e06ca-9008-483a-b6ad-d91e5ac1f...@twft.com
 Content-Type: text/plain; charset=us-ascii
 
 Not sure if wholeMatches affects the find command, but if you set 
 wholeMatches to true and then use wordOffset(time,field myField) then I 
 think you will get the results you are looking for. wordOffset() returns 0 
 when it fails to find a match. 
 
 Bob
 
 
 On Dec 20, 2011, at 4:42 PM, Jim Hurley wrote:
 
 If the sentence:
 
 Now is the time, for all good men.
 
 is within the field myField , then
 
 find word time in field myField 
 
 is successful. The word time is found despite the fact that it is not 
 delimited with spaces on either side.
 
 But
 
 time is among the words of Now is the time, for all good men. 
 
 returns false, since is among the words reads the comma after time.  It 
 requires the spaces on either side of time as delimiters.
 
 Has this come up before and has it been suggest that this be an enhancement?
 
 That is to say, it would be helpful if is among the words and find 
 word(s) behave the same with respect to the space delimiter.
 
 Or am I missing something?
 
 Jim Hurley
 ___
 use-livecode mailing list
 use-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


Highlighting tabs

2011-12-10 Thread Jim Hurley
I have a tab menu button.

When I open the card I want to set the highlight of a particular tab to true. 
How do I address that property?

Thanks, 

Jim Hurley



___
use-livecode mailing list
use-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: Highlighting tabs

2011-12-10 Thread Jim Hurley
Hi Marty,

Damn. I tried that before and it didn't work. I just tried it again and it did! 

Maybe there is more history to  menuHistory  than I knew.

Working now, thanks,

Jim



 Hi Jim,
 Use the menuHistory - set the menuHistory of btn MyTabButton to 3
 
 Marty K
 
  I have a tab menu button.
 
 
 
  When I open the card I want to set the highlight of a particular tab to 
 true. How do I address that property?
 
 
 
  Thanks,
 
 
  Jim Hurley
 
 I have a tab menu button.
 
 When I open the card I want to set the highlight of a particular tab to 
 true. How do I address that property?
 
 Thanks, 
 
 Jim Hurley
 
 

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


Unlocked field receives the mouseUp message

2011-11-28 Thread Jim Hurley
I have been trying to find a way  for the user to change a text field from 
unlocked to locked and back without leaving the field, just using mouse clicks.

I have found (stumbled on) a way that appears altogether illegitimate.

If the field is unlocked I can type into the field as expected. If I click in 
the field nothing happens, again as expected. 

BUT if I right click (control click) in the unlocked field the field receives 
both a mouseDown and a mouseUP message and I now have a way to change the field 
from unlocked to locked  even when the field is unlocked and supposedly 
receiving key strokes but not mouse clicks. (See script below.)

Is there some orthodoxy by which I can under stand this? 

Jim Hurley

on mouseUP tNum
   put the locktext of field id 1003 cr after msg box
   if tNum = 3 then set the locktext of field id 1003  to not the locktext of 
field id 1003 -- returns false  cr  true
   put the locktext of field id 1003 cr after msg box
end mouseUP

If tNum = 3 and the field is unlocked, the message box shows: 

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


Unlocked field receives the mouseUp message

2011-11-28 Thread Jim Hurley
I'll have to wait for the summary list to respond to answers to that last 
message, as I still cannot access the RR archives.

Heather?

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


Unlocked field receives the mouseUp message

2011-11-28 Thread Jim Hurley
Thanks Peter.

Actually i do want to just toggle the locktext of the field.

I use the field to proofread the text by reading from  the clickchunk to the 
end using revspeak.

If I encounter an error while speaking, I want to be able to easily click the 
field again to allow for edit. The control click does allow a mouseUp to get 
through and the locktext to be changed to allow for edit.

In retrospect, I should have understood the rationale for this  behavior. While 
editing text in an unlocked field it should be possible to copy and past into 
the field so that it has to respond to command, control keys etc. So, it 
doesn't respond to a naked mouseUp, but it will respond to a combination of 
command, control etc. mouseUP.

It saves my bacon.

Jim

 I have the following in a frontscript, so it works on any field:
 
 on mouseup theBtn
if theBtn  1 then pass mouseup
if the target begins with field then
   if the commandkey is down and the shiftkey is down then
  set the writable of the target to not the writable of the target
   end if
else
   pass mouseup
end if
 end mouseup
 
 setprop writable tf
   if not (the target begins with field) then exit writable
   try
 set the locktext of the target to not tf
 set the traversalon of the target to tf
 set the autohilite of the target to tf
   end try
 end writable
 
 getprop writable
   if field is not in the target then return empty
   try
 put the locktext of the target into L
 put the traversalon of the target into T
 put the autohilite of the target into A
 if T and A and not L then return true
 return false
   end try
 end writable
 
 Holding the commandkey down during a mouseclick will trigger a mouseup 
 message (like the controlkey), and this means that cmd-sh-click will trigger 
 the mouseup handler. I use the virtual property writable to set the 
 locktext, autohilite, and traversalon of the field. Note that no enduring 
 property of the target field is ever actually set, since the calls are 
 intercepted to perform an action on the field instead. This is what is meant 
 by a virtual property. If you only want to toggle the locktext of the field 
 you can instead forget the virtual prop calls and just do set the locktext 
 of the target to not the locktext of the target in the mouseup handler.
 
 -- Peter
 
 Peter M. Brigham
 
 pmbrig at 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: Accessing archives

2011-11-26 Thread Jim Hurley
Wilhelm et. at.

Here is Heather's response to my question last Friday:

Jim Hurley


On Nov 25, 2011, at  9:46 AM, use-livecode-requ...@lists.runrev.com wrote:

 Message: 11
 Date: Fri, 25 Nov 2011 07:59:33 +
 From: Heather Nagey heat...@runrev.com
 To: How to use LiveCode use-livecode@lists.runrev.com
 Subject: Re: Accessing archives
 Message-ID: ed420a8a-3c3a-47c1-b7e0-c7bc551e8...@runrev.com
 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
 
 I am looking into it. I'll let the list know when it is fixed.
 
 Regards,
 
 Heather
 
 On 25 Nov 2011, at 06:48, James Hurley wrote:
 
 This problem has just come up within the last few days.   When I try  
 to access the RR archives at:
 
 http://lists.runrev.com/pipermail/use-livecode/2011-November/date.html
 
 I get the following message:
 Forbidden
 
 You don't have permission to access /pipermail/use-livecode/2011- 
 November/date.html on this server.
 
 Additionally, a 404 Not Found error was encountered while trying to  
 use an ErrorDocument to handle the request.
 
 
 Where does the problem lie?
 
 Jim
 ___
 use-livecode mailing list
 use-livecode@lists.runrev.com
 Please visit this url to subscribe, unsubscribe and manage your  
 subscription preferences:
 http://lists.runrev.com/mailman/listinfo/use-livecode
 
 Heather Nagey
 Customer Services Manager
 http://www.runrev.com/
 LiveCode - Unleash Your Killer App


___
use-livecode mailing list
use-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