Re: Sarah Reichelt's XML sample stack

2010-06-26 Thread Simon Lord
Sarah, your tutorial stack is a rosetta stone.  Thanks for taking the
effort to make it.



On Sat, Jun 26, 2010 at 4:32 AM, Sarah Reichelt
 wrote:
> On Sat, Jun 26, 2010 at 12:36 PM, Simon Lord  wrote:
>> Is Sarah still around?  I searched the archives for an XML sample
>> stack to get my feet wet but her sample seems to be missing from her
>> site (I can't find it to save my life).
>
> Still here :-)
>
> My XML stack was online but had got lost from the stacks list, so was
> effectively invisible.
> It's listed now but here is a direct link
> 
>
> --
> Cheers,
> Sarah
>
> Rodeo discussion:
> http://rodeoapps.com/rodeo-discuss-among-yourselves
> ___
> 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: Call to all you one-liners !

2010-06-26 Thread Ken Ray

>> FYI: ugly though it is, here's the regex (it's long, so I broke it up into
>> multiple statements):
> 
> That's a lot of work. I go for the easy way:
> 
> function isAColor pColor
>   local tIsColor
>   put true into tIsColor
>   create invisible button
>   try
> set the backcolor of the last button to pColor
>   catch e
> put false into tIsColor
>   end try
>   delete the last button
>   return tIsColor
> end isAColor

Actually that doesn't solve the original issue - you can set the color to
numbers that are greater than 256 and it will still work (try it with
"1000,1000,1000" and you'll see what I mean).


Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Web Site: http://www.sonsothunder.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: Call to all you one-liners !

2010-06-26 Thread rkriesel
How about:

... and max(fld 1) < 256 and min(fld 1) >= 0 ...

... still one line but not pretty ...

I'm away from my computer so I can't test it now.

-- Dick


Sent from my iPhone

On Jun 26, 2010, at 2:43 AM, Mark Schonewille 
 wrote:

> put (fld 1 is a color and the number of items of fld 1 is 3)
___
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: Call to all you one-liners !

2010-06-26 Thread Mark Wieder
Ken-

Saturday, June 26, 2010, 2:57:29 PM, you wrote:

> FYI: ugly though it is, here's the regex (it's long, so I broke it up into
> multiple statements):

That's a lot of work. I go for the easy way:

function isAColor pColor
  local tIsColor
  put true into tIsColor
  create invisible button
  try
set the backcolor of the last button to pColor
  catch e
put false into tIsColor
  end try
  delete the last button
  return tIsColor
end isAColor

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

2010-06-26 Thread Jeff Massung
On Sat, Jun 26, 2010 at 5:57 PM, Sarah Reichelt wrote:

> put "!c" before line 10 of button "Edit"
>
> Then you need to move it if the item is un-checked.
> I usually grab the text of the button, replace "!c" with empty, apply
> any required check marks, the put the variable back into the menu
> button.
>  
>


Been a while since I've done this, but I seem to remember that you can use
"!u" to uncheck an item, that way if you have a menu that you don't want to
be modifying all the time with a lot of parsing, you can put "!u" in front
of all the menu items, and change char 2 to "c" or "u" as you please.

Untested, and I'm not sure if it works or if it's not "!u" but something
else. But might be worth looking into.

Jeff M.
___
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: Menu Checkmarks

2010-06-26 Thread Sarah Reichelt
put "!c" before line 10 of button "Edit"

Then you need to move it if the item is un-checked.
I usually grab the text of the button, replace "!c" with empty, apply
any required check marks, the put the variable back into the menu
button.

Cheers,
Sarah


On Sunday, June 27, 2010, Justin Sloan  wrote:
> I am trying to check and uncheck a menu item, specifically a "Word Wrap" menu 
> option.  I tried several things but can't seem to get it to work.
>
> set the hilite of menuItem 10 of menu "Edit" of group "MenuBar" to false
>
> set the checkmark of menuItem 10 of menu "Edit" of group "MenuBar" to false
>
> set the value of menuItem 10 of menu "Edit" of group "MenuBar" to "!nWord 
> Wrap"
>
> set the label of menuItem 10 of menu "Edit" of group "MenuBar" to "!nWord 
> Wrap"
>
> Any thoughts?___
> 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
>

-- 
Cheers,
Sarah

Rodeo discussion:
http://rodeoapps.com/rodeo-discuss-among-yourselves
___
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: Call to all you one-liners !

