Re: Deriving an angle from three points

2009-12-15 Thread Phil Davis
I never took trig, but I imagine some of Rev's trig functions might be 
helpful in determining this. If it's any help, here's a button handler 
that draws the angle:


on mouseUp
   put "40,116/98,186/132,118" into tPointsList
   replace "/" with cr in tPointsList
   set the style of the templateGraphic to "polygon"
   set the lineSize of the templateGraphic to 1
   set the showBorder of the templateGraphic to true -- to show the grc 
edge

   create grc "angle"
   set the points of grc "angle" to tPointsList
end mouseUp

When I draw it, I see there is a right angle at the bottomRight of it 
that might serve as a reference point of some sort? Of course a real 
numbers person wouldn't need to draw anything to "see" this. It would be 
,.


I'll be interested to see the solution too.

Phil Davis



On 12/15/09 10:21 PM, Mark Swindell wrote:

40,116
98,186
132,118

How would one determine the angle created from three points, such as those 
above?

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

   


--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

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


Re: Deriving an angle from three points

2009-12-15 Thread Mark Wieder
Mark-

Tuesday, December 15, 2009, 10:21:47 PM, you wrote:

> 40,116
> 98,186
> 132,118

> How would one determine the angle created from three points, such as those 
> above?

There are three angles. Which one are you interested in?

-- 
-Mark Wieder
 mwie...@ahsoftware.net

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


Deriving an angle from three points

2009-12-15 Thread Mark Swindell
40,116
98,186
132,118

How would one determine the angle created from three points, such as those 
above?

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


Re: Saving standalone substacks

2009-12-15 Thread Kay C Lan
You might try here:

http://revjournal.com/tutorials/saving_data_in_revolution.html

HTH

On Wed, Dec 16, 2009 at 1:05 PM, James Hurley wrote:

> Is there a tutorial someplace on saving data in the standalone substacks?
>
> Jim Hurley
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: regex/HTMLText question

2009-12-15 Thread Kay C Lan
On Wed, Dec 16, 2009 at 5:44 AM, Jim Ault  wrote:

> Caution: wordoffset, replace, regEx
> You need to decide what constitutes a word.
> In Rev,
> ending ending. ending, ending?  ending!   ending)   ending]   ending"
> ending's   ending=  (ending)
> are all words, so the last word in a phrase or sentence cannot be matched
> by wordoffset without a bit of rule checking for punctuation.
>
> Chris,

One way around this is to use token rather than word, look it up in the Rev
Dictionary.

You need to read it a couple of times and unfortunately it's slightly
erroneous in that some characters, like %, is also a token but not listed in
the first group. But if you experiment a bit you'll find that in all the
examples above only: including ending; ending:

ending. (period)
ending?
and the single instance of a double quote (everything after it
disappears)

are the only ones to cause you problems. Also as eluded to in the
Dictionary, anything between a pair of double quotes is a single token, so
"this is the ending, almost" will appear to Rev as a single token.

So certainly not without it's own pitfalls, but with token there are far
less punctuation characters you have to deal with compared to using word.

NOTE the Note in the Rev Dictionary entry for token. If this is for a
commercial app then maybe token isn't something you should be working with
as it's clearly designed by the Rev team purely to work with the Rev
language, and I suppose subject to change. On the other hand, if you're
writing something one off, I'd go for it.

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


Re: Newbie Data Grid question

2009-12-15 Thread Trevor DeVore

On Dec 16, 2009, at 12:04 AM, James Hurley wrote:

It's okay, the Data Grid likes to be beta up on once and a while :-)


As long as this is still in Beta, may I make a suggestion?


Sorry, that was supposed to be "beat" not "beta".

(Does anyone ever let the possibility of the answer be "no" stop  
them?)

I had assumed when I saw the following code in the guide:

  put field "data" into tData
  put true into pFirstLineContainsHeaders
  set the dgText [ pFirstLineContainsHeaders ] of group "DataGrid 2"  
to tData


I assumed that  the data grid would function in much the same way  
that FileMaker does when importing an Excel file, i.e. it allows one  
to assign the items in the first line of the file to field names and  
the rest of the llines to populate these fields. That would be a  
reasonable behavior of "dgText[pFirstLineContainsHeaders]" il.e.  
when the parameter is true, the column headings are taken from the  
first line of the text field and the rest go into filling the columns.


The first line is only used to tell the data grid which columns to map  
the rest of the data to. If you want to create columns then you will  
need to set the dgProp["columns"] property.


You can't really use multiple parameters when using setProp (which is  
what dgText is). I'm kind of fudging things a bit by treating dgText  
as a custom property set and pFirstLineContainsHeaders as the custom  
property. The truth is we still don't have access to a very expressive  
syntax when creating custom controls (which the Data Grid is one).


--
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Releasable Revolution Resources for Developers: 
http://revolution.bluemangolearning.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Saving standalone substacks

2009-12-15 Thread James Hurley
Is there a tutorial someplace on saving data in the standalone  
substacks?


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


Re: Newbie Data Grid question

2009-12-15 Thread James Hurley


Message: 2
Date: Mon, 14 Dec 2009 13:19:43 -0500
From: Trevor DeVore 
Subject: Re: Newbie Data Grid question
To: How to use Revolution 
Message-ID: <2489afec-40f1-4057-88dd-e8fa53559...@mangomultimedia.com>
Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes

On Dec 14, 2009, at 1:11 PM, James Hurley wrote:


It is heartening to see something defended by its parent. My sincere
apologies for treating your offspring in such a quick and dirty
fashion :-)


It's okay, the Data Grid likes to be beta up on once and a while :-)


As long as this is still in Beta, may I make a suggestion?
(Does anyone ever let the possibility of the answer be "no" stop them?)
I had assumed when I saw the following code in the guide:

   put field "data" into tData
   put true into pFirstLineContainsHeaders
   set the dgText [ pFirstLineContainsHeaders ] of group "DataGrid 2"  
to tData


I assumed that  the data grid would function in much the same way that  
FileMaker does when importing an Excel file, i.e. it allows one to  
assign the items in the first line of the file to field names and the  
rest of the llines to populate these fields. That would be a  
reasonable behavior of "dgText[pFirstLineContainsHeaders]" il.e. when  
the parameter is true, the column headings are taken from the first  
line of the text field and the rest go into filling the columns.


Or maybe introduce a second parameter to dgText .


Jim Hurley

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


Re: Newbie Data Grid question

2009-12-15 Thread stephen barncard
>
> One bit of confusion for me is that there is no dgText property set visible
> here.  The syntax


probably a setprop handler.

-
Stephen Barncard
San Francisco
http://houseofcubes.com/disco.irev


2009/12/15 Jim Ault 

> One valuable technique for understanding the DataGrid inner workings.
>
> In Rev, choose the pointer tool, click on a data grid, then go the
> inspector, choose 'custom properties' from the drop down,
>
> and now check out the property sets.  You should see dgProps and dgCache
> Note all the properties that have been created when the data grid was
> created.
> Of course you can edit the values here, but you can also change them in
> script lines.
>
> One bit of confusion for me is that there is no dgText property set visible
> here.  The syntax
>
> set the dgText [ true ] of group "DataGrid"  to tHeaders
>
> would logically mean that there would be a custom property set "dgText"
>
> Interesting if you click on dgProps "row template" you will see:
> group id 1011 of card id 1010 of stack "Data Grid Templates 1260751174078"
>
> ...at least in my version of Rev 3.5
>
> Hope this helps in your travels.
>
> Jim Ault
> Las Vegas
>
>
>
>
> On Dec 15, 2009, at 3:18 AM, Andre.Bisseret wrote:
>
>  Bonjour Jim, Trevor and others on this thread ;-)
>>
>> Le 14 déc. 09 à 19:11, James Hurley a écrit :
>> ...
>>
>>>
>>> Trevor (and Andre.Bisseret),
>>>
>>> Thanks you for the very thoughtful reply(s).
>>>
>>> It is heartening to see something defended by its parent. My sincere
>>> apologies for treating your offspring in such a quick and dirty fashion :-)
>>> I'm sure I will appreciate the richness  of this new Run Rev object in
>>> time--see below.
>>>
>>> FIrst to satisfy my quick and dirty needs, I find that the following
>>> works well to get data displayed in a data grid field:
>>>
>>> on mouseUp
>>>  put field "data" into tData --Tab delimited text
>>>  --The first line of tData contains the column names
>>>  put line 1 of tData into tHeaders
>>>  replace tab with cr in tHeaders
>>>  set dgProp["Columns"] of group "DataGrid"  to tHeaders --Thanks to Andre
>>> for this line.
>>>  set the dgText [ true ] of group "DataGrid" to tData
>>> end mouseUp
>>>
>>>  Your handler above, confirmed by Trevoir, helped me a lot to understand
>> the possible uses of pFirstLineContainsHeaders.
>> In order to learn more about data grid, I tried several variations, I put
>> below in case it could interest someone :
>>
>> local tData,tHeaders,
>> -- field "data" = lines of tab delimited text -- a Data Grid "DataGrid"
>> with 3 columns
>> 
>>
>> -- 1 ) IF THE LINE OF HEADERS IS NOT INCLUDED IN THE DATA (AS I AM
>> ACCUSTOMED TO)
>> -- 1.1) WITHOUT USING pFirstLineContainsHeaders; WORKS:
>> on mouseUp
>>  put "header1" & cr & "header2" & cr & "header3" into tHeaders
>>  set the dgProp["columns"] of grp "DataGrid" to tHeaders
>>  put fld "data" into tData
>>  set the dgText of group "DataGrid" to tData
>> end mouseUp
>>
>> -- 1.2) USING pFirstLineContainsHeaders: USELESS BUT WORKS :-)))
>>  on mouseUp
>>  put "header1" & cr & "header2" & cr & "header3" into tHeaders
>>  set the dgProp["columns"] of grp "DataGrid" to tHeaders
>>  put fld "data" into tData
>>  set the dgText[false] of group "DataGrid" to tData
>> end mouseUp
>>
>> -- 2) IF,  FOR SOME REASON, THE LINE OF HEADERS IS INCLUDED IN THE DATA
>> (FIRST LINE)
>> -- 2.1) WITHOUT USING pFirstLineContainsHeaders: WORKS:
>> on mouseUp
>>  put field "data" into tData
>>  put line 1 of tData into tHeaders
>>  replace tab with cr in tHeaders
>>  set dgProp["Columns"] of group "DataGrid"  to tHeaders
>>  delete line 1 of tData
>>  set the dgText of group "DataGrid" to tData
>> end mouseUp
>>
>> -- 2.2) USING  pFirstLineContainsHeaders: WORKS:
>> on mouseUp -- the handler from Jim
>>  put field "data" into tData
>>  put line 1 of tData into tHeaders
>>  replace tab with cr in tHeaders
>>  set dgProp["Columns"] of group "DataGrid"  to tHeaders --Thanks to Andre
>> for this line.
>>  set the dgText [ true ] of group "DataGrid" to tData
>> end mouseUp
>> -
>> --   indeed, in all these handlers, it's possible to directly set the
>> dgText of grp "datagrid" to fld "data" (but less fast, I guess, specially if
>> it contains a lot of lines)
>> --
>> AS FOR THE SYNTAX OF pFirstLineContainsHeaders
>> OK: set the dgText[true]
>> nevertheless:
>> put true into pFirstLineContainsHeaders
>> set the dgText[pFirstLineContainsHeaders] of grp "datagrid" to true
>> works as well, but useless, OK :-)
>>
>> set the pFirstLineContainsHeaders of grp "datagrid" to true does not work
>> as that is creating a custom prop; OK :-))
>>
>> I am a bit slow-witted but I am beginning to understand quite what this
>> pFirstLineContainsHeaders can do ;-o)
>>
>> Thanks to both of you,
>>
>> André
>>
>
>
>
> ___
> use-revolution m

