select after text

2012-01-27 Thread Serge Brami
This script in a focusable and not locked  field :

on openfield
   put the long date after me
   select after text of me
end openfield


simple but doesn't work : the insertion point is never placed at the end of the 
text ...
any idea ?
___
use-livecode mailing list
use-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: iOS: multiline (UITextView) control weirdness

2012-01-27 Thread Gerry Orkin
It's roll your own unfortunately. Shouldn't be too hat to code - just do a 
repeat loop through all your controls subtracting the right amount from the 
second item in their loc. so the opposite wen finished editing. 

Gerry

-- Sent from my iPhone. 

On 28/01/2012, at 3:28 AM, Chris Sheffield  wrote:

> Okay, time for another one. Hopefully someone has experienced this and has a 
> solution.
> 
> I've got an iPad app, portrait only. At one point I'm creating a multiline 
> text control (UITextView) for input. The control is created near the bottom 
> of the screen. So when the keyboard pops up, the input area is getting 
> partially obscured. In other (non-LiveCode) apps, it seems like I remember 
> seeing the entire view simply slide up so that this doesn't happen, and the 
> input area rests nicely just above the keyboard. Do we have a way to do this 
> in LiveCode? I've checked all the properties and methods for UITextView and 
> can't figure this out. Or is this custom behavior that just needs to be 
> coded? If the latter, does anyone have an example and/or hints or tips to 
> make it work smoothly?
> 
> Thanks,
> Chris
> 
> 
> --
> Chris Sheffield
> Read Naturally, Inc.
> www.readnaturally.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: Scrolling in even increments

2012-01-27 Thread Bob Sneidar
One thing I did when I wanted to see what messages were being sent to the data 
grid during an operation is I put a dgprops handler in the data grid script and 
then put the property that was being passed as an argument. Perhaps that would 
help?

Bob Sneidar
IT Manager
Calvary Chapel CM
Sent from iPhone

On Jan 27, 2012, at 19:20, Marty Knapp  wrote:

> If I wanted a datagrid to scroll by an amount evenly divisible by 20 pixels, 
> is there a way to do that? I've tinkered with the lineIncrement and 
> scrollbarLineDec/scrollbarLineInc but I'm not getting anywhere. What about 
> dragging the scrollbar thumb or clicking above and below? Any ideas?
> 
> Thanks,
> Marty
> 
> ___
> use-livecode mailing list
> use-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


Scrolling in even increments

2012-01-27 Thread Marty Knapp
If I wanted a datagrid to scroll by an amount evenly divisible by 20 
pixels, is there a way to do that? I've tinkered with the lineIncrement 
and scrollbarLineDec/scrollbarLineInc but I'm not getting anywhere. What 
about dragging the scrollbar thumb or clicking above and below? Any ideas?


Thanks,
Marty

___
use-livecode mailing list
use-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: Send and Dispatch without parameters

2012-01-27 Thread Bob Sneidar
Wait I just thought of why it seemed to not work. In the mouseUp code I had the 
conditional "if pMouseBtnNum is 1 then...". DUH! If I don't pass 1 as a 
parameter, nothing inside the conditional will execute! Criminy that was 
stupid. 

Bob


On Jan 27, 2012, at 1:46 PM, dunb...@aol.com wrote:

> Bob.
> 
> 
> Nope, it was me. Name conflict; you don't want to know.
> 
> 
> The method works fine. LC messages like "mouseUp" or custom ones like 
> "yourMessage" all pass correctly. Parameters are not pertinent. Check your 
> stack. I had another object with the same name as the intended target. My 
> message was passed all right, but to the wrong destination.
> 
> 
> Craig Newman
> 
> 
> -Original Message-
> From: Bob Sneidar 
> To: How to use LiveCode 
> Sent: Fri, Jan 27, 2012 3:57 pm
> Subject: Send and Dispatch without parameters
> 
> 
> Hi all. 
> 
> I just noticed that if you send or dispatch to an object and you have 
> specified 
> parameters in the objects handler, but you don't provide the parameters when 
> you 
> send or dispatch, the call will silently fail. This seems only to occur for 
> built in handlers, like mouseUp for example. 
> 
> If I have a button called "myButton" with a mouseUp handler:
> 
> on mouseUp pButtonNum
>put "This is a test"
> end mouseUp
> 
> if I:
> send "mouseUp" to button "myButton"
> 
> or:
> dispatch "mouseUp" to button "myButton" 
> 
> The button will never get the message, and no error is generated. This caught 
> me 
> quiet off guard, as you can for a custom handler just call it, and even if 
> you 
> don't provide all the parameters, the handler gets called anyway. 
> 
> However, if I have a custom handler:
> 
> on testMe theMessage
>put "This is a successful test."
> end testMe
> 
> And then I send or dispatch without the parameter, the handler gets called 
> fine! 
> Is this normal or expected behavior? I cannot think that this kind of 
> ambiguity 
> is what the devs intended. If someone can give me a reason for why it has to 
> be 
> this way, I can just watch for it in the future. If not I suppose I should 
> submit a bug report. 
> 
> In the meantime, I suppose the best practice is to never put the business end 
> of 
> your code in the built in handlers, but rather call a command or function 
> that 
> does all the work. That way you can send or dispatch to that handler and not 
> to 
> the built in one. 
> 
> 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


___
use-livecode mailing list
use-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: Send and Dispatch without parameters

2012-01-27 Thread Pete
send/dispatch with no parms works fine for me.  Where are you sending the
message from - same card as the target, same stack, different stack?
 Shouldn't make any difference but if there is a problem, gonna need to
know the details.

Pete

On Fri, Jan 27, 2012 at 12:54 PM, Bob Sneidar  wrote:

> Hi all.
>
> I just noticed that if you send or dispatch to an object and you have
> specified parameters in the objects handler, but you don't provide the
> parameters when you send or dispatch, the call will silently fail. This
> seems only to occur for built in handlers, like mouseUp for example.
>
> If I have a button called "myButton" with a mouseUp handler:
>
> on mouseUp pButtonNum
>put "This is a test"
> end mouseUp
>
> if I:
> send "mouseUp" to button "myButton"
>
> or:
> dispatch "mouseUp" to button "myButton"
>
> The button will never get the message, and no error is generated. This
> caught me quiet off guard, as you can for a custom handler just call it,
> and even if you don't provide all the parameters, the handler gets called
> anyway.
>
> However, if I have a custom handler:
>
> on testMe theMessage
>put "This is a successful test."
> end testMe
>
> And then I send or dispatch without the parameter, the handler gets called
> fine! Is this normal or expected behavior? I cannot think that this kind of
> ambiguity is what the devs intended. If someone can give me a reason for
> why it has to be this way, I can just watch for it in the future. If not I
> suppose I should submit a bug report.
>
> In the meantime, I suppose the best practice is to never put the business
> end of your code in the built in handlers, but rather call a command or
> function that does all the work. That way you can send or dispatch to that
> handler and not to the built in one.
>
> 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
>
>


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


Re: Send and Dispatch without parameters

2012-01-27 Thread dunbarx
Bob.


Nope, it was me. Name conflict; you don't want to know.


The method works fine. LC messages like "mouseUp" or custom ones like 
"yourMessage" all pass correctly. Parameters are not pertinent. Check your 
stack. I had another object with the same name as the intended target. My 
message was passed all right, but to the wrong destination.


Craig Newman


-Original Message-
From: Bob Sneidar 
To: How to use LiveCode 
Sent: Fri, Jan 27, 2012 3:57 pm
Subject: Send and Dispatch without parameters


Hi all. 

I just noticed that if you send or dispatch to an object and you have specified 
parameters in the objects handler, but you don't provide the parameters when 
you 
send or dispatch, the call will silently fail. This seems only to occur for 
built in handlers, like mouseUp for example. 

If I have a button called "myButton" with a mouseUp handler:

on mouseUp pButtonNum
put "This is a test"
end mouseUp

if I:
send "mouseUp" to button "myButton"

or:
dispatch "mouseUp" to button "myButton" 

The button will never get the message, and no error is generated. This caught 
me 
quiet off guard, as you can for a custom handler just call it, and even if you 
don't provide all the parameters, the handler gets called anyway. 

However, if I have a custom handler:

on testMe theMessage
put "This is a successful test."
end testMe

And then I send or dispatch without the parameter, the handler gets called 
fine! 
Is this normal or expected behavior? I cannot think that this kind of ambiguity 
is what the devs intended. If someone can give me a reason for why it has to be 
this way, I can just watch for it in the future. If not I suppose I should 
submit a bug report. 

In the meantime, I suppose the best practice is to never put the business end 
of 
your code in the built in handlers, but rather call a command or function that 
does all the work. That way you can send or dispatch to that handler and not to 
the built in one. 

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


iPad Camera App Development needed

2012-01-27 Thread Todd Geist
Hello,

(sorry for the double post. I forgot the subject )

I need a very simple camera app built for the iPad.  I would do it myself,
but I am just too busy. So I am hopeful I can find somebody who can get
this thing built for me. This is to serve a small niche market. It will
serve as a companion app to another product I am already selling.

Features:

   1. take a photo
   2. downsize the photo
   3. Base64 encode the image
   4. Send the resulting string to another application through a specific
   URL protocol
   5. Needs to be launched from another App, probably using a URL protocol
   that will need to be defined.

I am pretty sure that everything except #5 is pretty straightforward.  I
will need the Livecode project back. I will handle getting built and
submitted to the app store.

If this sounds interesting to you, please get in touch with me at
t...@geistinteractive.com.

Thank you

-- 
Todd Geist


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


[no subject]

2012-01-27 Thread Todd Geist
Hello,

I need a very simple camera app built for the iPad.  I would do it myself,
but I am just too busy. So I am hopeful I can find somebody who can get
this thing built for me. This is to serve a small niche market. It will
serve as a companion app to another product I am already selling.

Features:

   1. take a photo
   2. downsize the photo
   3. Base64 encode the image
   4. Send the resulting string to another application through a specific
   URL protocol
   5. Needs to be launched from another App, probably using a URL protocol
   that will need to be defined.

I am pretty sure that everything except #5 is pretty straightforward.  I
will need the Livecode project back. I will handle getting built and
submitted to the app store.

If this sounds interesting to you, please get in touch with me at
t...@geistinteractive.com.

Thank you

Todd

-- 
Todd Geist


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


iPad App development needed

2012-01-27 Thread Todd Geist
Hello,

I need a very simple camera app built for the iPad.  I would do it myself,
but I am just too busy. So I am hopeful I can find somebody who can get
this thing built for me. This is to serve a small niche market. It will
serve as a companion app to another product I am already selling.

Features:

   1. take a photo
   2. downsize the photo
   3. Base64 encode the image
   4. Send the resulting string to another application through a specific
   URL protocol
   5. Needs to be launched from another App, probably using a URL protocol
   that will need to be defined.

I am pretty sure that everything except #5 is pretty straightforward.  I
will need the Livecode project back. I will handle getting built and
submitted to the app store.

If this sounds interesting to you, please get in touch with me at
t...@geistinteractive.com.

Thank you

Todd

-- 
Todd Geist


(805) 419-9382
___
use-livecode mailing list
use-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: Send and Dispatch without parameters

2012-01-27 Thread Mike Bonner
I don't see this behavior when I try it. Updated win7, lc 5.0.2.  Not sure
why your results differ unless maybe theres a frontscript doing strange
things?

On Fri, Jan 27, 2012 at 1:54 PM, Bob Sneidar  wrote:

> Hi all.
>
> I just noticed that if you send or dispatch to an object and you have
> specified parameters in the objects handler, but you don't provide the
> parameters when you send or dispatch, the call will silently fail. This
> seems only to occur for built in handlers, like mouseUp for example.
>
> If I have a button called "myButton" with a mouseUp handler:
>
> on mouseUp pButtonNum
>put "This is a test"
> end mouseUp
>
> if I:
> send "mouseUp" to button "myButton"
>
> or:
> dispatch "mouseUp" to button "myButton"
>
> The button will never get the message, and no error is generated. This
> caught me quiet off guard, as you can for a custom handler just call it,
> and even if you don't provide all the parameters, the handler gets called
> anyway.
>
> However, if I have a custom handler:
>
> on testMe theMessage
>put "This is a successful test."
> end testMe
>
> And then I send or dispatch without the parameter, the handler gets called
> fine! Is this normal or expected behavior? I cannot think that this kind of
> ambiguity is what the devs intended. If someone can give me a reason for
> why it has to be this way, I can just watch for it in the future. If not I
> suppose I should submit a bug report.
>
> In the meantime, I suppose the best practice is to never put the business
> end of your code in the built in handlers, but rather call a command or
> function that does all the work. That way you can send or dispatch to that
> handler and not to the built in one.
>
> 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: Send and Dispatch without parameters

2012-01-27 Thread dunbarx
This is not normal. The method works for me, and has, basically, since 1987.


But I tried it in both a new stack and in a stack filled with other stuff, a 
test stack of mine with all sorts of things in it. The simple command worked as 
advertised in the new stack, but failed in the test stack as you described. Not 
sure yet what is happening.


This is the most basic of all message hierarchy machinations; it has to work in 
all the variations you mentioned.


Craig Newman









-Original Message-
From: Bob Sneidar 
To: How to use LiveCode 
Sent: Fri, Jan 27, 2012 3:57 pm
Subject: Send and Dispatch without parameters


Hi all. 

I just noticed that if you send or dispatch to an object and you have specified 
parameters in the objects handler, but you don't provide the parameters when 
you 
send or dispatch, the call will silently fail. This seems only to occur for 
built in handlers, like mouseUp for example. 

If I have a button called "myButton" with a mouseUp handler:

on mouseUp pButtonNum
put "This is a test"
end mouseUp

if I:
send "mouseUp" to button "myButton"

or:
dispatch "mouseUp" to button "myButton" 

The button will never get the message, and no error is generated. This caught 
me 
quiet off guard, as you can for a custom handler just call it, and even if you 
don't provide all the parameters, the handler gets called anyway. 

However, if I have a custom handler:

on testMe theMessage
put "This is a successful test."
end testMe

And then I send or dispatch without the parameter, the handler gets called 
fine! 
Is this normal or expected behavior? I cannot think that this kind of ambiguity 
is what the devs intended. If someone can give me a reason for why it has to be 
this way, I can just watch for it in the future. If not I suppose I should 
submit a bug report. 

In the meantime, I suppose the best practice is to never put the business end 
of 
your code in the built in handlers, but rather call a command or function that 
does all the work. That way you can send or dispatch to that handler and not to 
the built in one. 

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


Send and Dispatch without parameters

2012-01-27 Thread Bob Sneidar
Hi all. 

I just noticed that if you send or dispatch to an object and you have specified 
parameters in the objects handler, but you don't provide the parameters when 
you send or dispatch, the call will silently fail. This seems only to occur for 
built in handlers, like mouseUp for example. 

If I have a button called "myButton" with a mouseUp handler:

on mouseUp pButtonNum
put "This is a test"
end mouseUp

if I:
send "mouseUp" to button "myButton"

or:
dispatch "mouseUp" to button "myButton" 

The button will never get the message, and no error is generated. This caught 
me quiet off guard, as you can for a custom handler just call it, and even if 
you don't provide all the parameters, the handler gets called anyway. 

However, if I have a custom handler:

on testMe theMessage
put "This is a successful test."
end testMe

And then I send or dispatch without the parameter, the handler gets called 
fine! Is this normal or expected behavior? I cannot think that this kind of 
ambiguity is what the devs intended. If someone can give me a reason for why it 
has to be this way, I can just watch for it in the future. If not I suppose I 
should submit a bug report. 

In the meantime, I suppose the best practice is to never put the business end 
of your code in the built in handlers, but rather call a command or function 
that does all the work. That way you can send or dispatch to that handler and 
not to the built in one. 

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: Trouble with 'there is a'

2012-01-27 Thread Pete
Thanks Ken.  I am handing off the paths to an external application so I'll
need to convert the slashes.
Pete

On Fri, Jan 27, 2012 at 10:31 AM, Ken Ray  wrote:

> So the only times we need to deal with path delimiters is when (a) working
> with the WIndows registry (see queryRegistry/setRegistry/etc.), and (b)
> when handing off paths to external applications (like VBScript or
> AppleScript), IIRC.
>



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


Re: Cloning stack reset object IDs?

2012-01-27 Thread Pete
Hi Marty,
I've just been playing around with this a bit more and need to clarify a
couple of things.

