How to make a variable in G15 PMN
With most programming languages, it is possible to do something in more than one way. And some ways may be appearing to be 'tricks'. However, there is no need to view some ways of doing it as tricks if they work consistently. Whether something works in PMN you can find out (when you have gained some knowledge of the whole of G15) by looking into how PMN is defined. In fact, each time you start up a G15 PMN program by clicking on it at a menu, you start a swift process that JIT, Just In Time, compiles the whole of PMN in terms of its more essential G15 code. In this way, you can both inspect what goes on in PMN, and also extend PMN with new two-letter words, new Pre-Defined--PD--words!
Anyway, let's look into how to make a variable--in the most typical way, anyway. A number variable is the simplest and in a way, most essential example. Suppose you have a customer-list. How many customers are in the list? You may want a variable for that, and an initial value. Let us set it to 100. This could be how:
customers= ^.
100 customers kl
Then let's find out how many customers we have at present:
customers lk nn
It will now say '100'.Note that 'lk' can be read as 'LooK'. The 'kl' is the reverse sequence. It could be interpreted as 'kill the earlier value, and put this one instead!'.Also, note that we use 'nn' to print a number while a quote would be shown by 'pp'. This is the way we do it in a PMN Terminal. When running a program using various graphical positions on the screen, we have several other possibilities.
{Note that the quote-mark ^ was used. The number variable is an empty quote, in a way. The number goes into the position of the PMN quote used to store the length of the quote.}