2010-06-26 Thread Ken Ray
FYI: ugly though it is, here's the regex (it's long, so I broke it up into
multiple statements):

function isAColor pRGB
  put "^([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])," & \
  "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])," & \
  "([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])$" into tRegEx
  return matchText(pRGB,tRegEx)
end isAColor


Ken Ray
Sons of Thunder Software, Inc.
Email: k...@sonsothunder.com
Web Site: http://www.sonsothunder.com/


On 6/26/10 2:10 PM, "Jim Ault"  wrote:

> The sum() function error could do this,
> but it will also work with real numbers, not just integers.
> 
> On Jun 26, 2010, at 10:36 AM, J. Landman Gay wrote:
> 
>> J. Landman Gay wrote:
>>> Mark Schonewille wrote:
 Hi Francis,
 
 put (fld 1 is a color and the number of items of fld 1 is 3) into
 myIsRGB
>>> As mentioned, this is okay for a quick check but isn't very
>>> reliable in general. "Is a color" seems to return true for any
>>> comma-delimited list of integers, regardless of whether the numbers
>>> are within a valid color range.
>> 
>> I meant to add: it could be a quick way to check for any valid list
>> of item-delimited integers though. It's sort of a non-intuitive
>> approach, but faster than iterating through the list looking for non-
>> integer entries.
>> 
> 
> 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


___
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: Line Numbers in Text Editor

2010-06-26 Thread Jeff Massung
I gotta say, my name is Jeff Massung, and I disapprove of that solution. ;-)

I love everyone sharing their ideas, but this is one that's been a solved
problem, well... for a very long time, and with a little math there's no
performance issue what-so-ever, and there's no need to keep around a field
with thousands of numbers in it.

Think of what we know:

* The size of our editor.
* Where the scrollbar is.
* The size of the font we're using.

>From this, there's very little we actually need to do. Even with the largest
monitor on the planet and using the smallest (readable) font, the number of
average lines visible to any user is well < 100. So, generally speaking, we
should never need to do much more than count to 100 at any given point in
time to update our "gutter" area containing line numbers.

So, here's a little script taking from my editor. It assumes that the the
gutter area is always sized to the same height as the editor, that the line
height is fixed (read: we're not embedding images or changing the font
size), and that the editor has line wrapping turned off. With a few tweaks
it could work just fine with those features on, but for the sake of this
discussion, we'll leave them off.

on updateGutter

   local tHeight

   local tTextHeight

   local tScroll

   local tFirstRow

   local tRows



   -- wipe the gutter clean

   put empty into fld "Line Numbers"



   -- snag what we care about from the editor

   put the vScroll of fld "Editor" into tScroll

   put the effective textHeight of fld "Editor" into tTextHeight

   put the height of fld "Editor" into tHeight



   -- calculate the first visible line and the total number of visible lines

   put tScroll div tTextHeight into tFirstRow

   put tHeight div tTextHeight into tRows



   -- fill in the gutter with the line numbers

   repeat with tLine = tFirstRow to tFirstRow + tRows

  put tLine + 1 & cr after fld "Line Numbers"

   end repeat



   -- scroll the gutter (every so slightly) to match the editor

   set the textSize of fld "Line Numbers" to the textSize of fld "Editor"

   set the textFont of fld "Line Numbers" to the textFont of fld "Editor"

   set the vScroll of fld "Line Numbers" to tScroll mod tTextHeight
end updateGutter

That's pretty much it. Now we need to know when to update the gutter area.
We need to update it when:

* on scrollbarDrag (the editor)
* when the we reset the editor to display something new
* when we resize the editor (and subsequently the gutter)

HTH,

Jeff M.
___
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: Line Numbers in Text Editor

2010-06-26 Thread Justin Sloan
Richard,

Fantastic primer on handling line numbers in Rev! Thank you!  It's amazing how 
something seemingly so simple can have such a huge impact.

That is what I love about programming, the elegance of creative solutions.


 - Justin


On Jun 26, 2010, at 7:23 PM, Richard Gaskin wrote:

> Justin Sloan wrote:
> > I am planning to implement line numbers in a proprietary text editor
> > that I wrote for in-house use.  Problem is, I don't know how I am
> > going to implement it. I thought about using a parallel text field,
> > but there has to be an easier way.  Any of you genius devs have any
> > ideas?
> 
> I forked the MC IDE's script editor many years ago to add, among other 
> things, line numbers.  It was at the time the only script editor for Rev 
> which had line numbers, and having implemented this "advanced technology"  
> I can share with you a couple tips I learned:
> 
> The line numbers are displayed in a separate field to the left of the editor 
> field, kept in synch with scrollbardrag handlers in each.  Being a script 
> editor I also have another field in between them for marking breakpoints, but 
> you probably won't need that for other types of editing.
> 
> I chose a separate field for the line numbers because it seemed a more 
> with-the-grain approach than attempting to put anything in the editor field 
> except for the script itself.  In Rev, a script is just a block of text, so 
> my mandate for my editor was to maintain as close a relationship as possible 
> between what you see and what the engine expects.  So the script is dumped 
> into a field, with no caches or other intermediaries to complicate the 
> scripter's relationship with the engine. WYGIWE - what you got is what 
> exists. ;)  I have a McCabe algo for Rev (see note on RevCloud below) so I'm 
> sensitive to the impact of complexity in a code base.
> 
> At first I went the route most other text editors use, in which the line 
> number field is populated dynamically to show only the lines present in the 
> editor field.  But I found that when I got beyond a few thousand lines the 
> time it takes the engine to render the line number field became a performance 
> drag on my typing.  So I went with having pre-populated numbers, which isn't 
> so bad since you can still see how many lines you have in your script by just 
> scrolling to the end and look at the last line number across from the last 
> line of script.
> 
> But even pre-populating the line number field was not without some challenge, 
> since putting in 10,000 lines of numbers would not be sufficient for some 
> scripts, and added a lot of bulk to the editor stack file.
> 
> So the final solution I went with was leaving the field blank when the stack 
> is saved, and populating it on preOpenStack with the number of lines of the 
> script + 5000.  Since this is a one-time performance hit when the stack 
> opens, the impact on performance isn't nearly as noticeable as it was when I 
> was appending that list with each carriage return (has anyone younger than 40 
> even seen an actual typewriter carriage? Odd nomenclature in the 21st 
> century, but I digress).
> 
> This keeps the stack file small enough to be extremely portable (I'm 
> migrating a lot of tools to cloud storage - look for RevCloud coming soon to 
> RevNet this summer; think devolution on serious steroids and focused on 
> collaborative workflows), and it's unlikely that a person will type more than 
> 5000 lines during a given session with the editor open.
> 
> But what if they paste more than 5k lines?  I've trapped for that in the 
> Paste item and add another block of lines numbers beyond the number already 
> in the field + the number in the clipboard, so we stay a few thousand lines 
> ahead of the scripter.
> 
> HTH -
> 
> -- 
> 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

___
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


Menu Checkmarks

2010-06-26 Thread Justin Sloan
I am trying to check and uncheck a menu item, specifically a "Word Wrap" menu 
option.  I tried several things but can't seem to get it to work.

set the hilite of menuItem 10 of menu "Edit" of group "MenuBar" to false

set the checkmark of menuItem 10 of menu "Edit" of group "MenuBar" to false

set the value of menuItem 10 of menu "Edit" of group "MenuBar" to "!nWord Wrap"

set the label of menuItem 10 of menu "Edit" of group "MenuBar" to "!nWord Wrap"

Any thoughts?___
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: Uncomfirmed crash report (was Re: [OT] Computer news from Kassel)

2010-06-26 Thread Wilhelm Sanke

On Fri Jun 25, 2010, Ben Rubinstein benr_mc at cogapp.com wrote:



On 25/06/2010 17:36, Wilhelm Sanke wrote:

>  And, if someone finds out that "you can crash Rev with
> only four lines of script" this should definitely arouse the attention
> of the responsible members of the Rev team, irrespective whether the bug
> report is multi-faceted or concentrated on one single sub-point. The Rev
> team should be competent enough to deal with a number of related
> troubles at the same time, or deal with them step by step. I believe
> that they are basically capable to handle also complicated issues, they
> are not first-graders in computer science.

But they are busy people, who have to choose where to put their time.



So are we!. My time is equally valuable. I think the relationship 
between the Rev team and their customers, supporters, cooperators etc. 
is one of mutual acknowledgement and respect without any trace of a 
hierarchy.