When you clone a card, it is placed into the currently-open stack, not the
same stack as the original card was in.  So if the stack the original card
is in is open when you clone it, the new card's ID is calculated from the
highest ID on the on the old card.  So yes, you get a new set of IDs, but
they're all higher than what was on the original card, not much use for
what you want to do.

However, you can get help.  Create a new substack of your main stack.  The
card in it will be ID 1002.  Open the new substack, then issue a clone
command from the message box for the card you want to clone.  The new card
will be placed in the new substack and the controls on it will start with
ID 1003.

I haven't taken the last step but you would have delete the stack the card
originated in, then rename the new substack to have the same name as the
original stack.

I think there may well be some gotchas in doing this.  For example, if you
have any behaviors set to the ID of a control on the card, you'd have to
 change them to the ID of the same control on the new card.  There are also
some properties of a datagrid that could be set to a control ID on the card
and those would have to be manually changed also.  Just scan through the
dgProps custom property set and see if you see anything that references a
control on the same card as the datagrid.

I hope that helps.

There's another aspect to this.  Datagrids do use up a lot of control IDs
for sure but I wonder just how much it matters in practical terms.  It
would be interesting to figure out how many times a datagrid would have to
be refreshed to overflow the control ids, by dividing the max possible id
value by an estimate of how many IDs any particular datagrid uses.
 Unfortunately, I don't know what the max id number is - anyone?

Pete

On Fri, Jan 27, 2012 at 9:53 AM, Marty Knapp  wrote:

> Pete,
> So if I'm understanding you correctly, I could clone a card with a
> datagrid and then delete the original card and I would, in effect, start
> with a fresh set of IDs?
>
> Marty
>
>> Hi Richard,
>> Just the datagrid group, not the stack itself.
>>
>> Here's what I see when cloning.  If I clone a card, the controls on it are
>> given a new set of IDs.  If I clone a stack, the controls within the new
>> stack retain the IDs from the original stack.  I guess that's what I would
>> have expected.
>>
>> One other thing I noticed when I was doing this test.  The IDs of the
>> controls I put on the first card I set up for the test weren't numbered
>> consecutively, they were 1004, 1006, 1008, etc.  When I cloned that card,
>> the IDs were consecutive, 1011, 1012, 1013, etc.  Is there a reason why
>> the
>> first card's control IDs went up in 2's?
>>
>> 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
>
>


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


Re: Trouble with 'there is a'

2012-01-27 Thread Ken Ray

On Jan 27, 2012, at 11:56 AM, Klaus on-rev wrote:

> Hi Pete,
> 
> Am 27.01.2012 um 18:35 schrieb Pete:
> 
>> Hi Ken,
>> You're saving my life on these Mac/Windows issues, thank you!  One question
>> on this.  What do the ask/answer file/folder dialogs return on Windows?
>> Does LC convert the "\" chars to "/" before putting it into the it variable,
> 
> Yes!
> 
>> or just pass whatever the os returns?
> 
> No!
> 
> :-)
> 
> Internally LiveCode always uses the UNIX slash / as the pathdelimiter.

Right - LC tries its hardest to keep things internally compatible and 
automatically translates "foreign" things like line breaks and path delimiters 
to its own internal format, and then retranslates it back when LC reaches out 
to the host operating system. So if you do an "answer file" on Windows and then 
get the path to the selected file, it's "/"-delimited, not "\"-delimited. If 
you then have to write data out to a file on Windows, and you do something like:

  put "Hello" into url ("file:C:/Users/kray/Desktop/Hello.txt")

it will work because LC recognizes it's on Windows and translates that to 
"C:\Users\kray\Desktop\Hello.txt" to communicate with the OS.

So the only times we need to deal with path delimiters is when (a) working with 
the WIndows registry (see queryRegistry/setRegistry/etc.), and (b) when handing 
off paths to external applications (like VBScript or AppleScript), IIRC.

> 

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: iOS Home Button

2012-01-27 Thread Chris Sheffield
Dan,

Try shutdown instead of shutdownRequest. The shutdownRequest message is used in 
a desktop standalone when you want to possibly prevent the application from 
shutting down. Under iOS, that's impossible when hitting the home button. The 
shutdown message is working great for me.

Chris

--
Chris Sheffield
Read Naturally, Inc.
www.readnaturally.com

On Jan 27, 2012, at 10:34 AM, Dan Friedman wrote:

> Greetings!
> 
> Is there a way to trap when the user hits the Home button on his iPad?  I 
> want to do a little cleanup (including writing some data to a server) when my 
> app is closed.  I tried shutdownRequest, but this doesn't seem to work.  Any 
> thoughts?
> 
> Thanks in advance,
> -Dan
> ___
> use-livecode mailing list
> use-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: Trouble with 'there is a'

2012-01-27 Thread Klaus on-rev
Hi Pete,

Am 27.01.2012 um 18:35 schrieb Pete:

> Hi Ken,
> You're saving my life on these Mac/Windows issues, thank you!  One question
> on this.  What do the ask/answer file/folder dialogs return on Windows?
> Does LC convert the "\" chars to "/" before putting it into the it variable,

Yes!

> or just pass whatever the os returns?

No!

:-)

Internally LiveCode always uses the UNIX slash / as the pathdelimiter.

> Thanks,
> Pete

Best

Klaus

--
Klaus Major
http://www.major-k.de
kl...@major.on-rev.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: Cloning stack reset object IDs?

2012-01-27 Thread Marty Knapp

Pete,
So if I'm understanding you correctly, I could clone a card with a 
datagrid and then delete the original card and I would, in effect, start 
with a fresh set of IDs?


