It is currently Mon Nov 30, 2020 6:47 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: case correction inside quotes
PostPosted: Tue Jul 07, 2020 8:48 am 
Offline
User
User

Joined: Sun Feb 02, 2020 9:14 am
Posts: 28
This has been a pressing concern for a while now, and it's getting really annoying, so I figured I may as well post about it here.
Let's say I have a string for a button that is called "back to main screen"
Well, pure basic randomly capitalized the To, but sometimes it did and sometimes not, causing identification of the used thing via if expressions to become extremely tedious
For a more accurate representation of what has been happening:
listviewgadget
in listviewgadget, 3 items, view intentory, item shop and back to main screen.
If user selected back to main screen, go back to main screen
But one of them were capitalized and the other not.
Could this please be fixed?

// Not a bug. Moved "The PureBasic Editor" (Kiffi)


Top
 Profile  
Reply with quote  
 Post subject: Re: [urgent] case correction inside quotes
PostPosted: Tue Jul 07, 2020 8:59 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Jan 22, 2016 5:33 pm
Posts: 134
Location: Spain
Post a working code so we can test it.


Top
 Profile  
Reply with quote  
 Post subject: Re: [urgent] case correction inside quotes
PostPosted: Tue Jul 07, 2020 11:19 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 263
Location: Edinburgh, Scotland.
I have never found that the IDE does this "randomly". It happens when you delete a quote mark and move away from that line. Which *is* kinda annoying, but I accept it.

Alternatively, you could turn off case correction in the options, which is not ideal imo, but PB is case-insensitive after all.

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
 Post subject: Re: case correction inside quotes
PostPosted: Tue Jul 07, 2020 2:22 pm 
Offline
Enthusiast
Enthusiast

Joined: Wed May 27, 2020 12:26 pm
Posts: 180
Personnally, all options are shut down for me : auto-indent, auto-completion, case correction, debugger etc...

It just stays the highlighting system, and the [Control]+[I] options : this modifies the source exactly when I want.
There is the whole syntax command too, in the bar system.

Finally... I keep 2 or 3 options, but all that modifies automatically the code has been removed. I think these options are good when we want to discover a new version, new features, or when we are beginners. But, once we know the basis, it could be more useless than useful.

I see what rory-games is talking about : a "multi-concatenated" string source code line.
Code:
A$ = "Name : " + Name$ + Chr(9) + "Hobby : " + Hobby$ + Chr(9) + "Etc..."
I suggest, that,

this system, this automatic one, should execute this source code modifying, only if assertions.

I suggest, that,

these assertions, should be as booleannally true, if
Code:
CountString(SourceCodeLine$, Chr(34) ) <= 2
I have a question :

How could I know, howmany bytes must be allocated to load file datas of the IDE source code ?


Thank you


Top
 Profile  
Reply with quote  
 Post subject: Re: case correction inside quotes
PostPosted: Tue Jul 07, 2020 10:04 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 263
Location: Edinburgh, Scotland.
I don't know why you are overcomplicating it. It is simply a quote pair "problem", which exists in other editors and is not specific to PureBasic. A similar type of thing happens on Commodore 64 even :)

To overcome the "problem" one would need to introduce stupid logic to the case correction, and IMO is simply not worth it.

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
 Post subject: Re: case correction inside quotes
PostPosted: Tue Jul 07, 2020 10:57 pm 
Offline
Always Here
Always Here

Joined: Fri Oct 23, 2009 2:33 am
Posts: 6262
Location: Wales, UK
Quote:
exists in other editors

Absolutely true. UltraEdit, for all it's whistles and bells, is the same. The trick is to place opening and closing quotes first, then insert your text.

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
Reply with quote  
 Post subject: Re: case correction inside quotes
PostPosted: Wed Jul 08, 2020 2:37 am 
Offline
Addict
Addict

Joined: Thu Apr 18, 2019 8:17 am
Posts: 1090
oreopa wrote:
A similar type of thing happens on Commodore 64 even

Example? I've never seen this on C64 (case-changing when editing a line).


Top
 Profile  
Reply with quote  
 Post subject: Re: case correction inside quotes
