starting today a new column begins, in which I will explain MSX Basic commands and functions that will be used to make our programs. For experts it will be a refresher, while for those who are beginners, they will have the opportunity to understand and learn their use. I will try to explain at least one a week.
Let's start with the PRINT function
Print a sentence, number or variable. It can print on screen, on paper or on magnetic media
Its syntax is: PRINT [argument]
Using it alone will cause a line to skip. If we want to print a message we should enclose it in quotation marks: PRINT “Hello”. If we want to print on paper just add the L in front: LPRINT “Hello”. If we want to print it or rather the correct word is to save it on magnetic support, just add the pound sign: PRINT #1, “CIAO”. The number after the pound sign is the open port for writing to magnetic media.
We can also do some calculations: PRINT 5+6; will print the result of the sum. Instead of constants we can use variables: A=5, B=6, PRINT A+B. We can print sentences and numbers at the same time: PRINT “How old are you?”; 30, or a variable, A=30: PRINT “How old are you?”; A. You can concatenate 2 sentences or more sentences using the + (plus) sign; PRINT “Orazio”+”Cacciola”. OrazioCacciola will be printed, if we want to detach it just add an empty space after the name: PRINT “Orazio “+”Cacciola”. In addition to the plus sign, other tabulators, the comma sign and the semicolon, can be used. The comma leaves spaces between the 2 variables and exactly 14, while the dot and joins the 2 variables. Be careful though, while the semicolon joins the variables, whatever they are, the + sign can only be used with alphanumeric sentences or variables.
The next episode will be dedicated to PRINT USING, the so-called formatted printing.
Good morning everyone, In this episode I will talk about an important interrupt, especially for games, when we want to make an enemy suddenly appear or a useful object, but also to create a stopwatch or a clock and many other things. The COMMAND exploits the...
Good morning everyone. As I mentioned in the last episode, I will talk about error management, how to work with the function keys and control the STOP key. The mistake that is often made is the so-called typo, we will see it appear on the screen...
Kind regards to everyone. Today we will close this topic, I will talk about direct or random access files. But first, as I mentioned in the last episode, I will give a small explanation about the program. First of all, the first thing to say is that I used a command which...
Let's continue our lesson from last time, of which my last explanation was on the commands to be able to "work" with files. Today I will talk about how to create sequential files, but before that I haven't said 2 words about the MAXFILES= command. this command makes us...
Greetings to all readers. In this episode I will talk about managing our data and the methods that can be used with our MSX. The data that we can manage is divided into many categories; programs, binaries, texts, archives, images and more. For...
0 Comments