EControl Ltd. Forum Index EControl Ltd.
VCL libraries and software support forum
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

smUpperCaseBlock..smTitleCaseBlock and strings

 
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor
View previous topic :: View next topic  
Author Message
mstaszew



Joined: 21 Jul 2006
Posts: 67
Location: North Carolina, USA

PostPosted: Mon Aug 28, 2006 8:31 pm    Post subject: smUpperCaseBlock..smTitleCaseBlock and strings Reply with quote

Is there a way to have the following commands smUpperCaseBlock, smLowerCaseBlock, smToggleCaseBlock, smTitleCaseBlock not change the case of strings?

Thanks.
Back to top
View user's profile Send private message
jfudickar



Joined: 12 Jun 2006
Posts: 38
Location: Eschborn, Germany

PostPosted: Tue Aug 29, 2006 3:41 pm    Post subject: Reply with quote

Good idea Exclamation
Back to top
View user's profile Send private message Visit poster's website
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Wed Aug 30, 2006 8:11 am    Post subject: Reply with quote

Do you want to turn them off?

It may be handled in OnExecuteCommand or by reseting keystrokes in the keymapping.

Michael.
Back to top
View user's profile Send private message Send e-mail
mstaszew



Joined: 21 Jul 2006
Posts: 67
Location: North Carolina, USA

PostPosted: Wed Aug 30, 2006 1:16 pm    Post subject: Reply with quote

No, I would like the case changes to apply to all non-string text.

thanks.
Back to top
View user's profile Send private message
econtrol
Site Admin


Joined: 09 Jun 2006
Posts: 202

PostPosted: Sun Sep 03, 2006 8:33 am    Post subject: Reply with quote

Really I do not understand. What does it mean "non-string" text?

Michael.
Back to top
View user's profile Send private message Send e-mail
itsatomic



Joined: 12 Jun 2006
Posts: 38

PostPosted: Mon Sep 04, 2006 2:56 am    Post subject: Reply with quote

Original text:

this is an example of some lowercase text, with a "string" in it.

After UppercaseBlock:

THIS IS AN EXAMPLE OF SOME LOWERCASE TEXT, WITH A "string" IN IT

Possible gotcha examples:
1. determining string delimiters
2. incomplete strings in blocks
------------------

It's an interesting idea, but this idea, along with the "assignment swap" idea (ie a := b becomes b := a) are beyond the scope of an editor control per se (just my opinion). If Michael develops the entire editor (application, not control) for us, we will quickly become redundant. I would prefer Michael's valuable time went into documentation for a cycle or two.

sincerely,
Aaron
Back to top
View user's profile Send private message
mstaszew



Joined: 21 Jul 2006
Posts: 67
Location: North Carolina, USA

PostPosted: Tue Sep 05, 2006 1:51 pm    Post subject: Reply with quote

I disagree with you Aaron given the user audience of my application. I write software for other developers. If you as a developer have come to use an upper/lower/title case routine then you can see how capitalization changes in strings can be very bad. In the case of my users, these case changes will most likely break their code since Oracle strings are case sensitive when used to query Oracle tables/views. In other cases like if I myself used such a feature in Delphi then my user messages and prompts would be out of their intended case.

>Possible gotcha examples:
>1. determining string delimiters
>2. incomplete strings in blocks

Regarding #1. This feature of course would/could be built off of the existing architecture. All of the lexers in LexLib.lxl have a string Parser rule. I think that the string parser rule would be sufficient to use for locating strings. This rule would also satisfy your second example above. If the string rule is not satisfied then the case changes apply as normal. To remove a possible third gotcha, maybe the feature could just be one additional property of the editor that accepts a string. This string would be the name of the parser rule that should be used for ignored tokens when changing the case of text. If the parser rule specified does not exist then the case changes apply to all selected text as it does now.

>but this idea, along with the "assignment swap" idea

I haven't seen the assignment swap post yet, but the two are apples and oranges. Assignment swap I can definately see as being a specific request for one of the users, but the issue about strings is in my opinion an editor feature.

Thanks.
Back to top
View user's profile Send private message
itsatomic



Joined: 12 Jun 2006
Posts: 38

PostPosted: Wed Sep 06, 2006 11:47 pm    Post subject: Reply with quote

When I was in second year at uni, we used Vi on a Unix box to write cobol assignments (*shudder*). Cobol standard is uppercase, the vi command to move 20 lines down is 20j, but uh oh, you're still in uppercase, and 20J means join the following 20 lines into one. *Headache*

So I wrote all my assignments in lower case and wrote a simple C program that parsed my assignments, uppercasing everything except comments.

You don't want comments uppercased / lowercase / title cased either do you?

I have often had code where I copy a block and want to swap assignment around, but never used a function to upper or lower case entire blocks of code before. That's why I equated the two (I've never seen an editor do either before).

My user audience is also developers. I guess my point was I would be prepared to program an "ignore strings" function into the editor as the developer of the editor application - and the assignment swapping routine also - as they are things that will differentiate my editor from others. I am not saying they should not be done.
Back to top
View user's profile Send private message
mstaszew



Joined: 21 Jul 2006
Posts: 67
Location: North Carolina, USA

PostPosted: Thu Sep 07, 2006 1:14 pm    Post subject: Reply with quote

I never use upper/lower/title case features personally. I usually code the way that I want and run a formatter like DelFor afterwards in case I missed anything. I only ask for this because our old editor component did have settings for ignoring strings and when you have a ton of users and drop something like this on them then after the ohhs and ahhs wear off the griping starts Sad Not sure if the old editor ignored comments though. I'll look at doing it in ExecCommand manually. It didn't hurt to ask.

Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    EControl Ltd. Forum Index -> EControl Syntax Editor All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group