Dim & Define Dim ???
Posted: Tue May 09, 2023 12:48 pm
Which is the purpose of Define Dim over symple Dim?
No error but... is the same?
No error but... is the same?

http://www.purebasic.com
https://www.purebasic.fr/english/
Code: Select all
EnableExplicit
Dim vars(10)
Procedure foo()
Shared vars()
Debug vars()
EndProcedure
NewMap creates maps as locals. This is the same as what Define does to make a variable local in scope. If you need something different you would have to specify it.Quin wrote: Tue May 09, 2023 6:14 pm Does this also apply to things like NewMap?
If inside a procedure with Explicit enabled, I don't have to do Protected/Define NewMap. But what's the default in this case?
This was my understanding too. It's also helpful with Explicit enabled.mk-soft wrote: Wed May 10, 2023 10:17 am Declare variables only for MainScope and can be used with shared in procedures.
This is how I understood it.