No error but... is the same?
Dim & Define Dim ???
Dim & Define Dim ???
Which is the purpose of Define Dim over symple Dim?
No error but... is the same?
No error but... is the same?
Re: Dim & Define Dim ???
Can probably be left out
Code: Select all
EnableExplicit
Dim vars(10)
Procedure foo()
Shared vars()
Debug vars()
EndProcedure
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Dim & Define Dim ???
It's the same.
Re: Dim & Define Dim ???
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?
If inside a procedure with Explicit enabled, I don't have to do Protected/Define NewMap. But what's the default in this case?
Re: Dim & Define Dim ???
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?
Last edited by Demivec on Wed May 10, 2023 8:31 am, edited 1 time in total.
Re: Dim & Define Dim ???
My understanding of define was to change the default variable type.
Define.f x,y,z
Define.f x,y,z
Re: Dim & Define Dim ???
Declare variables only for MainScope and can be used with shared in procedures.
This is how I understood it.
This is how I understood it.
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: Dim & Define Dim ???
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.


