Welcome to MacForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

How to change Upper\lower case in CW editor

 
   Macintosh computer (Home) -> Programmer Code RSS
Next:  once again .. stumped by apple  
Author Message
Alain Birtz

External


Since: Oct 27, 2003
Posts: 89



(Msg. 1) Posted: Thu Jul 31, 2003 9:18 pm
Post subject: How to change Upper\lower case in CW editor
Archived from groups: comp>sys>mac>programmer>codewarrior (more info?)

How to change the selected text from Upper case to lower case in CW 8.0
text editor ?

 >> Stay informed about: How to change Upperlower case in CW editor 
Back to top
Login to vote
Ben Combee

External


Since: Aug 01, 2003
Posts: 19



(Msg. 2) Posted: Fri Aug 01, 2003 9:01 am
Post subject: Re: How to change Upper\lower case in CW editor [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Alain Birtz wrote:

 > How to change the selected text from Upper case to lower case in CW 8.0
 > text editor ?

There's no standard way to do this. If you're using the CodeWarrior IDE
on Windows, I've got a COM plugin at

<a style='text-decoration: underline;' href="http://www.palmoswerks.com/gemsStorage/BCTextUtils.zip" target="_blank">http://www.palmoswerks.com/gemsStorage/BCTextUtils.zip</a>

that add this capability and a few other useful commands to the CW
editor. I've not ported this plugin to Mac OS, although it could be
possible using the CodeWarrior SDK.

--
Ben Combee <bcombee DeleteThis @metrowerks.com>
CodeWarrior for Palm OS technical lead
Palm OS programming help at <a style='text-decoration: underline;' href="http://www.palmoswerks.com/" target="_blank">http://www.palmoswerks.com/</a><!-- ~MESSAGE_AFTER~ -->

 >> Stay informed about: How to change Upperlower case in CW editor 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 1083



(Msg. 3) Posted: Fri Aug 01, 2003 9:21 am
Post subject: Re: How to change Upper\lower case in CW editor [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <abz-3107031818530001 DeleteThis @192.168.1.3>,
abz DeleteThis @videotron.ca (Alain Birtz) wrote:

 > How to change the selected text from Upper case to lower case in CW 8.0
 > text editor ?

Turn on the Scripts Menu (a checkbox in the Preferences dialog box,
IDE Extras panel.

Paste the following into an appleScript document, and save it as:
"Make Lower Case" in the (Scripts) folder in your Metrowerks Codewarrior
folder.

============

--Script to make the selection lower case.
--by David Phillip Oster 7/31/03

-- lower case a single char
on DoLowerCaseChar(local_char)
set upstr to "ABCDEFGHIJKLMNOPWRSTUVWXYZ"
set dnstr to "abcdefghijklmnopqrstuvwxyz"
set i to 1
repeat with c in upstr
if character i of upstr is equal to local_char then
return character i of dnstr
end if
set i to i + 1
end repeat
return local_char
end DoLowerCaseChar

-- lower case a string
on DoLowerCaseString(local_text)
set result_text to ""
set i to 1
repeat with c in local_text
set myC to DoLowerCaseChar(character i of local_text)
set result_text to result_text & myC
set i to i + 1
end repeat
return result_text
end DoLowerCaseString

on run
-- setup
tell application "CodeWarrior IDE"
-- get the text to lowercase
set the_text to selection of document 1
set the_val to DoLowerCaseString(the_text) of me
set selection of document 1 to the_val
end tell
end run

============
You now have a command that will lower case the current selection.

If you like it, please e-mail me a "thank you".<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to change Upperlower case in CW editor 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 1083



(Msg. 4) Posted: Fri Aug 01, 2003 7:03 pm
Post subject: Re: How to change Upper\lower case in CW editor [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article
<oster-F58ABC.23204831072003.TakeThisOut@newssvr21-ext.news.prodigy.com>,
David Phillip Oster <oster.TakeThisOut@ieee.org> wrote:
....
 > set upstr to "ABCDEFGHIJKLMNOPWRSTUVWXYZ"
^ should be 'Q'

sigh.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to change Upperlower case in CW editor 
Back to top
Login to vote
Ben Combee

External


Since: Aug 01, 2003
Posts: 19



(Msg. 5) Posted: Sat Aug 02, 2003 6:17 am
Post subject: Re: How to change Upper\lower case in CW editor [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

David Phillip Oster wrote:

 > In article <abz-3107031818530001 RemoveThis @192.168.1.3>,
 > abz RemoveThis @videotron.ca (Alain Birtz) wrote:
 >
 >
  >>How to change the selected text from Upper case to lower case in CW 8.0
  >>text editor ?
 >
 >
 > Turn on the Scripts Menu (a checkbox in the Preferences dialog box,
 > IDE Extras panel.
 >
 > Paste the following into an appleScript document, and save it as:
 > "Make Lower Case" in the (Scripts) folder in your Metrowerks Codewarrior
 > folder.

Cool... I forgot that the Mac OS editor has that nice AppleScript
integration. We have to resort to more desperate measures to do the
same thing on the Windows version of the CW IDE.
--
Ben Combee <bcombee RemoveThis @metrowerks.com>
CodeWarrior for Palm OS technical lead
Palm OS programming help at <a style='text-decoration: underline;' href="http://www.palmoswerks.com/" target="_blank">http://www.palmoswerks.com/</a><!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to change Upperlower case in CW editor 
Back to top
Login to vote
David Phillip Oste

External


Since: Apr 25, 2004
Posts: 1083



(Msg. 6) Posted: Sat Aug 02, 2003 7:57 am
Post subject: Re: How to change Upper\lower case in CW editor [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

In article <z3GWa.1578$jp.1216@newsread4.news.pas.earthlink.net>,
Ben Combee <combee DeleteThis @techwood.org> wrote:

 > David Phillip Oster wrote:
 >
  > > Paste the following into an appleScript document, and save it as:
  > > "Make Lower Case" in the (Scripts) folder in your Metrowerks Codewarrior
  > > folder.
 >
 > Cool... I forgot that the Mac OS editor has that nice AppleScript
 > integration. We have to resort to more desperate measures to do the
 > same thing on the Windows version of the CW IDE.

And I forgot that character <-> asciiValue conversion, although not
documented in the appleScript reference manual is part of the standard
additions, so the script really should look like this:
===============================
global numberOfA
global numberOfZ
on run
set numberOfA to ASCII number "A"
set numberOfZ to ASCII number "Z"
-- setup
tell application "CodeWarrior IDE"
-- get the text to lowercase
set the_text to selection of document 1
set the_val to DoLowerCaseString(the_text) of me
set selection of document 1 to the_val
end tell
end run


-- lower case a single char
-- bugs: ASCII only
on DoLowerCaseChar(local_char)
if (numberOfA ¾ (ASCII number local_char)) and ¬
((ASCII number local_char) ¾ numberOfZ) then
return ASCII character ((ASCII number local_char) + 32)
end if
return local_char
end DoLowerCaseChar

-- lower case a string
on DoLowerCaseString(local_text)
set result_text to ""
set i to 1
repeat with c in local_text
set myC to DoLowerCaseChar(character i of local_text)
set result_text to result_text & myC
set i to i + 1
end repeat
return result_text
end DoLowerCaseString
===============================

Also, you can use the the Key Bindings dialog box on the IDE's Edit menu
to assign a control-key to scripts you want to use frequently.

Also, since appleScript can run other scriptable applications, and Unix
shell scripts, you can easily do some amazing things.<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: How to change Upperlower case in CW editor 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
use of tab in the editor - I am new to code warrior. Could anyone please let me know why we need to use a tab in the editor before we start writing the code? do we really need it? regards kalyan,

[ANN] New Editor Features for CWDS Mac OS 9 - Some Editor Features: * Syntax coloring for Objective-C. * Just like we already do for C/C++, Java. * Function pop-up menu knows Objective-C methods. * You can move forward/backward a function at a time. * This option does not show up in the menus by..

Which Resource/Interface Editor should be used? - Hello I am having headache which resource editor I should be using. Is it a Preference thing or there is some significant advantage over one another? Here are most common i heard n i tried Interface Builder and ResEdit 1) ResEdit 2) Resorcerer 3)..

Editor: Move cursor to left on #if - I saw a feature on a friend's PC (using MSVC++) that would be really nice on CW. Pehaps there's a way to do it now that I'm not aware of. When he types #if, MSVC automatically moves it to the first column. Same thing when he types #else or #endif. ..

utf8 source code editor - We can't display UTF8 source code files correctly with CW9?! (CW even displays the BOM of the UTF8 source code files) Is UTF8 editor planned in the future release?! Regards, Miklós
   Macintosh computer (Home) -> Programmer Code All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]