Re: type font size in dictionary

2009-12-15 Thread Kay C Lan
2009/12/15 Björnke von Gierke 

>
> The easier way is, to use my bvg docu stack, where you can set text sizes
> in the settings:
>
> http://bjoernke.com/?target=bvgdocu
>
>  Does this incorporate the User Contributed Notes? - They're slowly growing
and important to an occasional programmer like me!
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: HTMLText question

2009-12-15 Thread Kay C Lan
Craig,

one further observation. If the field already contains formatted text, ie
bold or coloured, doing what you are doing would set everything back to
plain text except for word 2 so in most cases (but I accept not all) you'd
want to do deal with htmlText exclusively:

put the htmlText of fld "myField" into tHtml --not the plain text
replace "" with "" in line 2 of  tHtml
replace "" with "" in line 2 of tHtml
set the htmlText of fld "myField to tHtml

Of course one case where you would one to swap from one to the other is if
you want to strip HTML tags. Set the htmlText of a field to a html file,
then put the field into a Var, most of the html is then nicely stripped for
you :-)

HTH

On Wed, Dec 16, 2009 at 4:47 AM, Devin Asay  wrote:

> Two problems: only fields have the htmlText property (as Jerry mentioned),
> and you're mixing literals and an expression. Try:
>
> get fld "myField"
> put "" & word 2 of it & "" into word 2 of it
> set the htmlText of fld "myField" to it
>
>
> Devin
>
> Devin Asay
> Humanities Technology and Research Support Center
> Brigham Young University
>
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Newbie Data Grid question

2009-12-15 Thread Jim Ault

One valuable technique for understanding the DataGrid inner workings.

In Rev, choose the pointer tool, click on a data grid, then go the  
inspector, choose 'custom properties' from the drop down,


and now check out the property sets.  You should see dgProps and dgCache
Note all the properties that have been created when the data grid was  
created.
Of course you can edit the values here, but you can also change them  
in script lines.


One bit of confusion for me is that there is no dgText property set  
visible here.  The syntax


set the dgText [ true ] of group "DataGrid"  to tHeaders

would logically mean that there would be a custom property set "dgText"

Interesting if you click on dgProps "row template" you will see:
group id 1011 of card id 1010 of stack "Data Grid Templates  
1260751174078"


...at least in my version of Rev 3.5

Hope this helps in your travels.

Jim Ault
Las Vegas



On Dec 15, 2009, at 3:18 AM, Andre.Bisseret wrote:


Bonjour Jim, Trevor and others on this thread ;-)

Le 14 déc. 09 à 19:11, James Hurley a écrit :
...


Trevor (and Andre.Bisseret),

Thanks you for the very thoughtful reply(s).

It is heartening to see something defended by its parent. My  
sincere apologies for treating your offspring in such a quick and  
dirty fashion :-)
I'm sure I will appreciate the richness  of this new Run Rev object  
in time--see below.


FIrst to satisfy my quick and dirty needs, I find that the  
following works well to get data displayed in a data grid field:


on mouseUp
 put field "data" into tData --Tab delimited text
 --The first line of tData contains the column names
 put line 1 of tData into tHeaders
 replace tab with cr in tHeaders
 set dgProp["Columns"] of group "DataGrid"  to tHeaders --Thanks to  
Andre for this line.

 set the dgText [ true ] of group "DataGrid" to tData
end mouseUp

Your handler above, confirmed by Trevoir, helped me a lot to  
understand the possible uses of pFirstLineContainsHeaders.
In order to learn more about data grid, I tried several variations,  
I put below in case it could interest someone :


local tData,tHeaders,
-- field "data" = lines of tab delimited text -- a Data Grid  
"DataGrid" with 3 columns



-- 1 ) IF THE LINE OF HEADERS IS NOT INCLUDED IN THE DATA (AS I AM  
ACCUSTOMED TO)

-- 1.1) WITHOUT USING pFirstLineContainsHeaders; WORKS:
on mouseUp
  put "header1" & cr & "header2" & cr & "header3" into tHeaders
  set the dgProp["columns"] of grp "DataGrid" to tHeaders
  put fld "data" into tData
  set the dgText of group "DataGrid" to tData
end mouseUp

-- 1.2) USING pFirstLineContainsHeaders: USELESS BUT WORKS :-)))
  on mouseUp
  put "header1" & cr & "header2" & cr & "header3" into tHeaders
  set the dgProp["columns"] of grp "DataGrid" to tHeaders
  put fld "data" into tData
  set the dgText[false] of group "DataGrid" to tData
end mouseUp

-- 2) IF,  FOR SOME REASON, THE LINE OF HEADERS IS INCLUDED IN THE  
DATA (FIRST LINE)

-- 2.1) WITHOUT USING pFirstLineContainsHeaders: WORKS:
on mouseUp
  put field "data" into tData
  put line 1 of tData into tHeaders
  replace tab with cr in tHeaders
  set dgProp["Columns"] of group "DataGrid"  to tHeaders
  delete line 1 of tData
  set the dgText of group "DataGrid" to tData
end mouseUp

-- 2.2) USING  pFirstLineContainsHeaders: WORKS:
on mouseUp -- the handler from Jim
  put field "data" into tData
  put line 1 of tData into tHeaders
  replace tab with cr in tHeaders
  set dgProp["Columns"] of group "DataGrid"  to tHeaders --Thanks to  
Andre for this line.

  set the dgText [ true ] of group "DataGrid" to tData
end mouseUp
-
--   indeed, in all these handlers, it's possible to directly set  
the dgText of grp "datagrid" to fld "data" (but less fast, I guess,  
specially if it contains a lot of lines)

--
AS FOR THE SYNTAX OF pFirstLineContainsHeaders
OK: set the dgText[true]
nevertheless:
put true into pFirstLineContainsHeaders
set the dgText[pFirstLineContainsHeaders] of grp "datagrid" to true
works as well, but useless, OK :-)

set the pFirstLineContainsHeaders of grp "datagrid" to true does not  
work as that is creating a custom prop; OK :-))


I am a bit slow-witted but I am beginning to understand quite what  
this pFirstLineContainsHeaders can do ;-o)


Thanks to both of you,

André




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


Re: interrupting a repeat loop

2009-12-15 Thread Kee Nethery
>> 
>> 2009/12/15 Tim Selander 
>> 
>> Is there any way in RR to check for user input during a repeat loop? I'd
>>> like a loop to continue until the user types a certain key -- at which point
>>> the script would exit the handler.


In my code I have this sprinkled throughout all the repeat loops.

if the optionkey is down then
   exit repeat
end if

Then if I hold down on the option key, it drops out of that repeat loop. I 
sprinkle these within each repeat loop so that it drops out of whatever long 
process I started.

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


Re: Shortcut for resizing a selected object ?

2009-12-15 Thread Richard Gaskin

zryip wrote:


In fact I'm in editing mode with the edit tool when I tried to resize a
button with arrow keys. It's an old (may be bad) habit that I have to resize
objects with arrow keys. I find it more convenient.
When I edit objects it seems that the Message Watcher doesn't receive a
arrowkey message but a rawkeydown/up message.


I use this feature in Fireworks and other tools that let you select a 
single bounds handle, but how would this work in Rev (or HC for that 
matter, since it used the "marching ants" marquee to indicate selection)?


--
 Richard Gaskin
 Fourth World
 Rev training and consulting: http://www.fourthworld.com
 Webzine for Rev developers: http://www.revjournal.com
 revJournal blog: http://revjournal.com/blog.irv
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: interrupting a repeat loop

2009-12-15 Thread Alex Tweedly

Andre Garzia wrote:

Hi Folks,

this been answered in many ways already but I thought I'd chime in and try
to answer it in a different way. The key is to think of reusable code, every
now and them we keep rewritting the same pieces over and over again. How do
we create a generic thing that will:

1) Run some code in a loop
2) Enable us to stop this execution when something happen

If speed is not the main issue here, then we can approach this with a more
flexible way by creating a group of functions that will enable a generic
handler to be executed until something else make it stop. We will use the
new dispatch calls for that.

command iterate pHandlerToLoop, pHandlerThatInterrupts
   dispatch pHandlerThatInterrupts
   if the result is true then
  dispatch pHandlerToLoop
  if the result is true then
 dispatch iterate with pHandlerToLoop, pHandlerThatInterrupts
  end if
   end if
end iterate

This code will first call a command to check if the loop should be executed,
this command should return true or false. If it is true then it will call
the loop command once and if the loop command returned true, it will call
itself again. This code will loop and will exit the loop if any of two
things happen, the command that interrupts return false or the command that
loops return false, for example, let us count to ten using this code:

  

Nice. But as George said, you will hit recursion limits.

And the dispatch to iterate (i.e. to itself) is a simple tail recursion 
- which you can eliminate easily.


AFAICT, this is equivalent and has no recursion issues.

command iterate pHandlerToLoop, pHandlerThatInterrupts
   repeat forever
  dispatch pHandlerThatInterrupts
  if the result is false then exit iterate
  dispatch pHandlerToLoop
  if the result is false then exit iterate
   end repeat
end iterate



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


Re: regex/HTMLText question

2009-12-15 Thread zryip theSlug
Hi Chris,

As said by Jim Ault, I think that you have first to decide the list of whole
word forms you accept.
"space&use&space";"use&comma","use&dot"
=> " use ","use,","use.",".use",".use."...
Once your list prepared, substitute your word by a key that you will replace
at the fly by a word to search.
=> "  ",",",".",".",".."...

Then in a loop treats the different cases with the solution of Craig Newman
likes this:

