Page 1 of 1

PureBasic editor changes lowercase variable names to capitalized form inside `HeaderSection` (e.g., `end` → `End`)

Posted: Sun Oct 26, 2025 12:08 pm
by acreis
While working with PureBasic x86 6.30 beta4, I encountered an issue where the editor automatically changes the capitalization of variable names inside the `HeaderSection`. For example, when declaring a variable named `end`, the editor modifies it to `End`. This behavior is problematic because C is case-sensitive, and such changes lead to unexpected behavior or compilation errors.

1. Open PureBasic x86 6.30 beta4.
2. Create a new source file and define a `HeaderSection`.
3. Inside the `HeaderSection`, declare a variable using lowercase:

Code: Select all

   HeaderSection
     end = 0;
   EndHeaderSection
```
4. Save, Close, Open
Observe that the editor changes `end` to `End` automatically on Open.

Expected Behavior:
The editor should preserve the original capitalization of variable names.


Environment:
- Editor: PureBasic x86 6.30 beta4
- OS: Windows 11

Re: PureBasic editor changes lowercase variable names to capitalized form inside `HeaderSection` (e.g., `end` → `End`)

Posted: Sun Oct 26, 2025 4:08 pm
by jacdelad
Isn't End a reserved keyword?

Re: PureBasic editor changes lowercase variable names to capitalized form inside `HeaderSection` (e.g., `end` → `End`)

Posted: Sun Oct 26, 2025 5:49 pm
by acreis
Good question!

It seems that HeaderSection is to hold 'c code'.

end is not a reserved word in c language.

Re: PureBasic editor changes lowercase variable names to capitalized form inside `HeaderSection` (e.g., `end` → `End`)

Posted: Mon Oct 27, 2025 9:01 am
by jacdelad
I don't think the IDE has different sets of keywords for different sections.

Re: PureBasic editor changes lowercase variable names to capitalized form inside `HeaderSection` (e.g., `end` → `End`)

Posted: Mon Oct 27, 2025 1:38 pm
by kenmo
Within a HeaderSection auto case correction should probably not be applied... I'm surprised more people aren't reporting this 6.30 beta problem... :!:
In my experience with C functions in HeaderSection, the IDE will change return to Return (for example) which causes the compile to fail (C is case sensitive, "Return" is invalid).

Re: PureBasic editor changes lowercase variable names to capitalized form inside `HeaderSection` (e.g., `end` → `End`)

Posted: Mon Oct 27, 2025 2:50 pm
by User_Russian

Re: PureBasic editor changes lowercase variable names to capitalized form inside `HeaderSection` (e.g., `end` → `End`)

Posted: Mon Oct 27, 2025 4:05 pm
by kenmo
Ah, I did not see your bug report, and I guess neither did acreis. "Bugs - IDE" is the correct place for this.