PostPosted: Wed Jul 08, 2020 2:45 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 263
Location: Edinburgh, Scotland.
BarryG wrote:
oreopa wrote:
A similar type of thing happens on Commodore 64 even

Example? I've never seen this on C64 (case-changing when editing a line).


Sorry. I wasn't clear. I was just referring to the fact the C64 also has *a* double quotes "problem". An entirely different one, albeit.

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
 Post subject: Re: case correction inside quotes
PostPosted: Wed Jul 08, 2020 6:58 am 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 3756
Location: Utah, USA
The PureBasic IDE has several situations where problematic case correction occurs. I encounter them often. The ones I list deal with quotes and comments.

Here are the ones I encounter:

  • When the initial ';' is deleted accidentally from the start of a comment. This sometimes happens if pressing [Ctrl+Shift+B] while being anywhere within the line.
    Code:
    ;select csv data file or files to add to database.
    ;Select csv Data file Or files To add To database. ;deleted ';' from previous line and then undid the action

    Only solution to this is to simply be careful.

  • When pasting multiple lines of text that would become a comment but this has since been fixed by adding options to paste multi-lined text as comments where a ';' is added automatically at the beginning of each line.
    Code:
    ;This is the original quote and for this example it is already broken up into separate lines.
    A database is an organized collection of data, generally stored and accessed
    electronically from a computer system. Where databases are more complex they
    are often developed using formal design and modeling techniques.

    ;The three line quote is pasted by pasting [Ctrl+Shift+V]
    ;A database is an organized collection of data, generally stored and accessed
    ;electronically from a computer system. Where databases are more complex they
    ;are often developed using formal design and modeling techniques.

    ;The three line quote is pasted first and then ';' is added at the front of each line manually.
    ;A database is an organized collection of Data, generally stored And accessed
    ;electronically from a computer system. Where databases are more complex they
    ;are often developed using formal design And modeling techniques.

    ;There is one more possible problem situation where a commented quote is longer than desired
    ;and is broken up by pressing return and then adding the ';' to the new line.  This is solved by typing the ';' first and then pressing return in front of that new ';' so that the new line is treated as a comment right from the start.  The portion of the line that will become a new comment line can also be highlighted, cut [Ctrl+X], and pasted as a comment on the next line by using [Ctrl+Shift+V].

  • When breaking up an already quoted string into smaller parts to make use of concatenation.
    Code:
    shape$ = "Box"
    ;edit the following line by modifying it to adding the concatenation of shape$ and remove the word 'point'.
    a$ = "Draw a line or point while holding the right button and stop only if needed."
    a$ = "Draw a line or " + shape$ + "While holding the right button And stop only If needed."

    The only solutions to this are to retype the whole line after the first character that differs or perhaps to paste in two quotes first '""' into the middle of the string. Both of these choices leave something to be desired. A good solution might be if the case correction can be turned off until the cursor moves to a different line.

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject: Re: case correction inside quotes
PostPosted: Wed Jul 08, 2020 2:03 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Sat Jun 24, 2006 3:29 am
Posts: 263
Location: Edinburgh, Scotland.
Demivec wrote:
A good solution might be if the case correction can be turned off until the cursor moves to a different line.


I thought of this myself, then I realized that it's more often than not that I actually press cursor up/down by accident whilst editing a string - triggering this situation in the first place :D So it really wouldn't fix anything for me.

I think I will use your earlier mentioned solution...
Demivec wrote:
Only solution to this is to simply be careful

:D

_________________
Proud supporter of PB! * Musician * C64/6502 Freak


Top
 Profile  
Reply with quote  
 Post subject: Re: case correction inside quotes
PostPosted: Wed Jul 08, 2020 11:09 pm 
Offline
Addict
Addict
User avatar

Joined: Mon Jul 25, 2005 3:51 pm
Posts: 3756
Location: Utah, USA
I've given this some thought and made the realization that we don't need to implement additional logic In the IDE's case correction. Since the situations where problems occur are identifiable from a user's perspective perhaps some keypresses could be implemented to turn the case correction on/off or simply to toggle it. An indicator can also be added that shows whether case correction is active or not.

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 7 guests


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

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye