find and replace

Jan Schenkel janschenkel at yahoo.com
Wed Apr 4 01:04:25 EDT 2007


--- Lars Brehmer <larsbrehmer at mac.com> wrote:
> Hi all,
> 
> I am trying to duplicate the find and replace tool
> in the rev IDE in  
> a button script.  I have a large project in macOSX
> that needs a few  
> dozen little tweeks when I make a Windows
> standalone.  I put these  
> all into a button so when I make a new Windows
> standalone just one  
> click gives me all the little changes.  The one
> thing I haven't  
> succeeded in is a single word that appears in about
> 20 button and  
> stack scripts. It seems that "visualEffect reval"
> needs to be  
> "visualEffect wipe" to get the same result in
> Windows.  So for now I  
> just do a find and replace with the "scripts" box
> checked, but it  
> would be nice to include this in my tweek button in
> order to doo all  
> tweeks without opening Rev. I assume it's just a
> question of getting  
> the syntax correct for:
> 
> replace "reveal" with "wipe" in this stack and its
> stack files --  
> using the find and replace tool with scripts checked
> 
> What should it be?
> 
> Cheers,
> 
> Lars
> 

Hi Lars,

You'd have to go through all the cards, then through
all the controls on that card, to get the script,
replace reveal with wipe, and then set the script of
the control again.

##
on mouseUp
  put the number of cards into tNumCards
  repeat with i = 1 to tNumCards
    go card i
    put the number of controls into tNumControls
    repeat with j = 1 to tNumControls
      get the script of control j
      replace "reveal" with "wipe" in it
      set the script of control j to it
    end repeat
  end repeat
  answer "Done!"
end mouseUp
##

Wouldn't it be easier if you kept the transition
separate in a custom handler that you could call from
other places?

##
on MyVisualEffect pEffect
  switch pEffect
  case "wipe"
  case "reveal"
    if the platform is "MacOS" then
      visual effect wipe
    else
      visual effect reveal
    end if
    break
  default
    do ("visual effect && pEffect)
    break
  end switch
end MyVisualEffect
##

That way you can centralize this sort of
platform-specific modifications.

Hope this helped,

Jan Schenkel.

Quartam Reports for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)



 
____________________________________________________________________________________
Need Mail bonding?
Go to the Yahoo! Mail Q&A for great tips from Yahoo! Answers users.
http://answers.yahoo.com/dir/?link=list&sid=396546091



More information about the use-livecode mailing list