Oxygen Basic
Information => Development => Topic started by: Peter on July 12, 2013, 06:50:13 AM
-
Deleted
-
Developer Peter,
#autodim off is what you are looking for. However this does not work with iterators yet. I will fix this on the next release.
Another useful switch is #unique on/off, which prevents anything from being defined more than once.
These switches can be turned on or off at any position of the program.
Any further ideas for code discipline? ;D
(http://www.theswarmite.com/wp-content/uploads/Images/dominatrix.jpg)
-
This program automatically creates 2 local variables: 'k' and 'sum'. However, this behaviour can often lead to unexpected bugs. For example, if you mistyped one of the 'sum' variables, the program would not work as expected. No error would be given - a new variable would simply be created.
FYI
ScriptBasic supports something similar.
declare option DeclareVars
declare option AutoVars
You can also control if variables used in functions/subs default to local scope. By default variables created within functions are global unless they are predefined as LOCAL prior to assignment within the function.
I personally like ScriptBasic's lazy / careful programming mode as the default. If I was doing a large project in SB, I would enable these language checks during the development cycle.
-
This image, is it a Microsoft logo?
No. I think it's Charles's vision of the golden arch for the new McDonald's campaign. :D
Would you beg and take a few lashes for a Big Mac (http://modernmeadow.com/)?
-
I love the humor!