Marty

Hi Richard,
Just the datagrid group, not the stack itself.

Here's what I see when cloning.  If I clone a card, the controls on it are
given a new set of IDs.  If I clone a stack, the controls within the new
stack retain the IDs from the original stack.  I guess that's what I would
have expected.

One other thing I noticed when I was doing this test.  The IDs of the
controls I put on the first card I set up for the test weren't numbered
consecutively, they were 1004, 1006, 1008, etc.  When I cloned that card,
the IDs were consecutive, 1011, 1012, 1013, etc.  Is there a reason why the
first card's control IDs went up in 2's?

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: Trouble with 'there is a'

2012-01-27 Thread Pete
Hi Ken,
You're saving my life on these Mac/Windows issues, thank you!  One question
on this.  What do the ask/answer file/folder dialogs return on Windows?
 Does LC convert the "\" chars to "/" before putting it into the it
variable, or just pass whatever the os returns?
Thanks,
Pete


>
> Right. If you *do* need to construct a "\"-delimited path for external use
> (for example, if you're creating a VBScript in LiveCode that you want to
> execute with "do … as VBScript"), then do your "/"-to-"\" conversions *just
> before* you use it, and do the conversion on a variable that's not going to
> be used again in that handler (like a temporary copy of a variable or one
> that is solely for the purpose of passing off to VBScript). For example:
>
>   put specialFolderPath("desktop") & "MyFile.txt" into tFile
>   -- maybe some other code goes here
>   put replaceText(tFile,"/","\") into tTempFile
>   -- construct VBScript using the tTempFile variable -- keeps tFile safe
> if you need to work with it later
>
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


iOS Home Button

2012-01-27 Thread Dan Friedman
Greetings!

Is there a way to trap when the user hits the Home button on his iPad?  I want 
to do a little cleanup (including writing some data to a server) when my app is 
closed.  I tried shutdownRequest, but this doesn't seem to work.  Any thoughts?

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


What's the best way to show a set of pictures?

2012-01-27 Thread Ken Corey

Hi All,

My app will be deployed onto, at a minimum, iOS universal, and Windows 
PCs.  If I can get the code working there then Android as well.


I want to represent the children of a teacher's class with a smallish 
picture of each child...and allow the teacher to take a new picture, or 
refresh one that's there already.


I've seen the code to take a picture, and (though not having touched it) 
it seems fairly straightforward.


The question is what's the best way to create a clickable set of images?

Do I simply create images, provide a mouseUp handler for them, and 
implement my own geometry, or is there a clever thing to do with 
tables/dataGrids?


-Ken

___
use-livecode mailing list
use-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: Cloning stack reset object IDs?

2012-01-27 Thread Bob Sneidar
It is because of this sort of thing that I think the engine needs to be updated 
to reuse unused ID's. It would be a simple matter to have the engine reset the 
stack ID to the lowest unused ID if it ever ran out, and then check for the 
next available ID when it sets the stack ID after an object gets created. If 
they did that, then a developer could simply set the stack ID to 0 if he wanted 
to do it himself, and have the engine find the next unused ID. I suppose there 
would have to be an index of some sort, of objects and their ID's. There may 
already be such a thing in the stack structure. 

Bob


On Jan 27, 2012, at 9:04 AM, Pete wrote:

> Hi Richard,
> Just the datagrid group, not the stack itself.
> 
> Here's what I see when cloning.  If I clone a card, the controls on it are
> given a new set of IDs.  If I clone a stack, the controls within the new
> stack retain the IDs from the original stack.  I guess that's what I would
> have expected.
> 
> One other thing I noticed when I was doing this test.  The IDs of the
> controls I put on the first card I set up for the test weren't numbered
> consecutively, they were 1004, 1006, 1008, etc.  When I cloned that card,
> the IDs were consecutive, 1011, 1012, 1013, etc.  Is there a reason why the
> first card's control IDs went up in 2's?
> 
> Pete
> 
> On Fri, Jan 27, 2012 at 7:54 AM, Richard Gaskin
> wrote:
> 
>> Pete wrote:
>> 
>>> I just cloned a datagrid to see what would happen.  I'm afraid all the
>>> control ids just carried on from the last one used in the original
>>> datagrid
>>> so using clone doesn't help.
>>> 
>> 
>> Was that just the dataGrid group or the whole stack?
>> 
>> Since the stack governs the IDs of objects within it, I would imagine that
>> cloning the stack as a whole would preserve existing IDs, but here whenever
>> I copy any object from one stack to another the ID is automatically reset
>> to use the next available ID for the target stack.
>> 
>> --
>> 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
>> 
>> 
> 
> 
> -- 
> Pete
> Molly's Revenge 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


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


Re: Trouble with 'there is a'

2012-01-27 Thread Bob Sneidar
What he said. ;-)

On Jan 27, 2012, at 7:42 AM, Ken Ray wrote:

>> My real script did have two problem but they were quite different, and might 
>> be of interest.
> 
> I'm glad you brought these up - for others reading this there are some "best 
> practices" to learn about these things:
> 
>> 1.  I had constructed a Windows-style path with "\" characters to fit in 
>> with a small VB script I wanted to run. This does work in some contexts, but 
>> not in this one: in normal circumstances (but not AFAICS in VB scripts) LC 
>> looks after the change from "/" to "\". I forgot that it was this path in 
>> the variable I was testing. It gave a strange result, but the obvious answer 
>> is "don't do it".
> 
> Right. If you *do* need to construct a "\"-delimited path for external use 
> (for example, if you're creating a VBScript in LiveCode that you want to 
> execute with "do … as VBScript"), then do your "/"-to-"\" conversions *just 
> before* you use it, and do the conversion on a variable that's not going to 
> be used again in that handler (like a temporary copy of a variable or one 
> that is solely for the purpose of passing off to VBScript). For example:
> 
>   put specialFolderPath("desktop") & "MyFile.txt" into tFile
>   -- maybe some other code goes here
>   put replaceText(tFile,"/","\") into tTempFile
>   -- construct VBScript using the tTempFile variable -- keeps tFile safe if 
> you need to work with it later
> 
> 
>> 2. The form of my 'if' condition was
>> 
>> if there is not a file myPath &"/" & myfilename
>> 
>> it turns out that the 'there is no' statement doesn't construct the string 
>> before the evaluation: you have to ensure the evaluation of the string by 
>> putting it in brackets as in
>> 
>> if there is not a file (myPath &"/" & myfilename)
>> 
>> There is an obscure warning about this in the dictionary: "The there is no 
>> operator is implemented internally as a function, and therefore has lower 
>> precedence than other operators". So it's a precedence issue.
> 
> One thing I've gotten into the habit of doing is to always surround 
> concatenation and logic operations (especially those with symbols) in 
> parentheses - apart from being more readable, it also saves headaches if the 
> interpreter sees things differently than you intended. Examples:
> 
>   put ("This is" && "a test") into tVar
>   if (tVar <> "") then …
> 
> For multiple logic operations it is even more important. Compare:
> 
>   if tVar > 100 and tFileName contains " " or tVar = 0 then
> 
> vs.
> 
>   if ((tVar > 100) and (tFileName contains " ")) or (tVar = 0) then
> 
> 
> Just my 2 cents,
> 
> 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


___
use-livecode mailing list
use-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: Trouble with 'there is a'

2012-01-27 Thread Bob Sneidar
I remember a long time ago in a Revolution conference far, far away, someone 
gave a class on good coding habits. One of the habits he mentioned was to 
enclose in parenthesis where you can, partly for this reason, and partly 
because it makes the code easier to read. I go halfway. If I have any doubt 
about the precedence of a statement, I use parenthesis. 

In fact, an even better habit is to put paths into variables, or just put 
anything into variables, then work with those. It makes debugging a whole lot 
easier, and code easier to read. 

Bob


On Jan 27, 2012, at 3:37 AM, Graham Samuel wrote:

> 2. The form of my 'if' condition was
> 
>  if there is not a file myPath &"/" & myfilename
> 
> it turns out that the 'there is no' statement doesn't construct the string 
> before the evaluation: you have to ensure the evaluation of the string by 
> putting it in brackets as in
> 
>  if there is not a file (myPath &"/" & myfilename)
> 
> There is an obscure warning about this in the dictionary: "The there is no 
> operator is implemented internally as a function, and therefore has lower 
> precedence than other operators". So it's a precedence issue.
> 
> 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


Re: errors trapped inside data grids?

2012-01-27 Thread Bob Sneidar
I think some errors are trapped so that they do not cause a code break. Check 
the result to see if it contains anything.

Bob


On Jan 27, 2012, at 4:53 AM, Ken Corey wrote:

> Hi All,
> 
> I noticed something *very* strange, and I was hoping someone could either 
> confirm or set me straight.
> 
> I'm implementing dataGrids for the first time, so I'm reading a lot of the 
> lessons and tutorials (since that's the only documentation, seemingly).
> 
> I wanted to do something with the data once the user had finished editting 
> it, so I put this handler in:
> 
> --8<-
> ## CloseFieldEditor placed in data grid script
> on CloseFieldEditor pFieldEditor
>put the dgColumn of the target into theColumnBeingEdited
>## Store UTF8 text
>put unidecode(the unicodetext of pFieldEditor, "UTF8") into theNewText
> 
>## Save data to database using command I defined
>put "Person" into theTable
>## Get the unique id of the row in the database we want to edit
>put GetDataOfIndex(the dgIndex of me, "id") into theRowID
> 
>SaveDataToDatabase theTable, theRowID, theColumnBeingEdited, theNewText
> 
>## Update dgData.
>## Setting dgDataOfIndex will refresh the data grid display as well as 
> update dgData
>put the dgDataOfIndex[ the dgIndex of the target] of me into theDataA
>put theNewText into theDataA[theColumnBeingEdited]
>set the dgDataOfIndex[the dgIndex of the target] of me to theDataA
> end CloseFieldEditor
> --8<-
> 
> Okay, so far so good. After the unidecode I added a line "answer theNewText", 
> which happily shows me an alert dialog with the text I editted.  This is 
> almost feeling easy.
> 
> Then, I was wondering why my data is reverting after editting, and noticed 
> the 'SaveDataToDatabase' call.
> 
> It's not anywhere.  I performed a 'Find' that should have winkled it out.
> 
> If it's not anywhere, then shouldn't it bark when it can't be found?
> 
> Just for grins, I put 'qqqxqqq' in the handler just after the 'answer' I'd 
> put before.
> 
> No error message at all.
> 
> Surely an error message of some stripe should be reported, yes?
> 
> -Ken
> 
> ___
> use-livecode mailing list
> use-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: Cloning stack reset object IDs?

2012-01-27 Thread Pete
Hi Richard,
Just the datagrid group, not the stack itself.

Here's what I see when cloning.  If I clone a card, the controls on it are
given a new set of IDs.  If I clone a stack, the controls within the new
stack retain the IDs from the original stack.  I guess that's what I would
have expected.

One other thing I noticed when I was doing this test.  The IDs of the
controls I put on the first card I set up for the test weren't numbered
consecutively, they were 1004, 1006, 1008, etc.  When I cloned that card,
the IDs were consecutive, 1011, 1012, 1013, etc.  Is there a reason why the
first card's control IDs went up in 2's?

Pete

On Fri, Jan 27, 2012 at 7:54 AM, Richard Gaskin
wrote:

> Pete wrote:
>
>> I just cloned a datagrid to see what would happen.  I'm afraid all the
>> control ids just carried on from the last one used in the original
>> datagrid
>> so using clone doesn't help.
>>
>
> Was that just the dataGrid group or the whole stack?
>
> Since the stack governs the IDs of objects within it, I would imagine that
> cloning the stack as a whole would preserve existing IDs, but here whenever
> I copy any object from one stack to another the ID is automatically reset
> to use the next available ID for the target stack.
>
> --
>  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
>
>


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


Re: Revlets on the web

2012-01-27 Thread William de Smet
Hi Jim,

There was a question lately in one of their surveys about HTML5. I
guess they are thinking about going this way with revlets.
For now I think they shouldn't sell it because it doesn't work well
(or not at all).

Greetings,

William



2012/1/27 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

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


iOS: multiline (UITextView) control weirdness

2012-01-27 Thread Chris Sheffield
Okay, time for another one. Hopefully someone has experienced this and has a 
solution.

I've got an iPad app, portrait only. At one point I'm creating a multiline text 
control (UITextView) for input. The control is created near the bottom of the 
screen. So when the keyboard pops up, the input area is getting partially 
obscured. In other (non-LiveCode) apps, it seems like I remember seeing the 
entire view simply slide up so that this doesn't happen, and the input area 
rests nicely just above the keyboard. Do we have a way to do this in LiveCode? 
I've checked all the properties and methods for UITextView and can't figure 
this out. Or is this custom behavior that just needs to be coded? If the 
latter, does anyone have an example and/or hints or tips to make it work 
smoothly?

Thanks,
Chris


--
Chris Sheffield
Read Naturally, Inc.
www.readnaturally.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: Cloning stack reset object IDs?

2012-01-27 Thread Richard Gaskin

Pete wrote:

I just cloned a datagrid to see what would happen.  I'm afraid all the
control ids just carried on from the last one used in the original datagrid
so using clone doesn't help.


Was that just the dataGrid group or the whole stack?

Since the stack governs the IDs of objects within it, I would imagine 
that cloning the stack as a whole would preserve existing IDs, but here 
whenever I copy any object from one stack to another the ID is 
automatically reset to use the next available ID for the target stack.


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


Re: Trouble with 'there is a'

2012-01-27 Thread Ken Ray
> My real script did have two problem but they were quite different, and might 
> be of interest.

I'm glad you brought these up - for others reading this there are some "best 
practices" to learn about these things:

> 1.  I had constructed a Windows-style path with "\" characters to fit in with 
> a small VB script I wanted to run. This does work in some contexts, but not 
> in this one: in normal circumstances (but not AFAICS in VB scripts) LC looks 
> after the change from "/" to "\". I forgot that it was this path in the 
> variable I was testing. It gave a strange result, but the obvious answer is 
> "don't do it".

Right. If you *do* need to construct a "\"-delimited path for external use (for 
example, if you're creating a VBScript in LiveCode that you want to execute 
with "do … as VBScript"), then do your "/"-to-"\" conversions *just before* you 
use it, and do the conversion on a variable that's not going to be used again 
in that handler (like a temporary copy of a variable or one that is solely for 
the purpose of passing off to VBScript). For example:

   put specialFolderPath("desktop") & "MyFile.txt" into tFile
   -- maybe some other code goes here
   put replaceText(tFile,"/","\") into tTempFile
   -- construct VBScript using the tTempFile variable -- keeps tFile safe if 
you need to work with it later


> 2. The form of my 'if' condition was
> 
>  if there is not a file myPath &"/" & myfilename
> 
> it turns out that the 'there is no' statement doesn't construct the string 
> before the evaluation: you have to ensure the evaluation of the string by 
> putting it in brackets as in
> 
>  if there is not a file (myPath &"/" & myfilename)
> 
> There is an obscure warning about this in the dictionary: "The there is no 
> operator is implemented internally as a function, and therefore has lower 
> precedence than other operators". So it's a precedence issue.

One thing I've gotten into the habit of doing is to always surround 
concatenation and logic operations (especially those with symbols) in 
parentheses - apart from being more readable, it also saves headaches if the 
interpreter sees things differently than you intended. Examples:

   put ("This is" && "a test") into tVar
   if (tVar <> "") then …

For multiple logic operations it is even more important. Compare:

   if tVar > 100 and tFileName contains " " or tVar = 0 then

vs.

   if ((tVar > 100) and (tFileName contains " ")) or (tVar = 0) then


Just my 2 cents,

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: How to store some data in my stack

2012-01-27 Thread Ken Ray

On Jan 27, 2012, at 1:57 AM, Takashi Yoshino wrote:

> Hi, Ken
> 
>> Are you *really* using curly quotes around "documents" and "testFile.txt"? 
>> The only reason I ask is that you have straight quotes around "Data" and "no 
>> file yet!", so I figured I'd check. If so, that might be the problem 
>> (although I'd think you'd get an error dialog first, but)…
> 
> Thank you for you help.
> The problem was resolved for your comment.
> 
> Quote is bad effect, but no error messages….

Wow… that's one for the books! Odd that it didn't give any error messages, but 
I'm glad it worked!

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: Card Buttons in Windows

2012-01-27 Thread Ken Ray

On Jan 26, 2012, at 11:47 PM, Peter Bogdanoff wrote:

> Hi,
> 
> I have a bizarre issue that I can't figure out.
> 
> I have a stack created in OS X that I brought over to Windows. In Windows, 
> card buttons are 12% wider and moved to the right 7 pixels.
> 
> For example, 4 card buttons, touching side by side. After opening the stack 
> in Windows I see the first button moved 7 pixels to the right and stretched 
> 16 pixels wider. The three remaining buttons continue to be touching their 
> sides but each 12% wider.
> 
> 1. Card button heights are the same
> 2. Background buttons are normal size
> 3. The stack size is unchanged and was locked
> 4. No live resizing enabled
> 5. The same stack brought back to OS X had the new sizes of the card buttons
> 6. I did a test with a new stack with similar size and buttons--Created in OS 
> X but showing unchanged in Windows, problem not replicated
> 7. Working with LC 5.0.0, but a runtime created in 4.6.3 showed the same 
> anomaly.
> 8. Testing in Windows XP & 7 using Virtual Box for 7 and VMWare Fusion for XP 
> on my Mac OS X Snow Lion
> 9. Nothing in my scripts that resize anything
> 10. The stack was originally created in HyperCard, converted to LC in 4.6.3
> 11. New buttons created in the Mac OS X stack also show the same resizing 
> when the stack is brought to Windows.
> 
> Anybody have anything on this???

Just a few questions:

1) Are you using LiveCode property profiles to manage font changes between 
platforms, or are you changing the textFont/textSize/textStyle/textHeight of 
your buttons manually?
2) What is the style of the buttons?
3) Does it change anything if you set the lockLocation of the buttons to true?
4) Make sure that no code runs in the affected stack when it opens (like 
temporarily commenting out any code that would run) and then try to open it on 
Windows. Do you still see the same issue?

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


