
#Purebasic goto code
I used over 97% of the instruction set, and while I had the presumption of rewriting some of his code to make it more concise, I could not improve on his approaches or algorythms. The best programmer I ever knew used only about 15% of the available commands, but he wrote some fantastic programs that pushed the envelope all over the place. Don't waste your time trying to come up with some other method and convoluting your code in some meaningless or ineffectial manner just to satisfy someone that hasn't the wisdom to reason this out for themselves. Pushing the envelope would not include listening to anyone who repeats "Don't ever use GoTo statements in your programs, it is a bad practice!" If the circumstances warrants using a GoTo, then do it. A great programmer is one that can do it on time, under budget, and push the envelope in the process. A good programmer is one that achieves his or her objectives, no matter the means or method. The observation was flawed, the circumstances are entirely different in a modern compiler, and the determination of what is "good" and "bad" in terms of programming practice is a rediculous on the face of it.

It became a mantra that the best programmers would never use a GoTo command. Several people took it as a mission to show how you would write "good" code that avoided the use of the "bad" GoTo command. Jump to the wrong place, in or out of a For/Next loop, and you could misconstrue the contents of the stack and cause a catastrophic failure to your program. One of the problems was that in Interpretive code, some loop structures, particularly the For/Next loop and the associated variable, were carried on the stack. The problem sometimes arrises of having the code merge again so that you can continue to carry out common processes.Ī dispute arrose some years ago about whether GoTo statements were a good way to bring about this merge effort or not. random number and to call this function again until a uniqueīranching code allows you to create different methods for dealing with variances. the Repeat/Until loop continues to create a new function terminates early, without declaring do_over = 1 If the random number matches a number used already, the This is where I got my "GOTO" equivalent.

Note my use of Repeat commands nestled in the function as a It calls a function that is found at the end of the program. This is the part that creates a random number The ".b" tells the program what type of array it will be - I won't need to type it again. Because I know that I will only be useing 94 numbers, I've used a. = *.pb filter.purebasic = PureBasic (pb)|$()| lexer.$() = purebasic # keywords must be all lowercase #Language keywords.$() = and break case continue data \ datasection declare declarecdll declaredll default deftype dim else \ elseif end enddatasection endenumeration endif endinterface endprocedure \ endselect endstructure endstructureunion enumeration extends fakereturn \ for foreach forever global gosub goto if includebinary includefile \ includepath interface newlist next or procedure procedurecdll \ proceduredll procedurereturn protected read repeat restore return select \ shared static step structure structureunion to until wend while xincludefile #preprocessor keywords2.$() = compilercase compilerdefault \ compilerelse compilerendif compilerendselect compilerif compilerselect # PB styles # Default style.purebasic.0 = fore:#000000 # Comment style.purebasic.1 = $(),$() # Number style.purebasic.2 = $(colour.number) # Keyword1 style.purebasic.3 = $(colour.keyword) # String style.purebasic.4 = $(colour.string) # Preprocessor # style.purebasic.5=$(colour.error) # Operator style.purebasic.6 = $(colour.operator) # Identifier style.purebasic.7 = $(style.purebasic.0) # Date # style.purebasic.8=$(colour.error) # StringEOL # style.purebasic.9=$(colour.error) # Keyword2 style.purebasic.10 = $(colour.preproc) # Keyword3 style.purebasic.11 = $(colour.keyword) # Keyword4 style.purebasic.12 = $(colour.keyword) # Constant style.purebasic.13 = $(colour.number) # Asm # style.purebasic.14=$(colour.error) # Label style.purebasic.15 = $(colour.preproc) # Error style.purebasic.16 = $(colour.error) # HexNumber style.purebasic.17 = $(colour.number) # BinNumber style.purebasic.18 = $(colour.Code: Select all Arrays may not be declared on the fly, but must be declared before they are called.

# Define SciTE settings for PureBasic files.
