Limits on Print() and PrintN() Statements
Posted: Thu Aug 21, 2003 12:09 am
If you are using the Console (OpenConsole(), CliseConsole(), etc.), you will find that the maximum length of a string that can be written to the Console with the PrintN() and Print() commands is 250 characters. This initially led me to believe that PureBASIC could only handle string lengths up to 250 characters. Actually, strings can be way much longer, but the Print() and PrintN() functions limit the length to the first 250 characters.
The OpenConsole() command creates a standard screen size of 80 characters by 25 rows, which is very convenient if you are accustomed to writing to DOS screens and such. You can use the ConsoleColor() command to change the foreground and background colors, similar to the COLOR command in some BASIC's, and you can position to any row,column with the ConsoleLocate() command. And you can use the ClearConsole() command to clear the console screen (and to make the background color uniform over the entire screen), and the ConsoleCursor() command to specify the size (height) of the cursor.
There are limits to what this permits you to do, however. You cannot determine where the cursor is currently positioned on the screen unless you keep track of it in your own code, and Print() and PrintN() do not interpret embedded code, so you will not be able to use TAB(), Carrage Return, or Line Feed codes within a string to control the print process. And anything to be printed by these two commands must first be rendered into strings. But these limitations are not severe, and since the Console is really intended to be a quick-and-dirty output tool, it should more than suffice for most purposes.
The OpenConsole() command creates a standard screen size of 80 characters by 25 rows, which is very convenient if you are accustomed to writing to DOS screens and such. You can use the ConsoleColor() command to change the foreground and background colors, similar to the COLOR command in some BASIC's, and you can position to any row,column with the ConsoleLocate() command. And you can use the ClearConsole() command to clear the console screen (and to make the background color uniform over the entire screen), and the ConsoleCursor() command to specify the size (height) of the cursor.
There are limits to what this permits you to do, however. You cannot determine where the cursor is currently positioned on the screen unless you keep track of it in your own code, and Print() and PrintN() do not interpret embedded code, so you will not be able to use TAB(), Carrage Return, or Line Feed codes within a string to control the print process. And anything to be printed by these two commands must first be rendered into strings. But these limitations are not severe, and since the Console is really intended to be a quick-and-dirty output tool, it should more than suffice for most purposes.