errors trapped inside data grids?

2012-01-27 Thread Ken Corey

Hi All,

I noticed something *very* strange, and I was hoping someone could 
either confirm or set me straight.


I'm implementing dataGrids for the first time, so I'm reading a lot of 
the lessons and tutorials (since that's the only documentation, seemingly).


I wanted to do something with the data once the user had finished 
editting it, so I put this handler in:


--8<-
## CloseFieldEditor placed in data grid script
on CloseFieldEditor pFieldEditor
put the dgColumn of the target into theColumnBeingEdited
## Store UTF8 text
put unidecode(the unicodetext of pFieldEditor, "UTF8") into theNewText

## Save data to database using command I defined
put "Person" into theTable
## Get the unique id of the row in the database we want to edit
put GetDataOfIndex(the dgIndex of me, "id") into theRowID

SaveDataToDatabase theTable, theRowID, theColumnBeingEdited, theNewText

## Update dgData.
## Setting dgDataOfIndex will refresh the data grid display as well 
as update dgData

put the dgDataOfIndex[ the dgIndex of the target] of me into theDataA
put theNewText into theDataA[theColumnBeingEdited]
set the dgDataOfIndex[the dgIndex of the target] of me to theDataA
end CloseFieldEditor
--8<-

Okay, so far so good. After the unidecode I added a line "answer 
theNewText", which happily shows me an alert dialog with the text I 
editted.  This is almost feeling easy.


Then, I was wondering why my data is reverting after editting, and 
noticed the 'SaveDataToDatabase' call.


It's not anywhere.  I performed a 'Find' that should have winkled it out.

If it's not anywhere, then shouldn't it bark when it can't be found?

Just for grins, I put 'qqqxqqq' in the handler just after the 'answer' 
I'd put before.


No error message at all.

Surely an error message of some stripe should be reported, yes?

-Ken

___
use-livecode mailing list
use-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: Trouble with 'there is a'

2012-01-27 Thread Graham Samuel
Thanks to those who replied to point out a gross stupidity on my part - the 
example I gave wasn't a legal LiveCode statement. I was too tired to notice. 
Sorry for the waste of bandwidth. I found the response of the message box 
mysterious but at least I'll recognise it next time.

My real script did have two problem but they were quite different, and might be 
of interest.

1.  I had constructed a Windows-style path with "\" characters to fit in with a 
small VB script I wanted to run. This does work in some contexts, but not in 
this one: in normal circumstances (but not AFAICS in VB scripts) LC looks after 
the change from "/" to "\". I forgot that it was this path in the variable I 
was testing. It gave a strange result, but the obvious answer is "don't do it".

2. The form of my 'if' condition was
  
  if there is not a file myPath &"/" & myfilename

it turns out that the 'there is no' statement doesn't construct the string 
before the evaluation: you have to ensure the evaluation of the string by 
putting it in brackets as in

  if there is not a file (myPath &"/" & myfilename)

There is an obscure warning about this in the dictionary: "The there is no 
operator is implemented internally as a function, and therefore has lower 
precedence than other operators". So it's a precedence issue.

Graham

I wrote
> I'm  using LS 5.0.2. on Windows XP (OK, running under Parallels on a Mac). 
> I'm getting unexpected results from the 'there is..' series of 
> functions/commands - the dictionary says they're implemented as functions, 
> which I can understand.
> 
> As a very simple test, in the message box I put:
> 
>   put (if there is a folder (the defaultFolder))
> 
> expecting to get 'true'. Instead I get the totally unexpected result:
> 
>   161,426,1,return (if there is a folder (the defaultFolder))
> 
> I suppose it's my fault, but what does this mean? Just to be clear, 'the 
> default folder' does have a value - it's:
> 
>  C:/Program Files/RunRev/LiveCode 5.0.2
> 
> Puzzled
> 
> 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