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

Post bugreports for the Windows version here
acreis
Enthusiast
Enthusiast
Posts: 235
Joined: Fri Jun 01, 2012 12:20 am

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

Post 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
User avatar
jacdelad
Addict
Addict
Posts: 2032
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

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

Post by jacdelad »

Isn't End a reserved keyword?
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
acreis
Enthusiast
Enthusiast
Posts: 235
Joined: Fri Jun 01, 2012 12:20 am

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

Post by acreis »

Good question!

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

end is not a reserved word in c language.
User avatar
jacdelad
Addict
Addict
Posts: 2032
Joined: Wed Feb 03, 2021 12:46 pm
Location: Riesa

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

Post by jacdelad »

I don't think the IDE has different sets of keywords for different sections.
Good morning, that's a nice tnetennba!

PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
User avatar
kenmo
Addict
Addict
Posts: 2054
Joined: Tue Dec 23, 2003 3:54 am

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

Post 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).
User avatar
kenmo
Addict
Addict
Posts: 2054
Joined: Tue Dec 23, 2003 3:54 am

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

Post by kenmo »

Ah, I did not see your bug report, and I guess neither did acreis. "Bugs - IDE" is the correct place for this.
Post Reply