repeat with aWord in wordList
repeat with aRegex in regexList
put replaceText(aRegex,"",aWord) into wholeWordForm -- replace
the "" key in your pattern by the word that you need
get fld "yourField"
replace wholeWordForm with "" & wholeWordForm & "" in it
end repeat
end repeat

set the htmltext of fld "yourField" to it

This is a first approach because it encloses the word with its possible
punctuation.


-Zryip TheSlug- wish you the best ! 8)


2009/12/15 Chris Sheffield 

> Thanks, Craig. Unfortunately, this doesn't quite work either. If I were to
> run:
>
> replace "use" with "use
> It would not only replace the whole word "use", but also the string "use"
> in the word "used", so I would end up with something like "used",
> which is not the desired result.
>
>
> On Dec 15, 2009, at 1:56 PM, dunb...@aol.com wrote:
>
> > Right, thanks to all.
> >
> > Chris', your original regex question could better be addressed by:
> >
> > on mouseup
> >get fld "yourField"
> >replace yourtext with "" & yourtext & "" in it
> >set the htmltext of fld "yourField" to it
> > end mouseup
> >
> > This would be fast, and easily extendable, since we are just crunching
> > data.
> >
> > Not that there isn't a good regex solution as well...
> >
> > Craig Newman
> > ___
> > use-revolution mailing list
> > use-revolution@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-revolution
>
> --
> Chris Sheffield
> Read Naturally, Inc.
> www.readnaturally.com
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: VS: How do I construct a scroll bar for stack larger than screen

2009-12-15 Thread Scott Rossi
Recently, Kresten Bjerg wrote:

> I have tried to follow them, but am approaching the view, that it cannot
> be done.
> 
> Which is a shame, because the users of the cheap mini-notebooks would be
> a most relevant target group
> 
>  It is a most unusual context : A stack, where the stacksize is 3072 x
> 2304  =  9  different 1024x768 windows,
> 
> which ideally should each have a vscrollbar.

Kresten, to clarify what you want, are you trying to create 9 separate
scrolling windows on the desktop, or do you want 9 separate scrolling
regions in one window?

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design


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


VS: How do I construct a scroll bar for stack larger than screen

2009-12-15 Thread Kresten Bjerg
Thank you for good advices. 

I have tried to follow them, but am approaching the view, that it cannot
be done.

Which is a shame, because the users of the cheap mini-notebooks would be
a most relevant target group

 It is a most unusual context : A stack, where the stacksize is 3072 x
2304  =  9  different 1024x768 windows,  

which ideally should each have a vscrollbar. 

When I select and group all objects in the first window the
resultant group on inspection defines the size of itself as 

...32162 x 32113..(where it should be 1024x768)  and location 16081 x
16037 ( where it should be  0,0,1024,768) !? 

  and in spite of group inspector indicates vertical scroll  visible, no
such scroll appears in the application browser, nor can it be found. 

 In one attempt somehow a "scrollbar1" appeared in the application
browser, but was fixed at the layer I think 782,

 and resisted all attempts at raising it to a higher layer, to ensure
its visibility. 

I guess part of the problem is that the number of layers has reached
1364, and the number of more or less overlapping groups 

(difficult to identify - several  may be unnecessary mistakes )-
allready is  approximately 183.)

Maybe I should add, that the oversize stack is a substack (meaning that
it can be user-modified in standalones.)

 

(I have previously  placed the former  version, -  in rev
user spaces- under my name: Kresten.

If someone could be persuaded to test, whether my endeavour 

(to adapt the application for use on mini-notebooks  with a 1024 x 600
screen)

 is impossible, and better should be  given up, I will of course be
happy to mail or upload the latest version).

Kresten

 

 



 

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


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread J. Landman Gay

D.Coker wrote:

In RevOnline (in Rev's toolbar) search for the "MetaCard Setup"
stack. This will download the latest MC IDE and set it up with your
(licensed) Rev engine, ready to go. It's all one click.


Again I'll say thanks! It works like a charm and everything is just
as I remember it. About all I can see that is missing is the demo
stack with the "cute 'lil pink elephant". ;-)


Have a few drinks, it'll all come back.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Control Browser

2009-12-15 Thread J. Landman Gay

Richmond Mathewson wrote:

Of course, nasty "I want the best of both worlds" types, like me . . .  :)

hive-off the MC Control Browser, open it up in RunRev, muck around
with the scripts a bit and pop it into the RunRev plug-ins folder.

Go on, Jacque, smack me!


Not at all. I did something similar once with the script profiler. I'm 
mostly impressed that you downloaded the setup and five minutes later 
had the stack moved.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread D.Coker
>In RevOnline (in Rev's toolbar) search for the "MetaCard Setup" stack.
>This will download the latest MC IDE and set it up with your (licensed)
>Rev engine, ready to go. It's all one click.

Again I'll say thanks!
It works like a charm and everything is just as I remember it. About all I can 
see that is missing is the demo stack with the "cute 'lil pink elephant". ;-)

It will be perfect for a whole lot of the simple stuff I do for myself.

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


Re: Shortcut for resizing a selected object ?

2009-12-15 Thread zryip theSlug
Hi all,

Oups ! It seems that my original message was too long ! 8)

> Doesn't trapping the arrowKey message, also supported in HC, do what you
> want?

> Craig Newman

In fact I'm in editing mode with the edit tool when I tried to resize a
button with arrow keys. It's an old (may be bad) habit that I have to resize
objects with arrow keys. I find it more convenient.
When I edit objects it seems that the Message Watcher doesn't receive a
arrowkey message but a rawkeydown/up message.


> Zryip

> Welcome to the us list. I believe there are some tutorials on the
> runRev site for HC users to make the leap. I think unless someone has
> a tool already you may have to roll your own for this one. But be
> prepared to be pleasantly surprised by a lot of what rev has to offer.
> There are so many directions you can take now it is hard to look at
> just one thing to be impressed by.

> Glad to have you here

> Tom McGrath III
> Lazy River Software
> 3mcgr...@comcast.net

Thank you for your welcome Tom ! 8)
It was maybe 6 or 7 years that I have not open my old friend HC but when I'm
using Revolution all my mind is boiling like the good old days. 8)
Too many things to discover, too many things to do, too many thing to share.
I'm so excited that I don't know where to start. 8)

If someone is interested by a solution, I could send it off list (it was
included on my original and definitively too long message never posted) 8)

- Zryip TheSlug - wish you the best ! 8)
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Control Browser

2009-12-15 Thread Richmond Mathewson

Of course, nasty "I want the best of both worlds" types, like me . . .  :)

hive-off the MC Control Browser, open it up in RunRev, muck around
with the scripts a bit and pop it into the RunRev plug-ins folder.

Go on, Jacque, smack me!
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: regex/HTMLText question

2009-12-15 Thread Peter Brigham MD

Ah, you want to exclude parts of words. Try this:

function wordOffsets str,cntr,wholeWords
   if wholeWords = empty then put true into wholeWords
   -- or you could default to false if you want
   put offsets(str, cntr) into charList
   -- assumes you have the offsets() function to draw on
   -- see my previous email
   if charList = "0" then return "0"
   put the number of items of charList into nbr
   put "" into oList
   repeat for each item n in charList
  if wholeWords and word n of cntr <> str then next repeat
  put the number of words of (char 1 to n of ctr) & "," after oList
   end repeat
   if char -1 of oList = "," then delete char -1 of oList
   return oList
end wordOffsets

This will still be extremely fast unless you're processing megabytes  
of text.


-- Peter

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



On Dec 15, 2009, at 5:27 PM, Chris Sheffield wrote:

Thanks, Craig. Unfortunately, this doesn't quite work either. If I  
were to run:


replace "use" with "useIt would not only replace the whole word "use", but also the string  
"use" in the word "used", so I would end up with something like  
"used", which is not the desired result.



On Dec 15, 2009, at 1:56 PM, dunb...@aol.com wrote:


Right, thanks to all.

Chris', your original regex question could better be addressed by:

on mouseup
  get fld "yourField"
  replace yourtext with "" & yourtext & "" in it
  set the htmltext of fld "yourField" to it
end mouseup

This would be fast, and easily extendable, since we are just  
crunching

data.

Not that there isn't a good regex solution as well...

Craig Newman
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


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

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

http://lists.runrev.com/mailman/listinfo/use-revolution


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


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread Richmond Mathewson

On 16/12/2009 00:20, D.Coker wrote:
   

In RevOnline (in Rev's toolbar) search for the "MetaCard Setup" stack.
This will download the latest MC IDE and set it up with your (licensed)
Rev engine, ready to go. It's all one click.
 

Cool beans... I'll give it a try.

Thank you Jacque!
___
   


Wow! Thanks Jacque! Wish everything went that smoothly.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: interrupting a repeat loop

2009-12-15 Thread zryip theSlug
2009/12/15 zryip theSlug 

>
>
> 2009/12/15 Tim Selander 
>
> Is there any way in RR to check for user input during a repeat loop? I'd
>> like a loop to continue until the user types a certain key -- at which point
>> the script would exit the handler.
>>
>> Tim Selander
>> Tokyo, Japan
>> ___
>> use-revolution mailing list
>> use-revolution@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
Hi again,

In my previous solution I proposed this loop :

*repeat* until charToNum("s") is in the keysDown

However, the use of "is in" to test the presence of a number in a list is
risky. Because for example, "122" may be in "1222,256"

So to prevent bugs prefers this handler to my previous solution :

 *on* mouseUp

   *put* 0 into fld "Msg"

   *repeat* until charToNum("s") is among the items of the keysDown

  *-- the charToNum function is necessary to compare the key with the
content returned by the keysDown function. The keysDown function returns a
list of keys in ascii form separated by commas.*

  *add* 1 to fld "Msg"

  *wait* 30 ticks

   *end* *repeat*

*end* mouseUp


- Zryip TheSlug - wish you the best ! 8)

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


Re: regex/HTMLText question

2009-12-15 Thread dunbarx

In a message dated 12/15/09 5:27:40 PM, cmsheffi...@gmail.com writes:

Chris.

True enough. Sometimes one can be too clever.

You can always go back to my little repeat loop.

Craig Newman

> Thanks, Craig. Unfortunately, this doesn't quite work either. If I were 
> to run:
> 
> replace "use" with "use 
> It would not only replace the whole word "use", but also the string "use" 
> in the word "used", so I would end up with something like "use
> d", which is not the desired result.
> 
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: regex question in matchChunk function

2009-12-15 Thread J. Landman Gay

Chris Sheffield wrote:

I am not very familiar with regular expressions, and I'm wondering if
someone more knowledgeable could give me a hint as to how to
accomplish this.

Given a passage of text, I need to find every instance of certain
words within that text and draw a box around them. 


All I can think of is to grab the text block and use a series of 
"replace" commands to replace each punctuation type with a space. That 
should still retain your word boundaries and relative character 
positions. After that, use regex to get the word boundaries. Presumably 
you won't have to box the punctuation.


Ugly, but might work.

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: regex/HTMLText question

2009-12-15 Thread Chris Sheffield
Thanks, Craig. Unfortunately, this doesn't quite work either. If I were to run:

replace "use" with "useused", which 
is not the desired result.


On Dec 15, 2009, at 1:56 PM, dunb...@aol.com wrote:

> Right, thanks to all.
> 
> Chris', your original regex question could better be addressed by:
> 
> on mouseup
>get fld "yourField"
>replace yourtext with "" & yourtext & "" in it
>set the htmltext of fld "yourField" to it
> end mouseup
> 
> This would be fast, and easily extendable, since we are just crunching 
> data.
> 
> Not that there isn't a good regex solution as well...
> 
> Craig Newman
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

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

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


Re: regex question in matchChunk function

2009-12-15 Thread Peter Brigham MD
Here is one way. These are utility functions I use constantly for text  
processing. Offsets(str,cntr) returns a comma-delimited list of all  
the offsets of str in ctnr. Lineoffsets(str,cntr) does the same with  
lineoffsets. Then you can interate over the list of offsets to do  
whatever you want to each instance of str in cntr. I keep them in a  
utility stack that is in the stackinuse, so it is available to all  
stacks. I don't use regex, as I have never gotten the regex syntax to  
stick in my head firmly enough to find it natural, and in any case  
doing it by script turns out to be as fast or faster.


-- Peter

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

-

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

function lineOffsets str,cntr
   -- returns a comma-delimited list of
   -- all the lineoffsets of str in cntr
   put offsets(str,cntr) into charList
   if charList = "0" then return "0"
   put the number of items of charList into nbr
   put "" into mlo
   repeat for each item n in charList
  put the number of lines of (char 1 to n of cntr) \
   & "," after oList
   end repeat
   if char -1 of oList = "," then delete char -1 of oList
   return oList
end lineOffsets

-

On Dec 15, 2009, at 1:46 PM, Chris Sheffield wrote:

I am not very familiar with regular expressions, and I'm wondering  
if someone more knowledgeable could give me a hint as to how to  
accomplish this.


Given a passage of text, I need to find every instance of certain  
words within that text and draw a box around them. The box drawing I  
can handle just fine by including "box" in the textStyle of the  
found chunk. But it's finding the instances that I'm struggling  
with. Here is my code. Big warning! This should not be run as is, if  
anyone wants to attempt it. The second repeat will go forever.


repeat for each line tWord in tDiffWords
   repeat until matchChunk(tStoryText, "(?i)\b(" & tWord & ") 
\b", tStartChar, tEndChar) is false


   put the textStyle of char tStartChar to tEndChar of fld  
"StoryText" into tStyle

   if tStyle is empty or tStyle is "plain" then
   put "box" into tStyle
   else
   put comma & "box" after tStyle
   end if
   set the textStyle of char tStartChar to tEndChar of fld  
"StoryText" to tStyle


   end repeat
   end repeat

What I need is some way to use the matchChunk function and continue  
the search where the last search ended. I read through some regex  
documentation and came across "\G", but this doesn't seem to work in  
Rev. But maybe I'm not putting it in the right place in my search  
string.


Can anyone help? Is there a way to do this? Or can someone recommend  
another method of accomplishing the same thing? Keep in mind that  
this needs to search whole words in a story passage, and we're  
dealing with all kinds of punctuation here, including hyphens, em  
dashes, etc.


Thanks,
Chris

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

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

http://lists.runrev.com/mailman/listinfo/use-revolution


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


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread D.Coker

>In RevOnline (in Rev's toolbar) search for the "MetaCard Setup" stack. 
>This will download the latest MC IDE and set it up with your (licensed) 
>Rev engine, ready to go. It's all one click.

Cool beans... I'll give it a try.

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


Re: regex question in matchChunk function

2009-12-15 Thread Chris Sheffield
Thanks, Troy. Unfortunately, offset doesn't quite work for me, as it does not 
honor the wholeMatches property. So I might search for "use", and it would find 
both "use" and "used", which is not the desired result. However, with some 
extra code I could probably make it work (manually checking for punctuation, 
spaces, etc.). Not pretty, but might work.

Thanks again,
Chris

On Dec 15, 2009, at 1:05 PM, Troy Rollins wrote:

> 
> On Dec 15, 2009, at 1:46 PM, Chris Sheffield wrote:
> 
>> Can anyone help? Is there a way to do this? Or can someone recommend another 
>> method of accomplishing the same thing?
> 
> Offset
> 
> --
> Troy
> RPSystems, Ltd.
> http://www.rpsystems.net
> 
> 
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

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

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


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread J. Landman Gay

D.Coker wrote:


I remember trying/using the MC IDE way back before Rev and would like
to have another look for those very reasons expressed. Is there a
place that one can still download it for use with the current version
of Rev?


In RevOnline (in Rev's toolbar) search for the "MetaCard Setup" stack. 
This will download the latest MC IDE and set it up with your (licensed) 
Rev engine, ready to go. It's all one click.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: regex/HTMLText question

2009-12-15 Thread Jim Ault

Caution: wordoffset, replace, regEx
You need to decide what constitutes a word.
In Rev,
ending ending. ending, ending?  ending!   ending)   ending]
ending"   ending's   ending=  (ending)
are all words, so the last word in a phrase or sentence cannot be  
matched by wordoffset without a bit of rule checking for punctuation.


The same will apply to regEx since white space/punctuation rules can  
vary.



On Dec 15, 2009, at 12:56 PM, dunb...@aol.com wrote:


Right, thanks to all.

Chris', your original regex question could better be addressed by:

on mouseup
   get fld "yourField"
   replace yourtext with "" & yourtext & "" in it
   set the htmltext of fld "yourField" to it
end mouseup

This would be fast, and easily extendable, since we are just crunching
data.

Not that there isn't a good regex solution as well...




Jim Ault
Las Vegas



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


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread Andre Garzia
David,

I think they have a Yahoo! group where you can download it but the address
of the group is unknown to me right now.

On Tue, Dec 15, 2009 at 7:15 PM, D.Coker  wrote:

> >Andre Garzia wrote:
> >> What is the control browser? Never seen it...
> >
> >In the MC IDE, choose Control Browser from the Tools menu. You will see
> >a list of objects on the current card. You can quickly change the
> >layering order from there, click a button to edit any object script, or
> >double-click to open the object's property inspector. It's very fast.
>
> I remember trying/using the MC IDE way back before Rev and would like to
> have another look for those very reasons expressed. Is there a place that
> one can still download it for use with the current version of Rev?
>
> Best regards,
> David C.
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread D.Coker
>Andre Garzia wrote:
>> What is the control browser? Never seen it...
>
>In the MC IDE, choose Control Browser from the Tools menu. You will see 
>a list of objects on the current card. You can quickly change the 
>layering order from there, click a button to edit any object script, or 
>double-click to open the object's property inspector. It's very fast.

I remember trying/using the MC IDE way back before Rev and would like to have 
another look for those very reasons expressed. Is there a place that one can 
still download it for use with the current version of Rev?

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


RE: regex/HTMLText question

2009-12-15 Thread dunbarx
Right, thanks to all.

Chris', your original regex question could better be addressed by:

on mouseup
get fld "yourField"
replace yourtext with "" & yourtext & "" in it
set the htmltext of fld "yourField" to it
end mouseup

This would be fast, and easily extendable, since we are just crunching 
data.

Not that there isn't a good regex solution as well...

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


Re: HTMLText question

2009-12-15 Thread Devin Asay


On Dec 15, 2009, at 1:33 PM, dunb...@aol.com wrote:


Can I use the HTMLText property in a variable?

In other words, why does this fail with an error?

on mouseup
   get fld "myField" --has a few words in it
   set the htmlText of word 2 of it to "word 2 of it"
   set the htmltext of fld "myField" to it
end mouseup


Two problems: only fields have the htmlText property (as Jerry  
mentioned), and you're mixing literals and an expression. Try:


get fld "myField"
put "" & word 2 of it & "" into word 2 of it
set the htmlText of fld "myField" to it


Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

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


Re: HTMLText question

2009-12-15 Thread Jerry Daniels

You need a field for setting HTMLtext.

Best,

Jerry Daniels

The latest Rev Editor Video:
http://reveditor.com/feature-friday-manage-your-audio-clips


On Dec 15, 2009, at 2:33 PM, dunb...@aol.com wrote:


Can I use the HTMLText property in a variable?

In other words, why does this fail with an error?

on mouseup
   get fld "myField" --has a few words in it
   set the htmlText of word 2 of it to "word 2 of it"
   set the htmltext of fld "myField" to it
end mouseup

Only field references allowed?

This seems to indicate that only a literal can be used when setting  
the

tags:

on mouseup
   get fld "myField" --has a few words in it
   set the htmlText of word 2 of field "myField" to "word 2 of  
it<

/box>"
end mouseup

You get "word 2 of it", nicely boxed.

Thanks. I am still a newbie.

Craig Newman
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


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


HTMLText question

2009-12-15 Thread dunbarx
Can I use the HTMLText property in a variable?

In other words, why does this fail with an error?

on mouseup
get fld "myField" --has a few words in it
set the htmlText of word 2 of it to "word 2 of it"
set the htmltext of fld "myField" to it
end mouseup

Only field references allowed?

This seems to indicate that only a literal can be used when setting the 
tags:

on mouseup
get fld "myField" --has a few words in it
set the htmlText of word 2 of field "myField" to "word 2 of it<
/box>"
end mouseup

You get "word 2 of it", nicely boxed.

Thanks. I am still a newbie.

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


Re: regex question in matchChunk function

2009-12-15 Thread dunbarx
I am not either. but:

on mouseup
get fld "yourField"
repeat with y = 1 to the number of words in it
   if word y of it = yourtext then set the textstyle of word y of fld   
"yourField" to "box"
end repeat
end mouseup

Now this writes to fld "yourfield" every time it matches. I think if you 
use the "htmltext" you can work in a variable and set the style all at once. 
Faster.

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


Re: regex question in matchChunk function

2009-12-15 Thread Troy Rollins


On Dec 15, 2009, at 1:46 PM, Chris Sheffield wrote:

Can anyone help? Is there a way to do this? Or can someone recommend  
another method of accomplishing the same thing?


Offset

--
Troy
RPSystems, Ltd.
http://www.rpsystems.net


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


Re: interrupting a repeat loop

2009-12-15 Thread zryip theSlug
2009/12/15 Tim Selander 

> Is there any way in RR to check for user input during a repeat loop? I'd
> like a loop to continue until the user types a certain key -- at which point
> the script would exit the handler.
>
> Tim Selander
> Tokyo, Japan
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>


Hi Tim,

Maybe you could use the keysDown function.
This RR function returns the ascii form of the keys pressed while a handler
is being executed.

For example this mouseUp handler add 1 to the fld msg until the key "s" is
pressed :

*on* mouseUp

   *put* 0 into fld "Msg"

   *repeat* until charToNum("s") is in the keysDown

-- the charToNum function is necessary to compare the key with the content
returned by the keysDown function. The keysDown function returns a list of
keys in ascii form separated by commas.

  *add* 1 to fld "Msg"

  *wait* 30 ticks

   *end* *repeat*
*end* mouseUp


Hope this helps.

- Zryip TheSlug - wish you the best 8)
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread J. Landman Gay

