[Solved] Global Chr() problem

Just starting out? Need help? Post your questions and find answers here.
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: Global Chr() problem

Post by BarryG »

The Global is outside of any conditional statements. The folding lines drawn are a bug that I've never reported. :)

Anyway, marking this as Solved because I think there must be a thread calling the variable before the Global line for it was reached.
boddhi
Enthusiast
Enthusiast
Posts: 524
Joined: Mon Nov 15, 2010 9:53 pm

Re: Global Chr() problem

Post by boddhi »

TassyJim wrote: Looking at the image of your source, the 'folding line' beside the line numbers suggest that the Global has been declared within a conditional statement of some sort.
This is not always true. Particularly if you place a set of instructions inside the folding pair ";{" and ";}". :wink:

Code: Select all

;{ Procedures
Procedure A()
  [...]
EndProcedure

Global Variable

Procedure A()
  [...]
EndProcedure
;}

If my English syntax and lexicon are incorrect, please bear with Google translate and DeepL. They rarely agree with each other!
Except on this sentence...
DarkDragon
Addict
Addict
Posts: 2347
Joined: Mon Jun 02, 2003 9:16 am
Location: Germany
Contact:

Re: Global Chr() problem

Post by DarkDragon »

BarryG wrote: Sat Mar 23, 2024 12:13 am The Global is outside of any conditional statements. The folding lines drawn are a bug that I've never reported. :)

Anyway, marking this as Solved because I think there must be a thread calling the variable before the Global line for it was reached.

Code: Select all

Debug Len(extdot$)
Check the length please to see whether the value has changed or write it into some file. Global is only for the compiler, there's no runtime interpretation of "Global". That means all code after the Global sees this variable as Global, all code before cannot. Make sure to use EnableExplicit and declare all variables.
bye,
Daniel
User avatar
charvista
Addict
Addict
Posts: 949
Joined: Tue Sep 23, 2008 11:38 pm
Location: Belgium

Re: [Solved] Global Chr() problem

Post by charvista »

I have never seen your screenshot, as it is apparently removed. [Edit: they appeared suddenly later :o ]
My thought:
If the debug uses a different font than your program, then chances are big that the debug font does not have the shape for that character, hence the emptiness.
- Windows 11 Home 64-bit
- PureBasic 6.10 LTS (x64)
- 64 Gb RAM
- 13th Gen Intel(R) Core(TM) i9-13900K 3.00 GHz
- 5K monitor with DPI @ 200%
BarryG
Addict
Addict
Posts: 4219
Joined: Thu Apr 18, 2019 8:17 am

Re: [Solved] Global Chr() problem

Post by BarryG »

I used a MessageRequester too, and I tested with Len() for it. Null and 0 were the results. :)
Post Reply