It means: "You are so stupid, you must have been born that way."
The obvious inference is that using tabs in your source code is stupid, really really stupid.
Is that true? Well, yes.
There are two possible reasons for wanting to use tabs in your source code:
1) Save space in file storage
2) Being able to vary the depth of your indents simply by altering the tab settings of your editor
Neither can be justified.
Try out this code:
theFile = Open "~/test.txt" For Write Create ' Your Home Directory
Print #theFile, Chr(9); "A) One Tab"
Print #theFile, gb.Tab; "B) One Tab"
Print #theFile, gb.Tab; gb.Tab; "C) Two Tabs"
Print #theFile, gb.Tab; " "; gb.Tab; "D) Tab Space Tab"
Print #theFile, gb.Tab;; gb.Tab; "E) Tab Space Tab"
' Print #theFile, gb.Tab;;; gb.Tab; "F) Tab 2 Spaces Tab" ' That's a Syntax error
Print #theFile, gb.Tab; " "; gb.Tab; "G) Tab 2 Spaces Tab"
Print #theFile, gb.Tab; " ";; gb.Tab; "H) Tab 2 Spaces Tab"
Print #theFile, gb.Tab; " "; gb.Tab; "I) Tab 3 Spaces Tab"
Print #theFile, Asc(gb.Tab)
Close #theFile
(Thanks for the code highlighting tip jornmo)First thing to notice is that Gambas has a built in constant for the tab character. You should use it. You can't assume that people reading your code will know the ASCII value for the tab character.
The second thing is that Gambas allows ";;" as a delimiter that introduces a space between terms instead of packing them together. This can be handy for variables and expressions, but if the term on the left side of it is a string constant your code will look less cluttered if you insert a space inside the quote instead.
Now run the program and load the file in various editors/word processors. Notice the inconsistent results.
Indentation is a very important attribute of code readability/comprehensibility. (Easy to read/easy to understand) So much so that Python enforces it in order to be able to eliminate "end xxxxx" statements. Personally, I think it is a bad choice, but doesn't rise to the level of stupid. Using tabs in Python is particularly stupid.
But this forum is about Gambas, so let's continue.
My indentation rules for BASIC are as follows:
For "For" statements, I like two spaces. I used to use one. This is because For loops tend to be nested more than any other control structure. Tabbing with 4, or even 8 can quickly run the source code off the right side of the screen. Mild exaggeration.
Likewise, I use two spaces to indent the "Case" in a "Select" statement, and another two for the following code.
For "If" statements, I like to use three. This lines up the following code nicely, particularly when the same variable name leads the comparison and the following statement.
"Do" loops are like if statements.
(Side note: I like to use the "Do ... Loop" for the five combinations: infinite, top while, top until, bottom while, bottom until. But that is a different topic and Gambas allows all of them.)
Back to the subject topic. Gambas uses spaces when you tab. Another good design choice. I haven't been able to find anywhere you can change that, another good choice.
On the other hand LibreOffice Macro Basic is the opposite. Hmmmmmm..........
If you think I am being stupid, call me out on it, let's liven this place up. Just leave my momma out of it.
Ced