![]() ![]() |
![]() ![]() Post #1 | |
![]() Coding like a Rockstar! ![]() Posts: 1,468 From: ??? Joined: 28-May 09 ![]() | Sanny Builder Hacks There are many ways to trick Sanny Builder (or any program, really) into doing things it wasn't made to which can give some positive effects. At the moment, not too much use has been found.. but as far as I know, I'm the first to attempt such things.. and further looking into how Sanny Builder reacts to certain hacks may open up some interesting compiler abilities. Uncompilable Constants const ThisConstantIsCompiled = 1336 { ThisConstantGivesAnError = 1337 } end ![]() ![]() This could be useful if you want a value to show up in the window, but don't want to use it as a constant. Showing Only Constant Values So what if you wanna remove the constant from view altogether? Using backslash "\" escapes characters in many programming languages... So I tried using these to perform some more tricks, such as this: const { \ShowThisValue = 1 } end ![]() In fact, commenting the constant lines out is crucial.. otherwise Sanny throws an "Illegal char in constant" error. Inline Thread Label Descriptions This is a pretty handy one... :MyFunc{__[int]_(param1,_param2,_param3)_} Etc.. When you type @ to open up the list of labels, the commented code will show. When you select a label, the commented code will be inserted at the caret. Spaces will break it up, so use the underscore character in place of spaces. I usually use a format of [type] for the returned type and (param1,...) for the argument list, using hungarian notation to depict the type. This is especially useful for SCM Functions if you need an easier way to remember how many parameters to send to and retrieve from the function. Additionally, you can use the escape character \ after the opening block comment character { to remove the rest of the comment from the labels list, so it only inserts into the code when you select it. Hiding Labels Another handy one for big scripts... {$CLEO} 0000: {}:Label wait 0 jump @Label The example will compile fine, but @Label will not show up in the list of labels when you hit @. In fact, in this example.. no window will pop up as there are no labels to display. Useful for hiding labels you dont need often or dont want to be further used. Commenting Out Code With Syntax Highlighting {$CLEO} 0000: {//} :Label WAIT 0 GOTO @Label } 0000: When compiled, the file will contain: 0000: 0000: The line comments "//" disable the closing brace of the block comment when compiled.. but the code inbetween is left highlighted appropriately. Not much too useful so far, but keep trying random stuff like this and who knows.. we might uncover a way to stop Sanny Builder compiling IF when not needed ![]() -------------------- | CLEO 4.3.22 | A?i?a?o?3D | UI SDK | Black Market Mod 1.0.1 | GInput 0.3 | Cheat Keyboard | Tactile Cheat Activation | Stream Ini Extender 0.7 | SuperVars | ScrDebug | Vigilante Justice: San Andreas | |
![]() ![]() |