Page 1 of 1

Case control (suggestion)

Posted: Tue Jan 04, 2022 9:19 am
by Joubarbe
Would it be possible to have complete control over upper / lower case of constants, keywords and procedures? Including built-in items and standard libraries. I think it would be more elegant and readable to have everything lower case, except for #CONSTANTS, like modern languages.

Re: Case control (suggestion)

Posted: Tue Jan 04, 2022 10:10 am
by Marc56us
Joubarbe wrote: Tue Jan 04, 2022 9:19 am Would it be possible to have complete control over upper / lower case of constants, keywords and procedures? Including built-in items and standard libraries. I think it would be more elegant and readable to have everything lower case, except for #CONSTANTS, like modern languages.
(Pure)BASIC is not case sensitive.
You can disable the auto-correction of the IDE and write as you want.
Preferences > Editor > Editing > [ ] Enable Case correction
:wink:

Re: Case control (suggestion)

Posted: Tue Jan 04, 2022 10:47 am
by Joubarbe
No that doesn't work. If you use autocomplete (and of course you do), standard functions will be capitalized. Same for constants (and I would like them UPPERCASE). This case correction option doesn't really do much.

Re: Case control (suggestion)

Posted: Tue Jan 04, 2022 11:18 am
by Marc56us
Yes, but It was not specified at first that you wanted this option with auto-completion.
Or typing error?
Would it be possible to have complete control over upper / lower case
No that doesn't work. If you use autocomplete
Thank you for being precise in question and translations :wink:
Yes, you are right, auto-completion auto change case even with uncheck option.

Re: Case control (suggestion)

Posted: Tue Jan 04, 2022 11:38 am
by BarryG
[Edit] Doing the below is probably against the Terms and Conditions of PureBasic's license. If you do it anyway, you must NOT share the modified files!

If the team doesn't do your request: you can hack it, but it's a lot of work. (Although you could write a tool to automate it). All you need to do is hex edit all the commands in all files the "PureLibraries" folder, and rename them to be lower-case. Then the editor will auto-complete them to that case.

I just tested it by editing the "PureLibraries\Clipboard" file to rename GetClipboardText() to getclipboardtext():

Image

Then, in the editor, it auto-completes like this:

Image

Just make sure you don't leave any backup files in the library folder, or PureBasic will complain about duplicate commands. (I use HxD to edit, and it creates a ".bak" file after editing, which I need to delete to avoid the PureBasic warning).

So... a nice little coding project for you to bulk-convert all the commands in the folder? Hehe.

Re: Case control (suggestion)

Posted: Tue Jan 04, 2022 11:42 am
by Joubarbe
Haha, too complicated :)
Maybe I should look at the IDE source actually... It's on GitHub now.