Nice. Don't forget to reset the templatestack.

-- Peter

Peter M. Brigham
[email protected]
http://home.comcast.net/~pmbrig

On Aug 25, 2014, at 3:49 PM, Mark Schonewille wrote:

> John,
> 
> Here's my complete solution:
> 
> on mouseUp
>     put item 1 of the screenLoc & comma &  round(item 2 of the screenLoc / 3) 
> into myLoc
>     askAt "Hello","Write something",myLoc
>     if it is not empty then
>          answerAt "You wrote:" && the result,myLoc,"Yep","Nope"
>     end if
>     put the result
> end mouseUp
> 
> on answerAt theMessage,theLoc
>     put "answer information" && quote & theMessage & quote && "with" & space 
> into myScript
>     if the paramCount is 2 then
>          put quote & "OK" & quote after myScript
>     else
>          put quote & param(3) & quote after myScript
>          repeat with x = 4 to the paramCount
>               put space & "or" && quote & param(x) & quote after myScript
>          end repeat
>     end if
>     set the loc of the templateStack to theLoc
>     set the vis of the templateStack to false
>     create stack "Place Holder"
>     set the defaultStack to "Place Holder"
>     do myScript
>     delete stack "Place Holder"
>     return it
> end answerAt
> 
> on askAt theMessage,theDefault,theLoc
>     put "ask question" && quote & theMessage & quote && "with" && quote & 
> theDefault & quote into myScript
>     set the loc of the templateStack to theLoc
>     set the vis of the templateStack to false
>     create stack "Place Holder"
>     set the defaultStack to "Place Holder"
>     do myScript
>     delete stack "Place Holder"
>     return it
> end askAt
> 
> The advantage of this approach is that it only depends on the ask and answer 
> stacks and still works if the lockMessages has been set to true. It would 
> need some adjustments if you want to use unicode or HTML.
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> KvK: 50277553
> 
> Installer Maker for LiveCode:
> http://qery.us/468
> 
> Buy my new book "Programming LiveCode for the Real Beginner" 
> http://qery.us/3fi
> 
> LiveCode on Facebook:
> https://www.facebook.com/groups/runrev/
> 
> On 8/23/2014 13:07, Mark Schonewille wrote:
>> Hi John,
>> 
>> No, but that should be easy. There are several ways to do this. For example, 
>> create an invisible stack, set its location to the location where you want 
>> the answer dialog. Set the defaultStack to this stack and execute the ask or 
>> answer command. There may be more elegant ways.
>> 
>> set the topleft of the templateStack to 0,32
>> set the vis of the templateStack to false
>> create stack "place holder"
>> set the defaultStack to it
>> answer "bla"
>> put it into myAnswer
>> delete stack Place Holder"
>> 
>> This should work on windows and probably also on Mac, but on Mac I almost 
>> always use ask/answer as sheet.
>> 
>> --
>> Kind regards,
>> 
>> Mark Schonewille
>> Economy-x-Talk
>> Http://economy-x-talk.com
>> 
>> Share the clipboard of your computer over a local network with Clipboard 
>> Link http://clipboardlink.economy-x-talk.com
>> 
>> 
>> Op 23 aug. 2014 om 02:50 heeft JB <[email protected]> het volgende 
>> geschreven:
>> 
>>> Hi Mark,
>>> 
>>> Will that let you position the ask and answer dialogs?
>>> 
>>> John Balgenorth
>>> 
>>> 
> 
> 
> _______________________________________________
> use-livecode mailing list
> [email protected]
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


_______________________________________________
use-livecode mailing list
[email protected]
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode

Reply via email to