Default decleration type?

Started by Baggey, October 24, 2024, 12:31:32

Previous topic - Next topic

Baggey

In BlitzMax you can use Superstrct, strict or not bother att all!

When you dont make a SuperStrict decleration what is the Default?

ie, in Superstrict you have to declare Address:short or LSB:byte etc..

But when you dont what id is the Default set as? ::)

Thankyou in advance Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on Acer 24" . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!

Midimaster

#1
ALWAYS...
Don't think about it. Use always SUPERSTRICT !!!

SOMETIMES...
There are only a few situations, where an old source code makes problems (compiler error messages or syntax error messages), if SUPERSTRICT is active. Only in those cases, you can think about remove the SUPERSRICT headline. But also in these situations you should better think about the reason, why SUPERSTRICT reports a problem and whether you should better solve it.

Not having SUPERSTRICT means, that MaxIde does not check your code for error and you will need hours of finding a bug like this

MyTemplateasiiiCodeForAt="@"
....
Print MyTemplateasiiCodeForAt

' my problem this does not print the @!!! Why?



...back from North Pole.

Henri

In BlitzmaxNg the default is Strict. In Strict mode if you don't declare your variable type it defaults to Int. This is also true for function return value if not defined (SuperStrict can have a void return value).

E: Also as Midimaster mentioned the debugscope is larger for SuperStrict. If you compile your code in release mode it doesn't matter for the end result as there is no debugscope.

-Henri
- Got 01100011 problems, but the bit ain't 00000001

Steve Elliott

I completely agree with Midimaster, I think it was a major mistake to allow this non standard 'do what you want' approach to a new language.
Win11 64Gb 12th Gen Intel i9 12900K 3.2Ghz Nvidia RTX 3070Ti 8Gb
Win11 16Gb 12th Gen Intel i5 12450H 2Ghz Nvidia RTX 2050 8Gb
Win10/Linux Mint 16Gb 4th Gen Intel i5 4570 3.2GHz, Nvidia GeForce GTX 1050 2Gb
Linux Mint 8Gb Celeron Intel UHD Graphics600
macOS Sequoia 64Gb M4 Max
Spectrum Next 2Mb

Baggey

Quote from: Steve Elliott on October 24, 2024, 16:05:08I completely agree with Midimaster, I think it was a major mistake to allow this non standard 'do what you want' approach to a new language.
I do as well because when you look at old code example's it can be programmed badly!? :-X

However i'd still like the GOTO ::)

Baggey
Running a PC that just Aint fast enough!? i7 4Ghz Quad core 32GB ram  2x1TB SSD and NVIDIA Quadro K1200 on Acer 24" . DID Technology stop! Or have we been assimulated!

Windows10, Parrot OS, Raspberry Pi Black Edition! , ZX Spectrum 48k, C64, Enterprise 128K, The SID chip. Im Misunderstood!