Initialize variables
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Initialize variables
It would speed coding if SPL would initialize undefined numeric variables to 0 and string variables to "" on first use, the way you handled them in SB, rather than terminating the program with an error.
The only thing that gets me down is gravity...
- Mr. Kibernetik
- Site Admin
- Posts: 4786
- Joined: Mon Nov 19, 2012 10:16 pm
- My devices: iPhone, iPad, MacBook
- Location: Russia
- Flag:
Re: Initialize variables
This blocks incorrect objects from usage.
For example, if you have an object "aaa" and then misspell it as "aab" so you will get an error instead of silent usage using 0 value.
Also, SPL does not know if it is a text or a numeric object to initialize it to 0 or "".
For example, if you have an object "aaa" and then misspell it as "aab" so you will get an error instead of silent usage using 0 value.
Also, SPL does not know if it is a text or a numeric object to initialize it to 0 or "".
- rbytes
- Posts: 1338
- Joined: Sun May 31, 2015 12:11 am
- My devices: iPhone 11 Pro Max
iPad Pro 11
MacBook
Dell Inspiron laptop
CHUWI Plus 10 convertible Windows/Android tablet - Location: Calgary, Canada
- Flag:
- Contact:
Re: Initialize variables
I can see the value of that. Maybe it would have been better to suggest introduction of error trapping so the program can be made recoverable.
The only thing that gets me down is gravity...