Andre Garzia wrote:

What is the control browser? Never seen it...


In the MC IDE, choose Control Browser from the Tools menu. You will see 
a list of objects on the current card. You can quickly change the 
layering order from there, click a button to edit any object script, or 
double-click to open the object's property inspector. It's very fast.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread J. Landman Gay

Wilhelm Sanke wrote:
I do not care too much how the historical icons look, what I care about 
is the functionality of the Metacard IDE. Above all I like the quickly 
accessible "Control Browser", which is my main tool during programming. 


I like MC's control browser too. Sometimes I only want to see what's 
immediately available on a card, not the whole hierarchy of objects and 
stacks. And I really like how I can change the layering order of objects 
so easily in MC, from directly within the browser. Sometimes I do want 
to see everything, so then I look at the stack in Rev. Each IDE has 
advantages/disadvantages.


A couple of things that might make your work in Rev easier:

- You can have open only one script editor at the same time in the Rev 
IDE, the Metacard IDE allows any number of open script editors (which 
simplifies the comparison and editing of scripts)


If you right-click on an editor tab, you can open that script in a new 
window. If you always want new windows and you never want tabs, change 
the option in the Script Editor pane Preferences. That way it acts like MC.




- If you edit a script and close the editor with the close icon - 
instead of the compile button - the tools palette (which disappears when 
you open the script editor) will not re-appear. You have to take a 
detour now to bring back the tools palette, for instance using the 
message box.


Change the option in Prefs that specifies whether to hide palettes when 
opening the editor. This is one of the first things I change whenever I 
set up new prefs. I never want palettes or the message box hidden.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: interrupting a repeat loop

2009-12-15 Thread Mark Wieder
Andre-

Tuesday, December 15, 2009, 11:01:23 AM, you wrote:

> But checking the recursionlimits on the dictionary, I see we can increase it
> by code! :-O So, if you're going to comput something big, then increase
> it!!!

However, note that the default recursionlimit is actually 40, not
the 100 noted in the docs... I thought I had filed a doc bug
against this, but I can't find it, so I'll file it now.

-- 
-Mark Wieder
 mwie...@ahsoftware.net

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


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread Andre Garzia
What is the control browser? Never seen it...

On Tue, Dec 15, 2009 at 5:44 PM, Wilhelm Sanke wrote:

> I do not care too much how the historical icons look, what I care about is
> the functionality of the Metacard IDE. Above all I like the quickly
> accessible "Control Browser", which is my main tool during programming.
> Also: No interference from front- or backscripts in the IDE.
>
> The workflow - for my needs - is fast, and this is not only because I am
> used to the MC IDE.
>
> The Rev IDE has improved considerably and gradually over time. In the
> beginning it was nearly un-usable, especially with stacks that contained a
> larger number of objects, so you had to produce your own tools for specific
> purposes. What I like most of the present Rev IDE is the Dictionary.
>
> Still, there are points that could be improved. A few examples.
>
> - Response speed of the Rev IDE is sometimes slow:
>   When the menubar comes up (on a 3 GHz Windows computer), first a blank
> rectangle is shown, after which menuitems and icons apppear.
>   Opening menus is especially slow with cards that contain many controls.
>
> - You can have open only one script editor at the same time in the Rev IDE,
> the Metacard IDE allows any number of open script editors (which simplifies
> the comparison and editing of scripts)
>
> - If you edit a script and close the editor with the close icon - instead
> of the compile button - the tools palette (which disappears when you open
> the script editor) will not re-appear. You have to take a detour now to
> bring back the tools palette, for instance using the message box.
>
> - Using the Property Inspector, which comes up with a noticable delay, and
> accessing the script needs one step more than in the Metacard IDE. But of
> course, using right-click on an object for getting at script and properties
> is the same in both IDEs.
>
> - Using Rev's Standalone Builder with larger stacks was a nightmare until
> recently (including IDE version 3.5). With some stacks the Standalone
> Builder needed 45 minutes and longer to build the standalone - as opposed to
> one second in the Metacard IDE. Happily this has been fixed now with version
> 4.0, and it should be mentioned that this improvement was initiated and
> supported by a discussion between Oliver Kenyon and Metacard users.-
>
> The group of Metacard IDE users - all of which are Rev Enterprise license
> holders - are naturally interested in the further improvement and
> development of Revolution (both the engine and the IDE) and some group
> members have made valuable contributions to this development. This is not
> only because the Metacard IDE - in the same way as the Rev IDE - needs and
> uses the Revolution engine (which, by the way, originated from the old
> Metacard engine). New Rev features are usually integrated into the Metacard
> IDE, too. At present there is work in progress to adapt the Metacard IDE to
> the new standalone building process of Rev.-
>
> Wilhelm Sanke
> 
>
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Rev IDE vs MetaCard IDE

2009-12-15 Thread Wilhelm Sanke
I do not care too much how the historical icons look, what I care about 
is the functionality of the Metacard IDE. Above all I like the quickly 
accessible "Control Browser", which is my main tool during programming. 
Also: No interference from front- or backscripts in the IDE.


The workflow - for my needs - is fast, and this is not only because I am 
used to the MC IDE.


The Rev IDE has improved considerably and gradually over time. In the 
beginning it was nearly un-usable, especially with stacks that contained 
a larger number of objects, so you had to produce your own tools for 
specific purposes. What I like most of the present Rev IDE is the 
Dictionary.


Still, there are points that could be improved. A few examples.

- Response speed of the Rev IDE is sometimes slow:
   When the menubar comes up (on a 3 GHz Windows computer), first a 
blank rectangle is shown, after which menuitems and icons apppear.

   Opening menus is especially slow with cards that contain many controls.

- You can have open only one script editor at the same time in the Rev 
IDE, the Metacard IDE allows any number of open script editors (which 
simplifies the comparison and editing of scripts)


- If you edit a script and close the editor with the close icon - 
instead of the compile button - the tools palette (which disappears when 
you open the script editor) will not re-appear. You have to take a 
detour now to bring back the tools palette, for instance using the 
message box.


- Using the Property Inspector, which comes up with a noticable delay, 
and accessing the script needs one step more than in the Metacard IDE. 
But of course, using right-click on an object for getting at script and 
properties is the same in both IDEs.


- Using Rev's Standalone Builder with larger stacks was a nightmare 
until recently (including IDE version 3.5). With some stacks the 
Standalone Builder needed 45 minutes and longer to build the standalone 
- as opposed to one second in the Metacard IDE. Happily this has been 
fixed now with version 4.0, and it should be mentioned that this 
improvement was initiated and supported by a discussion between Oliver 
Kenyon and Metacard users.-


The group of Metacard IDE users - all of which are Rev Enterprise 
license holders - are naturally interested in the further improvement 
and development of Revolution (both the engine and the IDE) and some 
group members have made valuable contributions to this development. This 
is not only because the Metacard IDE - in the same way as the Rev IDE - 
needs and uses the Revolution engine (which, by the way, originated from 
the old Metacard engine). New Rev features are usually integrated into 
the Metacard IDE, too. At present there is work in progress to adapt the 
Metacard IDE to the new standalone building process of Rev.-


Wilhelm Sanke


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


Re: How to prevent unlocking the screen

2009-12-15 Thread Jacques Hausser
Andre

Thank you, I solved the problem, and I think it's a generalisable trick if you 
know exactly how to compute the future size of the stack (perhaps a rare 
situation, but it's my case, the stack has only few possible sizes):
1) compute the future size of your stack
2) lock screen
3) compute the future size and position of every objet in the card
4) set their size and position. They will perhaps be outside the present 
window, but it's not a problem since the screen is locked.
5) only after that, set the new stack size.
Works perfectly well (almost) without a flick !

Jacques



Le 15 déc. 2009 à 19:45, Andre Garzia a écrit :

> Jacques,
> 
> try hiding the stack and showing it only when everything happened... it will
> flick on the screen but it might be more pleasant
> 
> On Tue, Dec 15, 2009 at 8:25 AM, Jacques Hausser 
> wrote:
> 
>> Hello everybody,
>> 
>> I want to change the size of a stack:
>> 
>> command changeStackSize
>> lock screen
>> -- (computes and set the new size)
>> end changeStackSize
>> 
>> The problem is that notwithstanding the "lock screen" the change is visible
>> in two steps: first the window size, and then the content. I would like to
>> hide the change till completed. How to do ?
>> Thanks in advance
>> 
>> Jacques
>> 
>> **
>> Prof. Jacques Hausser
>> Department of Ecology and Evolution
>> Biophore / Sorge
>> University of Lausanne
>> CH 1015 Lausanne
>> please use my private address:
>> 6 route de Burtigny
>> CH-1269 Bassins
>> tel/fax:++ 41 22 366 19 40
>> mobile: ++ 41 79 757 05 24
>> E-Mail: jacques.haus...@unil.ch
>> ***
>> 
>> ___
>> use-revolution mailing list
>> use-revolution@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>> 
> 
> 
> 
> -- 
> http://www.andregarzia.com All We Do Is Code.
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

**
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax:++ 41 22 366 19 40
mobile: ++ 41 79 757 05 24
E-Mail: jacques.haus...@unil.ch
***

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


Re: interrupting a repeat loop

2009-12-15 Thread Andre Garzia
Good question george, it depends on the works of dispatch call. Let me try
something here, ok did try it, tried computing some big sums and factorials,
it can reach recursion limit depending on memory usage but I've reached
overflow before reaching recursion limits.

But checking the recursionlimits on the dictionary, I see we can increase it
by code! :-O So, if you're going to comput something big, then increase
it!!!

:D







On Tue, Dec 15, 2009 at 4:52 PM, George C Brackett
wrote:

> Dumb question: could your approach result in too deep a recursion while
> looping some quick code?
>
> George
>
> On Dec 15, 2009, at 1:43 PM, Andre Garzia wrote:
>
> Hi Folks,
>
> this been answered in many ways already but I thought I'd chime in and try
> to answer it in a different way. The key is to think of reusable code,
> every
> now and them we keep rewritting the same pieces over and over again. How do
> we create a generic thing that will:
>
> 1) Run some code in a loop
> 2) Enable us to stop this execution when something happen
>
> If speed is not the main issue here, then we can approach this with a more
> flexible way by creating a group of functions that will enable a generic
> handler to be executed until something else make it stop. We will use the
> new dispatch calls for that.
>
> command iterate pHandlerToLoop, pHandlerThatInterrupts
>  dispatch pHandlerThatInterrupts
>  if the result is true then
> dispatch pHandlerToLoop
> if the result is true then
>dispatch iterate with pHandlerToLoop, pHandlerThatInterrupts
> end if
>  end if
> end iterate
>
> This code will first call a command to check if the loop should be
> executed,
> this command should return true or false. If it is true then it will call
> the loop command once and if the loop command returned true, it will call
> itself again. This code will loop and will exit the loop if any of two
> things happen, the command that interrupts return false or the command that
> loops return false, for example, let us count to ten using this code:
>
> local lCount
>
> on countToTen
>  add 1 to lCount
>  return true
> end countToTen
>
> on isItTenYet
>  if lCount is 10 then
> return false
>  else
> return true
>  end if
> end isItTenYet
>
> on mouseUp mouseButtonNumber
>  iterate "countToTen", "isItTenYet"
>  put lCount
> end mouseup
>
> This has the benefit of splitting the code to be looped from the code that
> says if it should loop more, this way, one could simply change the
> isItTenYet command to something that checks for the key press without
> touching the countToTen function. This code will work for any kind of loop
> and it is nonblocking. You can reuse this for example to create code that
> reads from sockets or anything mathematical that loops until some condition
> is matched.
>
> Instead of using a simple repeat loop with exit conditions and the like
> mixed with the logic that should be looped, this will create some clear
> distinctions which leads to more readable code in my experience. Reusable
> code is your friend!
>
> Cheers
> andre
>
>
> --
> http://www.andregarzia.com All We Do Is Code.
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: interrupting a repeat loop

2009-12-15 Thread George C Brackett
Dumb question: could your approach result in too deep a recursion while looping 
some quick code?

George

On Dec 15, 2009, at 1:43 PM, Andre Garzia wrote:

Hi Folks,

this been answered in many ways already but I thought I'd chime in and try
to answer it in a different way. The key is to think of reusable code, every
now and them we keep rewritting the same pieces over and over again. How do
we create a generic thing that will:

1) Run some code in a loop
2) Enable us to stop this execution when something happen

If speed is not the main issue here, then we can approach this with a more
flexible way by creating a group of functions that will enable a generic
handler to be executed until something else make it stop. We will use the
new dispatch calls for that.

command iterate pHandlerToLoop, pHandlerThatInterrupts
  dispatch pHandlerThatInterrupts
  if the result is true then
 dispatch pHandlerToLoop
 if the result is true then
dispatch iterate with pHandlerToLoop, pHandlerThatInterrupts
 end if
  end if
end iterate

This code will first call a command to check if the loop should be executed,
this command should return true or false. If it is true then it will call
the loop command once and if the loop command returned true, it will call
itself again. This code will loop and will exit the loop if any of two
things happen, the command that interrupts return false or the command that
loops return false, for example, let us count to ten using this code:

local lCount

on countToTen
  add 1 to lCount
  return true
end countToTen

on isItTenYet
  if lCount is 10 then
 return false
  else
 return true
  end if
end isItTenYet

on mouseUp mouseButtonNumber
  iterate "countToTen", "isItTenYet"
  put lCount
end mouseup

This has the benefit of splitting the code to be looped from the code that
says if it should loop more, this way, one could simply change the
isItTenYet command to something that checks for the key press without
touching the countToTen function. This code will work for any kind of loop
and it is nonblocking. You can reuse this for example to create code that
reads from sockets or anything mathematical that loops until some condition
is matched.

Instead of using a simple repeat loop with exit conditions and the like
mixed with the logic that should be looped, this will create some clear
distinctions which leads to more readable code in my experience. Reusable
code is your friend!

Cheers
andre


-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

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


regex question in matchChunk function

2009-12-15 Thread Chris Sheffield
I am not very familiar with regular expressions, and I'm wondering if someone 
more knowledgeable could give me a hint as to how to accomplish this.

Given a passage of text, I need to find every instance of certain words within 
that text and draw a box around them. The box drawing I can handle just fine by 
including "box" in the textStyle of the found chunk. But it's finding the 
instances that I'm struggling with. Here is my code. Big warning! This should 
not be run as is, if anyone wants to attempt it. The second repeat will go 
forever.

repeat for each line tWord in tDiffWords
repeat until matchChunk(tStoryText, "(?i)\b(" & tWord & ")\b", 
tStartChar, tEndChar) is false
   
put the textStyle of char tStartChar to tEndChar of fld "StoryText" 
into tStyle
if tStyle is empty or tStyle is "plain" then
put "box" into tStyle
else
put comma & "box" after tStyle
end if
set the textStyle of char tStartChar to tEndChar of fld "StoryText" 
to tStyle
   
end repeat
end repeat

What I need is some way to use the matchChunk function and continue the search 
where the last search ended. I read through some regex documentation and came 
across "\G", but this doesn't seem to work in Rev. But maybe I'm not putting it 
in the right place in my search string.

Can anyone help? Is there a way to do this? Or can someone recommend another 
method of accomplishing the same thing? Keep in mind that this needs to search 
whole words in a story passage, and we're dealing with all kinds of punctuation 
here, including hyphens, em dashes, etc.

Thanks,
Chris

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

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


Re: How to prevent unlocking the screen

2009-12-15 Thread Andre Garzia
Jacques,

try hiding the stack and showing it only when everything happened... it will
flick on the screen but it might be more pleasant

On Tue, Dec 15, 2009 at 8:25 AM, Jacques Hausser wrote:

> Hello everybody,
>
> I want to change the size of a stack:
>
> command changeStackSize
>  lock screen
>  -- (computes and set the new size)
> end changeStackSize
>
> The problem is that notwithstanding the "lock screen" the change is visible
> in two steps: first the window size, and then the content. I would like to
> hide the change till completed. How to do ?
> Thanks in advance
>
> Jacques
>
> **
> Prof. Jacques Hausser
> Department of Ecology and Evolution
> Biophore / Sorge
> University of Lausanne
> CH 1015 Lausanne
> please use my private address:
> 6 route de Burtigny
> CH-1269 Bassins
> tel/fax:++ 41 22 366 19 40
> mobile: ++ 41 79 757 05 24
> E-Mail: jacques.haus...@unil.ch
> ***
>
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: interrupting a repeat loop

2009-12-15 Thread Andre Garzia
Hi Folks,

this been answered in many ways already but I thought I'd chime in and try
to answer it in a different way. The key is to think of reusable code, every
now and them we keep rewritting the same pieces over and over again. How do
we create a generic thing that will:

1) Run some code in a loop
2) Enable us to stop this execution when something happen

If speed is not the main issue here, then we can approach this with a more
flexible way by creating a group of functions that will enable a generic
handler to be executed until something else make it stop. We will use the
new dispatch calls for that.

command iterate pHandlerToLoop, pHandlerThatInterrupts
   dispatch pHandlerThatInterrupts
   if the result is true then
  dispatch pHandlerToLoop
  if the result is true then
 dispatch iterate with pHandlerToLoop, pHandlerThatInterrupts
  end if
   end if
end iterate

This code will first call a command to check if the loop should be executed,
this command should return true or false. If it is true then it will call
the loop command once and if the loop command returned true, it will call
itself again. This code will loop and will exit the loop if any of two
things happen, the command that interrupts return false or the command that
loops return false, for example, let us count to ten using this code:

local lCount

on countToTen
   add 1 to lCount
   return true
end countToTen

on isItTenYet
   if lCount is 10 then
  return false
   else
  return true
   end if
end isItTenYet

on mouseUp mouseButtonNumber
   iterate "countToTen", "isItTenYet"
   put lCount
end mouseup

This has the benefit of splitting the code to be looped from the code that
says if it should loop more, this way, one could simply change the
isItTenYet command to something that checks for the key press without
touching the countToTen function. This code will work for any kind of loop
and it is nonblocking. You can reuse this for example to create code that
reads from sockets or anything mathematical that loops until some condition
is matched.

Instead of using a simple repeat loop with exit conditions and the like
mixed with the logic that should be looped, this will create some clear
distinctions which leads to more readable code in my experience. Reusable
code is your friend!

Cheers
andre


-- 
http://www.andregarzia.com All We Do Is Code.
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: interrupting a repeat loop

2009-12-15 Thread Phil Davis

Another way to check for any key being down is:

command runTheLoop
   repeat forever
  if the keysDown <> empty then exit repeat
  -- do what you want
   end repeat
end runTheLoop

HTH -
Phil Davis



On 12/15/09 7:59 AM, Robert Brenstein wrote:

On 15.12.2009 at 16:01 Uhr +0100 Jacques Hausser apparently wrote:

Hi Tim

it depends of the kind of loop you are using. Several possibilities 
For example in a card script:


local stoploop

command runTheLoop
   repeat forever
  if stoploop = "S" then exit repeat
  -- do what you want
  wait 10 milliseconds with message
   end repeat
end runTheLoop

on keyDown thekey
put thekey into stoploop
end keydown

The "wait x milliseconds with message" is the important trick here.

Jacques




If it is not relevant which key is being pressed, then a tad simpler 
variation is


command runTheLoop
   repeat forever
  if the shiftkey is down then exit repeat
  -- do what you want
   end repeat
end runTheLoop

It could also be altKey/optionKey or controlKey/commandKey instead of 
shiftkey.


Robert


--
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net

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


Re: type font size in dictionary

2009-12-15 Thread stephen barncard
Hey, this is great. I will donate.

I like the attention to detail. Also the (unprotected) stack itself is a
good example of some rather nice divider bars, geometry,  practical use of
XML, and plugin design.

-
Stephen Barncard
San Francisco
http://houseofcubes.com/disco.irev


2009/12/15 D.Coker 

> That's great, thank you so much!
>
>
> - Original Message -
> From: "Björnke von Gierke" 
> To: "How to use Revolution" 
> Sent: Tuesday, December 15, 2009 9:38:54 AM GMT -06:00 US/Canada Central
> Subject: Re: type font size in dictionary
>
> >> http://bjoernke.com/?target=bvgdocu
> >
> >
> > Does your document stack replace the original version or can either
> > one be used by choice?
>
>
> There is no replacing going on. However, my stack needs the
> documentation one time for an initial setup. It will thus display a
> kind of Setup wizard when you first start it. After this first step,
> my stack is best used as a plugin to start when rev starts. just put
> the stack into your plugins folder, and the rest should be self
> explanatory.
>
> have fun
> Björnke
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: interrupting a repeat loop

2009-12-15 Thread Robert Brenstein

On 15.12.2009 at 16:01 Uhr +0100 Jacques Hausser apparently wrote:

Hi Tim

it depends of the kind of loop you are using. Several possibilities 
For example in a card script:


local stoploop

command runTheLoop
   repeat forever
  if stoploop = "S" then exit repeat
  -- do what you want
  wait 10 milliseconds with message
   end repeat
end runTheLoop

on keyDown thekey
put thekey into stoploop
end keydown

The "wait x milliseconds with message" is the important trick here.

Jacques




If it is not relevant which key is being pressed, then a tad simpler 
variation is


command runTheLoop
   repeat forever
  if the shiftkey is down then exit repeat
  -- do what you want
   end repeat
end runTheLoop

It could also be altKey/optionKey or controlKey/commandKey instead of shiftkey.

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


Re: type font size in dictionary

2009-12-15 Thread D.Coker
That's great, thank you so much!


- Original Message -
From: "Björnke von Gierke" 
To: "How to use Revolution" 
Sent: Tuesday, December 15, 2009 9:38:54 AM GMT -06:00 US/Canada Central
Subject: Re: type font size in dictionary

>> http://bjoernke.com/?target=bvgdocu
>
>
> Does your document stack replace the original version or can either  
> one be used by choice?


There is no replacing going on. However, my stack needs the  
documentation one time for an initial setup. It will thus display a  
kind of Setup wizard when you first start it. After this first step,  
my stack is best used as a plugin to start when rev starts. just put  
the stack into your plugins folder, and the rest should be self  
explanatory.

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


Re: interrupting a repeat loop

2009-12-15 Thread Jacques Hausser
Tim, I forgot two little things:

local stoploop

command runTheLoop
  put empty into stoploop -- as stoploop is a "permanent" variable, it should 
already contain "S" and the loop will not run
  repeat forever
 if stoploop = "S" then exit repeat
 -- do what you want
 wait 10 milliseconds with messages
  end repeat
end runTheLoop

on keyDown thekey
   put thekey into stoploop
   pass keydown -- depends of what else is in your card script, without this 
line something else could be blocked...
end keydown

Sorry, I was answering too quickly !

Jacques

**
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax:++ 41 22 366 19 40
mobile: ++ 41 79 757 05 24
E-Mail: jacques.haus...@unil.ch
***

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


Re: interrupting a repeat loop

2009-12-15 Thread Tim Selander

Works great; that's just the thing I was looking for!

Thank you.

Tim Selander
Tokyo, Japan

Jacques Hausser wrote:

Hi Tim

it depends of the kind of loop you are using. Several possibilities For example 
in a card script:

local stoploop

command runTheLoop
   repeat forever
  if stoploop = "S" then exit repeat
  -- do what you want
  wait 10 milliseconds with message
   end repeat
end runTheLoop

on keyDown thekey
put thekey into stoploop
end keydown

The "wait x milliseconds with message" is the important trick here.

Jacques

Le 15 déc. 2009 à 15:37, Tim Selander a écrit :





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


Re: type font size in dictionary

2009-12-15 Thread Björnke von Gierke

http://bjoernke.com/?target=bvgdocu



Does your document stack replace the original version or can either  
one be used by choice?



There is no replacing going on. However, my stack needs the  
documentation one time for an initial setup. It will thus display a  
kind of Setup wizard when you first start it. After this first step,  
my stack is best used as a plugin to start when rev starts. just put  
the stack into your plugins folder, and the rest should be self  
explanatory.


have fun
Björnke


--

official ChatRev page:
http://bjoernke.com?target=chatrev

Chat with other RunRev developers:
go stack URL "http://bjoernke.com/chatrev/chatrev1.3b3.rev";

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


Re: type font size in dictionary

2009-12-15 Thread D.Coker

>From: "Björnke von Gierke" 
>To: "How to use Revolution" 
>Sent: Tuesday, December 15, 2009 9:00:28 AM GMT -06:00 US/Canada Central
>Subject: Re: type font size in dictionary
>
>It's a rev stack, and you can set the default font (of the field the  
>content is shown in) to a larger size... however most of the text has  
>it's own style, and those are set by scripts, so you'd need to go  
>trough the scripts and set them yourself. There's a chance that you  
>change the wrong thing and the ide becomes unusable (i hope you feel  
>warned). And finally, when rev updates the docu stack, your changes  
>might be overwritten.
>
>The easier way is, to use my bvg docu stack, where you can set text  
>sizes in the settings:


Hello Björnke,
Using dual monitors (one set at a very high resolution), I too would prefer to 
have documentation displaying larger fonts, but that leads to another 
question...

Does your document stack replace the original version or can either one be used 
by choice?

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


Re: interrupting a repeat loop

2009-12-15 Thread Jacques Hausser
Sorry, it is "with messages", plural !

Le 15 déc. 2009 à 16:01, Jacques Hausser a écrit :

> Hi Tim
> 
> it depends of the kind of loop you are using. Several possibilities For 
> example in a card script:
> 
> local stoploop
> 
> command runTheLoop
>   repeat forever
>  if stoploop = "S" then exit repeat
>  -- do what you want
>  wait 10 milliseconds with message
>   end repeat
> end runTheLoop
> 
> on keyDown thekey
>put thekey into stoploop
> end keydown
> 
> The "wait x milliseconds with message" is the important trick here.
> 
> Jacques
> 
> Le 15 déc. 2009 à 15:37, Tim Selander a écrit :
> 
>> Is there any way in RR to check for user input during a repeat loop? I'd 
>> like a loop to continue until the user types a certain key -- at which point 
>> the script would exit the handler.
>> 
>> Tim Selander
>> Tokyo, Japan
>> ___
>> use-revolution mailing list
>> use-revolution@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
> 
> **
> Prof. Jacques Hausser
> Department of Ecology and Evolution
> Biophore / Sorge
> University of Lausanne
> CH 1015 Lausanne
> please use my private address:
> 6 route de Burtigny
> CH-1269 Bassins
> tel/fax:  ++ 41 22 366 19 40
> mobile:   ++ 41 79 757 05 24
> E-Mail:   jacques.haus...@unil.ch
> ***
> 
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

**
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax:++ 41 22 366 19 40
mobile: ++ 41 79 757 05 24
E-Mail: jacques.haus...@unil.ch
***

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


Re: interrupting a repeat loop

2009-12-15 Thread Jacques Hausser
Hi Tim

it depends of the kind of loop you are using. Several possibilities For example 
in a card script:

local stoploop

command runTheLoop
   repeat forever
  if stoploop = "S" then exit repeat
  -- do what you want
  wait 10 milliseconds with message
   end repeat
end runTheLoop

on keyDown thekey
put thekey into stoploop
end keydown

The "wait x milliseconds with message" is the important trick here.

Jacques

Le 15 déc. 2009 à 15:37, Tim Selander a écrit :

> Is there any way in RR to check for user input during a repeat loop? I'd like 
> a loop to continue until the user types a certain key -- at which point the 
> script would exit the handler.
> 
> Tim Selander
> Tokyo, Japan
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

**
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax:++ 41 22 366 19 40
mobile: ++ 41 79 757 05 24
E-Mail: jacques.haus...@unil.ch
***

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


Re: type font size in dictionary

2009-12-15 Thread Björnke von Gierke
It's a rev stack, and you can set the default font (of the field the  
content is shown in) to a larger size... however most of the text has  
it's own style, and those are set by scripts, so you'd need to go  
trough the scripts and set them yourself. There's a chance that you  
change the wrong thing and the ide becomes unusable (i hope you feel  
warned). And finally, when rev updates the docu stack, your changes  
might be overwritten.


The easier way is, to use my bvg docu stack, where you can set text  
sizes in the settings:


http://bjoernke.com/?target=bvgdocu

On 15 Dec 2009, at 07:58, Peter Alcibiades wrote:

How does one change the size of the font in the dictionary?  To make  
it

several sizes larger?



--

official ChatRev page:
http://bjoernke.com?target=chatrev

Chat with other RunRev developers:
go stack URL "http://bjoernke.com/chatrev/chatrev1.3b3.rev";

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


interrupting a repeat loop

2009-12-15 Thread Tim Selander
Is there any way in RR to check for user input during a repeat 
loop? I'd like a loop to continue until the user types a certain 
key -- at which point the script would exit the handler.


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


Re: How to prevent unlocking the screen

2009-12-15 Thread Jacques Hausser
Mark,

Sorry, I was not crystal clear. When I was talking of copying a picture, I was 
actually transferring the imageData (As an alternative, I also tried to use 
"import snapshot", what works fine  and perhaps a bit quicker). You are quite 
right with the screen unlocking between the two handler in my second solution - 
it was my reason to try the first one first ;-)
And you are perfectly right in suspecting the geometry manager: it is certainly 
the culprit: in my first solution it does its work AFTER the handler resizing 
the image is completed. And the size of images was set in reference to a 
"geometrized" rectangle graphic. So of course the image size corresponds to the 
previous size of this graphic...
I foresee a nice moment to write scripts to control the size of a good amount 
of objects.

Still many thanks, and all the best

Jacques

Le 15 déc. 2009 à 12:58, Mark Schonewille a écrit :

> Hi Jacques,
> 
> When you copy a resized picture, Revolution may restore the original 
> dimensions. Copy the picture first, then resize the new picture, or use the 
> imagedata of the old picture to set the imagedata of the new picture. If you 
> do the latter, set the dimensions of the new picture to formattedHeight and 
> formattedWidth.
> 
> I strongly recommend not to use the geometry manager. Instead, write your own 
> scripts in a resizeStack handler. This is more reliable and gives you more 
> control in situations like these.
> 
> Your incomplete scripts don't give me a good impression of what is going on, 
> hence I can't tell you why the screen unlocks prematurely. Do you have an 
> answer or ask dialogue somewhere? Are you repeating or waiting with messages 
> perhaps?
> 
> Note that locking the screen doesn't really lock the entire screen and not 
> even the entire Revolution interface. It only locks windows, while they are 
> redrawn in memory.
> 
> In the case of your particular stack, when the resizeStack handler runs, all 
> other handlers have finished already, because I don't see an explicit call to 
> the resizeStack handler. If a handler containing the lock screen command 
> finishes, the screen unlocks. This means that screen will unlock before the 
> resizeStack handler runs.
> 
> Just a few thoughts. I hope this helps.
> 
> --
> Best regards,
> 
> Mark Schonewille
> 
> Economy-x-Talk Consulting and Software Engineering
> Homepage: http://economy-x-talk.com
> Twitter: http://twitter.com/xtalkprogrammer
> 
> Full PayPal integration and automation in web site or 
> (Revolution/SuperCard/other) software. Contact me for a quote
> http://economy-x-talk.com/contact.html
> 
> Op 15 dec 2009, om 12:45 heeft Jacques Hausser het volgende geschreven:
> 
>> Thanks, Mark. Works for almost everything, except for a copy of a picture (I 
>> have the original picture hidden and resized in the background, and a 
>> visible copy of it to work on). I tried two solutions
>> 
>> 1) resize the original picture and recopy it in my changeStackSize command:
>> 
>> command changeStackSize
>>  lock screen
>>  -- (computes and sets the new size)
>>  resetpicture -- (resizes the original picture and recopy it)
>> end changeStackSize
>> 
>> The picture is not resized... why ?
>> 
>> 2) catch the resizeStack message and resize the picture from there
>> 
>> command changeStackSize
>>  lock screen
>>  -- (computes and sets the new size)
>> end changeStackSize
>> 
>> on resizeStack
>>  lock screen
>>  revupdateGeometry
>>  resetpicture - (resizes the original picture and recopy it)
>> end resizeStack
>> 
>> the picture is resized OK, but you see the two successive steps on the 
>> screen...
>> Needless to say that resetpicture is the same in both cases...
>> 
>> Jacques
> 
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

**
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax:++ 41 22 366 19 40
mobile: ++ 41 79 757 05 24
E-Mail: jacques.haus...@unil.ch
***

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


Re: Newbie Data Grid question

2009-12-15 Thread Andre.Bisseret

Bonjour Jim, Trevor and others on this thread ;-)

Le 14 déc. 09 à 19:11, James Hurley a écrit :
...


Trevor (and Andre.Bisseret),

Thanks you for the very thoughtful reply(s).

It is heartening to see something defended by its parent. My sincere  
apologies for treating your offspring in such a quick and dirty  
fashion :-)
I'm sure I will appreciate the richness  of this new Run Rev object  
in time--see below.


FIrst to satisfy my quick and dirty needs, I find that the following  
works well to get data displayed in a data grid field:


on mouseUp
  put field "data" into tData --Tab delimited text
  --The first line of tData contains the column names
  put line 1 of tData into tHeaders
  replace tab with cr in tHeaders
  set dgProp["Columns"] of group "DataGrid"  to tHeaders --Thanks to  
Andre for this line.

  set the dgText [ true ] of group "DataGrid" to tData
end mouseUp

Your handler above, confirmed by Trevoir, helped me a lot to  
understand the possible uses of pFirstLineContainsHeaders.
In order to learn more about data grid, I tried several variations, I  
put below in case it could interest someone :


 local tData,tHeaders,
-- field "data" = lines of tab delimited text -- a Data Grid  
"DataGrid" with 3 columns

 

-- 1 ) IF THE LINE OF HEADERS IS NOT INCLUDED IN THE DATA (AS I AM  
ACCUSTOMED TO)

-- 1.1) WITHOUT USING pFirstLineContainsHeaders; WORKS:
on mouseUp
   put "header1" & cr & "header2" & cr & "header3" into tHeaders
   set the dgProp["columns"] of grp "DataGrid" to tHeaders
   put fld "data" into tData
   set the dgText of group "DataGrid" to tData
end mouseUp

-- 1.2) USING pFirstLineContainsHeaders: USELESS BUT WORKS :-)))
   on mouseUp
   put "header1" & cr & "header2" & cr & "header3" into tHeaders
   set the dgProp["columns"] of grp "DataGrid" to tHeaders
   put fld "data" into tData
   set the dgText[false] of group "DataGrid" to tData
end mouseUp

-- 2) IF,  FOR SOME REASON, THE LINE OF HEADERS IS INCLUDED IN THE  
DATA (FIRST LINE)

-- 2.1) WITHOUT USING pFirstLineContainsHeaders: WORKS:
on mouseUp
   put field "data" into tData
   put line 1 of tData into tHeaders
   replace tab with cr in tHeaders
   set dgProp["Columns"] of group "DataGrid"  to tHeaders
   delete line 1 of tData
   set the dgText of group "DataGrid" to tData
end mouseUp

 -- 2.2) USING  pFirstLineContainsHeaders: WORKS:
on mouseUp -- the handler from Jim
   put field "data" into tData
   put line 1 of tData into tHeaders
   replace tab with cr in tHeaders
   set dgProp["Columns"] of group "DataGrid"  to tHeaders --Thanks to  
Andre for this line.

   set the dgText [ true ] of group "DataGrid" to tData
end mouseUp
 -
--   indeed, in all these handlers, it's possible to directly set the  
dgText of grp "datagrid" to fld "data" (but less fast, I guess,  
specially if it contains a lot of lines)

--
 AS FOR THE SYNTAX OF pFirstLineContainsHeaders
OK: set the dgText[true]
nevertheless:
put true into pFirstLineContainsHeaders
set the dgText[pFirstLineContainsHeaders] of grp "datagrid" to true
works as well, but useless, OK :-)

set the pFirstLineContainsHeaders of grp "datagrid" to true does not  
work as that is creating a custom prop; OK :-))


I am a bit slow-witted but I am beginning to understand quite what  
this pFirstLineContainsHeaders can do ;-o)


Thanks to both of you,

André

 
  


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


Re: How to prevent unlocking the screen

2009-12-15 Thread Mark Schonewille

Hi Jacques,

When you copy a resized picture, Revolution may restore the original  
dimensions. Copy the picture first, then resize the new picture, or  
use the imagedata of the old picture to set the imagedata of the new  
picture. If you do the latter, set the dimensions of the new picture  
to formattedHeight and formattedWidth.


I strongly recommend not to use the geometry manager. Instead, write  
your own scripts in a resizeStack handler. This is more reliable and  
gives you more control in situations like these.


Your incomplete scripts don't give me a good impression of what is  
going on, hence I can't tell you why the screen unlocks prematurely.  
Do you have an answer or ask dialogue somewhere? Are you repeating or  
waiting with messages perhaps?


Note that locking the screen doesn't really lock the entire screen and  
not even the entire Revolution interface. It only locks windows, while  
they are redrawn in memory.


In the case of your particular stack, when the resizeStack handler  
runs, all other handlers have finished already, because I don't see an  
explicit call to the resizeStack handler. If a handler containing the  
lock screen command finishes, the screen unlocks. This means that  
screen will unlock before the resizeStack handler runs.


Just a few thoughts. I hope this helps.

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer

Full PayPal integration and automation in web site or (Revolution/ 
SuperCard/other) software. Contact me for a quote

http://economy-x-talk.com/contact.html

Op 15 dec 2009, om 12:45 heeft Jacques Hausser het volgende geschreven:

Thanks, Mark. Works for almost everything, except for a copy of a  
picture (I have the original picture hidden and resized in the  
background, and a visible copy of it to work on). I tried two  
solutions


1) resize the original picture and recopy it in my changeStackSize  
command:


command changeStackSize
  lock screen
  -- (computes and sets the new size)
  resetpicture -- (resizes the original picture and recopy it)
end changeStackSize

The picture is not resized... why ?

2) catch the resizeStack message and resize the picture from there

command changeStackSize
  lock screen
  -- (computes and sets the new size)
end changeStackSize

on resizeStack
  lock screen
  revupdateGeometry
  resetpicture - (resizes the original picture and recopy it)
end resizeStack

the picture is resized OK, but you see the two successive steps on  
the screen...

Needless to say that resetpicture is the same in both cases...

Jacques


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


Re: How to prevent unlocking the screen

2009-12-15 Thread Jacques Hausser
Thanks, Mark. Works for almost everything, except for a copy of a picture (I 
have the original picture hidden and resized in the background, and a visible 
copy of it to work on). I tried two solutions

1) resize the original picture and recopy it in my changeStackSize command:

command changeStackSize
   lock screen
   -- (computes and sets the new size)
   resetpicture -- (resizes the original picture and recopy it)
end changeStackSize

The picture is not resized... why ?

2) catch the resizeStack message and resize the picture from there

command changeStackSize
   lock screen
   -- (computes and sets the new size)
end changeStackSize

on resizeStack
   lock screen
   revupdateGeometry
   resetpicture - (resizes the original picture and recopy it)
end resizeStack 

the picture is resized OK, but you see the two successive steps on the screen...
Needless to say that resetpicture is the same in both cases...

Jacques



Le 15 déc. 2009 à 11:38, Mark Schonewille a écrit :

> Hi Jacques,
> 
> Lock screen, change stack size, change content, unlock screen. This should 
> give acceptable results. This is a script, which I use in a project of mine:
> 
> revChangeWindowSize the width of this stack,the cNewHeight of cd 
> "Destination Card","Slide",,100
> lock screen
> go cd "A different card"
> resizeStack // update contents here
> unlock screen with visual effect dissolve very fast
> 
> (mind line wraps, if any)

**
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax:++ 41 22 366 19 40
mobile: ++ 41 79 757 05 24
E-Mail: jacques.haus...@unil.ch
***

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


Re: How to prevent unlocking the screen

2009-12-15 Thread Mark Schonewille

Hi Jacques,

Lock screen, change stack size, change content, unlock screen. This  
should give acceptable results. This is a script, which I use in a  
project of mine:


 revChangeWindowSize the width of this stack,the cNewHeight of cd  
"Destination Card","Slide",,100

 lock screen
 go cd "A different card"
 resizeStack // update contents here
 unlock screen with visual effect dissolve very fast

(mind line wraps, if any)

--
Best regards,

Mark Schonewille

Economy-x-Talk Consulting and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer

Full PayPal integration and automation in web site or (Revolution/ 
SuperCard/other) software. Contact me for a quote

http://economy-x-talk.com/contact.html

Op 15 dec 2009, om 11:25 heeft Jacques Hausser het volgende geschreven:


Hello everybody,

I want to change the size of a stack:

command changeStackSize
 lock screen
 -- (computes and set the new size)
end changeStackSize

The problem is that notwithstanding the "lock screen" the change is  
visible in two steps: first the window size, and then the content. I  
would like to hide the change till completed. How to do ?

Thanks in advance

Jacques




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


How to prevent unlocking the screen

2009-12-15 Thread Jacques Hausser
Hello everybody,

I want to change the size of a stack:

command changeStackSize
  lock screen
  -- (computes and set the new size)
end changeStackSize

The problem is that notwithstanding the "lock screen" the change is visible in 
two steps: first the window size, and then the content. I would like to hide 
the change till completed. How to do ?
Thanks in advance

Jacques

**
Prof. Jacques Hausser
Department of Ecology and Evolution
Biophore / Sorge
University of Lausanne
CH 1015 Lausanne
please use my private address:
6 route de Burtigny
CH-1269 Bassins
tel/fax:++ 41 22 366 19 40
mobile: ++ 41 79 757 05 24
E-Mail: jacques.haus...@unil.ch
***

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