superstrick

BlitzMax Forums/BlitzMax Programming/superstrick

Paul "Taiphoz"(Posted 2011) [#1]
this wee bit of code wont compile, and tbh iv never really read up on extern much I got this from another post so dont fully understand whats wrong with it. or what strict dont like about it.

Extern "win32"

	Function SystemParametersInfo2(uiAction, uiParam, pvParam$z, fWinIni) = "SystemParametersInfoA@16"

End Extern



ProfJake(Posted 2011) [#2]
Extern "Win32"

	Function SystemParametersInfoA:Int(uiAction:Int, uiParam:Int, pvParam:Byte Ptr, fWinIni:Int)

End Extern


Try this.


Floyd(Posted 2011) [#3]
SuperStrict insists that variables and functions have an explicit type, even for integers. You can use % or :Int.
Function SystemParametersInfo2%(uiAction%, uiParam%, pvParam$z, fWinIni%) = "SystemParametersInfoA@16"


Edit: I'm too late by nine seconds!

Last edited 2011


Paul "Taiphoz"(Posted 2011) [#4]
I actually tried that given the error is a missing type specifier
Function SystemParametersInfo2:int(uiAction, uiParam, pvParam$z, fWinIni) = "SystemParametersInfoA@16"


I get same error with the above.


GfK(Posted 2011) [#5]
The code in post #5 still does not have identifiers for the function parameters. As said before, these are mandatory in SuperStrict mode.


Paul "Taiphoz"(Posted 2011) [#6]
Ah now I get it.

Last edited 2011


ProfJake(Posted 2011) [#7]
You should always use SuperStrict mode anyway.


GfK(Posted 2011) [#8]
You should always use SuperStrict mode anyway.
...unless you don't want to. Strict is "strict" enough.


ProfJake(Posted 2011) [#9]
As far as I know it's the fastest and also the most readable mode, therefore I always use it.

Of course this is also a question of personal preferences I guesss : )


Czar Flavius(Posted 2011) [#10]
There are only two modes, strict and rubbish. Strict and superstrict are just varients where one has a shortcut. Or superstrick as it's sometimes known.