Restored from previous forum. Originally posted by alizta.
it would be nice to be able to declare vars like that
Global Newlist glFooVar.l
---when all you have is a hammer, everything starts to look like a nail... ---
[Implemented] definition of global vars
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by ebs.
Yes - both arrays and linked lists ARE ALWAYS GLOBAL. From the help file:
Arrays are always globally accessable in PureBasic. This means that they can always be accessed from inside procedures without needing to use the Global or Shared commands.
Lists are always globally accessable in PureBasic. This means that they can always be accessed from inside procedures without needing to use the Global or Shared commands.
Eric
Yes - both arrays and linked lists ARE ALWAYS GLOBAL. From the help file:
Arrays are always globally accessable in PureBasic. This means that they can always be accessed from inside procedures without needing to use the Global or Shared commands.
Lists are always globally accessable in PureBasic. This means that they can always be accessed from inside procedures without needing to use the Global or Shared commands.
Eric
Originally posted by alizta
uhm.... no.
you can make them global... but it is kind of akward.
like
Global MyList
NewList MyList.YO_LIST()
---when all you have is a hammer, everything starts to look like a nail... ---
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by alizta.
i even tried before i posted... strange... i must have done something wrong... but i always declare global vars at the top of my code, since i come from c.
sorry for the caused anoyance.
---when all you have is a hammer, everything starts to look like a nail... ---
i even tried before i posted... strange... i must have done something wrong... but i always declare global vars at the top of my code, since i come from c.
sorry for the caused anoyance.
---when all you have is a hammer, everything starts to look like a nail... ---
-
- PureBasic Guru
- Posts: 16777133
- Joined: Tue Apr 22, 2003 7:42 pm
Restored from previous forum. Originally posted by freak.
> Global MyList
> NewList MyList.YO_LIST()
Variables and Linked Lists can have the same Name, because they are two different things.
So what you do here, is declare a Global LONG Variable and then a Linked List of YO_LIST Type(which is Global by design).
Timo
> Global MyList
> NewList MyList.YO_LIST()
Variables and Linked Lists can have the same Name, because they are two different things.
So what you do here, is declare a Global LONG Variable and then a Linked List of YO_LIST Type(which is Global by design).
Timo