I believe the unresponsiveness of the people from Rev in this case - an 
unresponsiveness which happily does not happen all the time, I indeed 
did have quite a number of normal and positive experiences - is mainly 
an organisational problem.
If you set up a bug database for Rev users, you have also to develop 
regular procedures to communicate with the sender of a bug report in a 
narrow time frame.  If there are open questions concerning a report - 
facts and arguments that may be totally clear in the mind of the sender, 
but actually need extra clarifications and additional information for 
the member of the Rev team that is assigned to the bug - then there is 
the need (and there should be the time) to contact the sender about it.
Just staying mute for 9 months, doing nothing, is not appropriate and 
helpful - and certainly counterproductive to the goals of further 
development and improvement of Revolution and establishing a good 
working relationship with its users.



  I took
some time to work through the bug, which is actually called "Groups: 
Bugs and
features ("last group" broken)?".  It refers to a way of crashing Rev, 
but
doesn't give enough information.  I tried, yesterday, to reproduce the 
bug
using the script fragment in the bug report, but without success.  
However,
that may be because I didn't know the definition of 'pre-PNG'. Perhaps 
I would
have discovered that by following the clue of "my recent post to this 
list",
but that was more time than I had.  I tried with a PNG, and it didn't 
crash.



As I had stated in the bug report, the crash occurs with what I have 
called and defined as "Pre-PNGs", PNG images created inside Revolution, 
but apparently differing from PNGs created with other image tools. This 
in itself may be a bug.


I will quote here from the relevant links for the definition of Pre-PNGs 
which I had supplied in my bug report (My post to the use-revolution 
list "How to reliably crash Rev 3.5 and 4.0-dp3 with four script lines" 
of  August 26, 2009, and the introduction to stack "More about Masks"

):

"Pre-PNG" images are basically those that are created or modified (as 
to their imagedata) in Revolution and have not yet been saved as 
external files and then been re-imported. Even if you export a 
snapshot using "to image x as PNG" (image x being an image already 
existing on the card), the resulting image will remain a Pre-PNG, also 
copying and pasting the Pre-PNG to another card or stack preserves the 
quality of the Pre-PNGs which behave differently in some respects. For 
details see my comments in "More about Masks".


From the introduction to stack "More about Masks":

A final observation concerning the creation of masks inside Revolution 
and using the "import snapshot" format:


If the resulting mask image is not first saved as an external file and 
then imported again, meaning if it remains as freshly created inside a 
stack or was just copied from another mask-producing stack, then this 
mask image will have a different quality, which we might call a "pre-PNG".


Pre-PNGs behave somewhat differently than normal PNGs: You cannot 
transfer its alphamask to the image-to-be-masked when the pre-PNG is 
hidden, at least not several times with resizing. After you have 
resized a pre-PNG during the masking process, you might find that it 
is suddenly "empty", but it can be restored when you copy and paste it 
(it then appears in its original size and shape).
A workaround to overcome this problem is to store the mask in a custom 
property of its own and then to "initialize" the mask each time before 
it is used in the calling script:


"put the CPimg of img "transition" into img "transition""

But of course you can easily convert a pre-PNG to a full PNG by saving 
the image as an external file.



There are more peculiarities of these Pre-PNGs than I have described here.


Again, I share your frustration that reports can be left 'unconfirmed' 
(and
for much longer than a year - my o

Re: Call to all you one-liners !

2010-06-26 Thread Jim Ault

The sum() function error could do this,
but it will also work with real numbers, not just integers.

On Jun 26, 2010, at 10:36 AM, J. Landman Gay wrote:


J. Landman Gay wrote:

Mark Schonewille wrote:

Hi Francis,

put (fld 1 is a color and the number of items of fld 1 is 3) into  
myIsRGB
As mentioned, this is okay for a quick check but isn't very  
reliable in general. "Is a color" seems to return true for any  
comma-delimited list of integers, regardless of whether the numbers  
are within a valid color range.


I meant to add: it could be a quick way to check for any valid list  
of item-delimited integers though. It's sort of a non-intuitive  
approach, but faster than iterating through the list looking for non- 
integer entries.




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: Call to all you one-liners !

2010-06-26 Thread J. Landman Gay

J. Landman Gay wrote:

Mark Schonewille wrote:

Hi Francis,

put (fld 1 is a color and the number of items of fld 1 is 3) into myIsRGB


As mentioned, this is okay for a quick check but isn't very reliable in 
general. "Is a color" seems to return true for any comma-delimited list 
of integers, regardless of whether the numbers are within a valid color 
range.




I meant to add: it could be a quick way to check for any valid list of 
item-delimited integers though. It's sort of a non-intuitive approach, 
but faster than iterating through the list looking for non-integer entries.


--
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: Line Numbers in Text Editor

2010-06-26 Thread stephen barncard
RevCloud?? wha?

ok Richard, you've opened the door now you must tell us more...
( I didn't want that to rhyme.)

On 26 June 2010 09:23, Richard Gaskin  wrote:

> ...
> This keeps the stack file small enough to be extremely portable (I'm
> migrating a lot of tools to cloud storage - look for *RevCloud* coming
> soon to RevNet this summer; think devolution on serious steroids and focused
> on collaborative workflows), and it's unlikely that a person will type more
> than 5000 lines during a given session with the editor open.
>
> --
-
Stephen Barncard
San Francisco
___
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: Call to all you one-liners !

2010-06-26 Thread J. Landman Gay

Mark Schonewille wrote:

Hi Francis,

put (fld 1 is a color and the number of items of fld 1 is 3) into myIsRGB


As mentioned, this is okay for a quick check but isn't very reliable in 
general. "Is a color" seems to return true for any comma-delimited list 
of integers, regardless of whether the numbers are within a valid color 
range.


--
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: Radio button group

2010-06-26 Thread charles61

Please disregard my previous posting concerning radio buttons. I found my
error.
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Radio-button-group-tp2269461p2269522.html
Sent from the Revolution - User mailing list archive at Nabble.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: Call to all you one-liners !

2010-06-26 Thread Richard Gaskin

Mark Schonewille wrote:


I have said it before: if we can somehow put a FAQ together, I'll
gladly host it on the runrev.info site. I just need a list of
questions (and their answers).


I've been using this collection from Ken Ray's site, also accessible 
directly within Rev in RevNet (see Development->Plugins->GoRevNet).


--
 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: Line Numbers in Text Editor

2010-06-26 Thread Richard Gaskin

Justin Sloan wrote:
> I am planning to implement line numbers in a proprietary text editor
> that I wrote for in-house use.  Problem is, I don't know how I am
> going to implement it. I thought about using a parallel text field,
> but there has to be an easier way.  Any of you genius devs have any
> ideas?

I forked the MC IDE's script editor many years ago to add, among other 
things, line numbers.  It was at the time the only script editor for Rev 
which had line numbers, and having implemented this "advanced 
technology"  I can share with you a couple tips I learned:


The line numbers are displayed in a separate field to the left of the 
editor field, kept in synch with scrollbardrag handlers in each.  Being 
a script editor I also have another field in between them for marking 
breakpoints, but you probably won't need that for other types of editing.


I chose a separate field for the line numbers because it seemed a more 
with-the-grain approach than attempting to put anything in the editor 
field except for the script itself.  In Rev, a script is just a block of 
text, so my mandate for my editor was to maintain as close a 
relationship as possible between what you see and what the engine 
expects.  So the script is dumped into a field, with no caches or other 
intermediaries to complicate the scripter's relationship with the 
engine. WYGIWE - what you got is what exists. ;)  I have a McCabe algo 
for Rev (see note on RevCloud below) so I'm sensitive to the impact of 
complexity in a code base.


At first I went the route most other text editors use, in which the line 
number field is populated dynamically to show only the lines present in 
the editor field.  But I found that when I got beyond a few thousand 
lines the time it takes the engine to render the line number field 
became a performance drag on my typing.  So I went with having 
pre-populated numbers, which isn't so bad since you can still see how 
many lines you have in your script by just scrolling to the end and look 
at the last line number across from the last line of script.


But even pre-populating the line number field was not without some 
challenge, since putting in 10,000 lines of numbers would not be 
sufficient for some scripts, and added a lot of bulk to the editor stack 
file.


So the final solution I went with was leaving the field blank when the 
stack is saved, and populating it on preOpenStack with the number of 
lines of the script + 5000.  Since this is a one-time performance hit 
when the stack opens, the impact on performance isn't nearly as 
noticeable as it was when I was appending that list with each carriage 
return (has anyone younger than 40 even seen an actual typewriter 
carriage? Odd nomenclature in the 21st century, but I digress).


This keeps the stack file small enough to be extremely portable (I'm 
migrating a lot of tools to cloud storage - look for RevCloud coming 
soon to RevNet this summer; think devolution on serious steroids and 
focused on collaborative workflows), and it's unlikely that a person 
will type more than 5000 lines during a given session with the editor open.


But what if they paste more than 5k lines?  I've trapped for that in the 
Paste item and add another block of lines numbers beyond the number 
already in the field + the number in the clipboard, so we stay a few 
thousand lines ahead of the scripter.


HTH -

--
 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: Call to all you one-liners !

2010-06-26 Thread Mark Schonewille

Hi,

I have said it before: if we can somehow put a FAQ together, I'll  
gladly host it on the runrev.info site. I just need a list of  
questions (and their answers).


--
Best regards,

Mark Schonewille

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

Subscribe to the Economy-x-Talk newsletter at http://qurl.tk/cj
Download Clipboard Link http://clipboardlink.economy-x-talk.com and  
share the clipboard of your computer over the local network.


On 26 jun 2010, at 17:47, Francis Nugent Dixon wrote:


Hi from Beautiful Brittany,

I should have known ! Mark was the first
to answer, and it's a beautiful one-liner.

After more than 15 years of HC and
a few more of Rev, I still bow to those
who know so much about this language.

Thanks Mark - even Scott was impressed !

I reckon that an FAQ Data Base should be
set up, with Mark heading the pack !

-Francis

"Nothing should ever be done for the first time !"




___
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: Call to all you one-liners !

2010-06-26 Thread Francis Nugent Dixon

Hi from Beautiful Brittany,

I should have known ! Mark was the first
to answer, and it's a beautiful one-liner.

After more than 15 years of HC and
a few more of Rev, I still bow to those
who know so much about this language.

Thanks Mark - even Scott was impressed !

I reckon that an FAQ Data Base should be
set up, with Mark heading the pack !

-Francis

"Nothing should ever be done for the first time !"




___
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: Call to all you one-liners !

2010-06-26 Thread Peter Brigham MD

On Jun 26, 2010, at 6:21 AM, Scott Rossi wrote:


Recently, Mark Schonewille wrote:


put (fld 1 is a color and the number of items of fld 1 is 3) into
myIsRGB


"...is a color..."  Gad, I never knew about this usage.  Good to know.

Thanks & Regards,

Scott Rossi


I didn't know that either. I experimented a little with this.

put "255,255" is a color --> false, but
put "255,255,255,34" is a color --> true,
hence the need for the extra check for the number of items = 3.
But beware:
put "255,255,401" is a color --> true
so the range is not checked, instead 401 is "wrapped" (mod 256) to 146  
when the color is set to such a triplet


For a really strict parsing in just one line, I suspect you have to  
use Regex. Notice I said "you," since *I* can't use Regex to save my  
life, though I'm happy to copy and paste snippets provided by others  
into my scripts when needed


-- Peter

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


___
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: Line Numbers in Text Editor

2010-06-26 Thread Peter Brigham MD

On Jun 25, 2010, at 7:37 PM, Alex Tweedly wrote:

The straightforward answer is using formattedText . but the  
deeper question is what line numbering you want for the lines when  
there is line-wrapping happening. For instance, if it is something  
like a source code editor, then the line numbers (IMHO) should be  
independent of the size of window currenty in use.


For example,  if I have the following text

1   My first line
2 this is a very long line of text that is going to be wrapped in a  
moment when I make the window narrow.

3 third line.

Then when the window becomes narrow, do I *want*

1   My first line
2  this is a very long line of text that is going to be wrapped
3  in a moment when I make the window narrow.
4  third line.

or do I want something like

1   My first line
2   this is a very long line of text that is going to be wrapped
2a  in a moment when I make the window narrow.
3   third line.

It really depends on whether you are numbering the lines of the  
window or the lines of the underlying text (or source code, or  
whatever); quite often, I suspect, it should be the latter. And in  
that case I don't know of any quick or easy way to figure out how  
the numbering should be done :-(


-- Alex.


In the latter case, the easiest way to approach the problem is to  
place the line numbers into the field itself with a tab delimiter.  
It's easy to get something like:



1   My first line
2   this is a very long line of text that is going to be wrapped
in a moment when I make the window narrow. <
3   third line.


(If you need the "2a" option, not so easy.)

Then script around the problem of fetching text from the field by  
something like:


   function getlinetext lineNbrStart, lineNbrEnd
  set the itemdelimiter to tab
  repeat with n = lineNbrStart to lineNbrEnd
 put (item 2 of line n of fld "text") & cr after textList
  end repeat
  return char 1 to -2 of textList
   end getlinetext

This doesn't avoid messiness in what happens when the user selects  
text in the field, but could be useful in some contexts, eg, a list  
field. The Rev IDE script editor uses two fields and doesn't try to  
sort out line wrapping -- the script field is dontwrap = true.


If the rumors about a major revamping of the field object are true,  
maybe we can have built-in functions that give both the clickLine and  
the "formattedClickLine" -- ie, the line marked by the arrow in the  
example above would be clickline = 2, formattedclickline = 3


-- Peter

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


___
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


Radio button group

2010-06-26 Thread charles61

i have the following script for a group of three radio buttons to check to
see if any of the radio buttons has been selected. If one has been selected
the script then checks to see if a field "e-mail" has been completed. 

According to the Rev docs, the hilitedButton of a group is an integer
between zero and the number of buttons in a group. I set the hilitedButton
script to indicate that if a the number is greater than zero then a button
has been selected. But this does not work.

Here is my script:

if the hilitedButton of group "freq" > zero then
  if field "e-mail" is empty then
 beep
 answer information "Please give the school employee's e-mail."
 exit to top
  end if
 end if

What changes do I need to make so that the script works?
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Radio-button-group-tp2269461p2269461.html
Sent from the Revolution - User mailing list archive at Nabble.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: Sarah Reichelt's XML sample stack

2010-06-26 Thread Michael Kann
I could have sworn that I saw you in the stands when the Socceroos played 
Germany. You were dressed up like a kangaroo blowing into a vuvuzela horn. That 
wasn't you? I swear it looked exactly like you.

Anyway, now that the Socceroos are back home we're all glad that you have time 
to work on your programming. 





--- On Sat, 6/26/10, Sarah Reichelt  wrote:

> From: Sarah Reichelt 
> Subject: Re: Sarah Reichelt's XML sample stack
> To: "How to use Revolution" 
> Date: Saturday, June 26, 2010, 3:32 AM
> On Sat, Jun 26, 2010 at 12:36 PM,
> Simon Lord 
> wrote:
> > Is Sarah still around?  I searched the archives for
> an XML sample
> > stack to get my feet wet but her sample seems to be
> missing from her
> > site (I can't find it to save my life).
> 
> Still here :-)
> 
> My XML stack was online but had got lost from the stacks
> list, so was
> effectively invisible.
> It's listed now but here is a direct link
> 
> 
> -- 
> Cheers,
> Sarah
> 
> Rodeo discussion:
> http://rodeoapps.com/rodeo-discuss-among-yourselves
> ___
> 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: Line Numbers in Text Editor

2010-06-26 Thread BNig

Hi Alex, 
I gave it a try:

as revlet
http://berndniggemann.on-rev.com/textLineNumbers/
as zipped stack
http://berndniggemann.on-rev.com/textLineNumberStack/

is a proof of principle, seems to work though. Sometimes a little awkward :)

regards
Bernd



Alex Tweedly wrote:
> 
> The straightforward answer is using formattedText . but the deeper 
> question is what line numbering you want for the lines when there is 
> line-wrapping happening. For instance, if it is something like a source 
> code editor, then the line numbers (IMHO) should be independent of the 
> size of window currenty in use.
> 
> For example,  if I have the following text
> 
>   1   My first line
>   2 this is a very long line of text that is going to be wrapped in a 
> moment when I make the window narrow.
>   3 third line.
> 
> Then when the window becomes narrow, do I *want*
> 
>   1   My first line
>   2  this is a very long line of text that is going to be wrapped
>   3  in a moment when I make the window narrow.
>   4  third line.
> 
> or do I want something like
> 
>   1   My first line
>   2   this is a very long line of text that is going to be wrapped
>   2a  in a moment when I make the window narrow.
>   3   third line.
> 
> It really depends on whether you are numbering the lines of the window 
> or the lines of the underlying text (or source code, or whatever); quite 
> often, I suspect, it should be the latter. And in that case I don't know 
> of any quick or easy way to figure out how the numbering should be done
> :-(
> 
> -- Alex.
> 
> 
> 
> On 25/06/2010 08:25, Justin Sloan wrote:
>> I went with using a parallel field to add line numbers and it is
>> working well. However, rev only counts the line numbers based on the
>> delimeter. So if word warp is turned on you end up with more lines
>> then there are actual line numbers.
>>
>> Does anyone know of a way to count all the lines, even the lines that
>> are wrapped and not separated by the delimeter?
>>
>>   - Justin
>>
>>
>>
>> On Thu, Jun 24, 2010 at 5:44 PM, Jeff Massung  wrote:
>>
>>> I used a parallel field in my Cryogen editor (http://massj.tumblr.com
>>> for
>>> video + screenshot). Worked out perfectly, and now that I've done it
>>> that
>>> way once, I actually wouldn't want to do it any other way in the future.
>>>
>>> Jeff M.
>>>
>>> On Thu, Jun 24, 2010 at 6:01 AM, Justin
>>> Sloanwrote:
>>>
>>>  
 I am planning to implement line numbers in a proprietary text editor
 that I wrote for in-house use.  Problem is, I don't know how I am
 going to implement it. I thought about using a parallel text field,
 but there has to be an easier way.  Any of you genius devs have any
 ideas?
> 
-- 
View this message in context: 
http://runtime-revolution.278305.n4.nabble.com/Line-Numbers-in-Text-Editor-tp2266755p2269436.html
Sent from the Revolution - User mailing list archive at Nabble.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: Sarah Reichelt's XML sample stack

2010-06-26 Thread Simon Lord
Excellent.  Thanks guys. :)


On Sat, Jun 26, 2010 at 4:32 AM, Sarah Reichelt
 wrote:
> On Sat, Jun 26, 2010 at 12:36 PM, Simon Lord  wrote:
>> Is Sarah still around?  I searched the archives for an XML sample
>> stack to get my feet wet but her sample seems to be missing from her
>> site (I can't find it to save my life).
>
> Still here :-)
>
> My XML stack was online but had got lost from the stacks list, so was
> effectively invisible.
> It's listed now but here is a direct link
> 
>
> --
> Cheers,
> Sarah
>
> Rodeo discussion:
> http://rodeoapps.com/rodeo-discuss-among-yourselves
> ___
> 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: Drag and Drop on revBrowser...

2010-06-26 Thread Martin Koob

> >> 
> >> put the mouseScreenLoc into tLoc
> >> set the mouseScreenLoc to the topleft of this stack
> >> set the mouseScreenLoc to tLoc
> >> 

shouldn't this be the screenMouseLoc?

Martin

___
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: Call to all you one-liners !

2010-06-26 Thread Scott Rossi
Recently, Mark Schonewille wrote:

> put (fld 1 is a color and the number of items of fld 1 is 3) into
> myIsRGB

"...is a color..."  Gad, I never knew about this usage.  Good to know.

Thanks & Regards,

Scott Rossi
Creative Director
Tactile Media, UX 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


Re: Call to all you one-liners !

2010-06-26 Thread Mark Schonewille

Hi Francis,

put (fld 1 is a color and the number of items of fld 1 is 3) into  
myIsRGB


--
Best regards,

Mark Schonewille

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

Subscribe to the Economy-x-Talk newsletter at http://qurl.tk/cj
Download Clipboard Link http://clipboardlink.economy-x-talk.com and  
share the clipboard of your computer over the local network.


On 26 jun 2010, at 11:28, Francis Nugent Dixon wrote:


Hi from Beautiful Brittany,

My rev coding has always been simple, though
certainly not efficient, and of course, I
can solve this little problem, but I have
great confidence in you guys out there to
give me a one-liner.

I have a field that I would like to check out.
It should contain any RGB value (like 255,100,099),
but it came though the clipboard, and so may
contain anything.

Can this check be done in one line ?

-Francis

"Nothing should ever be done for the first time !"




___
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


Call to all you one-liners !

2010-06-26 Thread Francis Nugent Dixon

Hi from Beautiful Brittany,

My rev coding has always been simple, though
certainly not efficient, and of course, I
can solve this little problem, but I have
great confidence in you guys out there to
give me a one-liner.

I have a field that I would like to check out.
It should contain any RGB value (like 255,100,099),
but it came though the clipboard, and so may
contain anything.

Can this check be done in one line ?

-Francis

"Nothing should ever be done for the first time !"





___
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: Sarah Reichelt's XML sample stack

2010-06-26 Thread Sarah Reichelt
On Sat, Jun 26, 2010 at 12:36 PM, Simon Lord  wrote:
> Is Sarah still around?  I searched the archives for an XML sample
> stack to get my feet wet but her sample seems to be missing from her
> site (I can't find it to save my life).

Still here :-)

My XML stack was online but had got lost from the stacks list, so was
effectively invisible.
It's listed now but here is a direct link


-- 
Cheers,
Sarah

Rodeo discussion:
http://rodeoapps.com/rodeo-discuss-among-yourselves
___
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