|
Forum Index : Microcontroller and PC projects : commands in mmbasic CELLINPUT CELLSET SHOWGRID video
| Author | Message | ||||
| tenij000 Regular Member Joined: 30/05/2025 Location: NetherlandsPosts: 61 |
commands in mmbasic CELLINPUT CELLSET SHOWGRID video link to video mmbasic picomite > cls > cellinput 1,1 Invoer: 21 > cellinput 1,2 Invoer: 66 > cellinput 1,3 Invoer: 89 > cellset 1, 4, cell(1,1)+cell(1,2) > cellset 2, 2, cell(1,3)+20 > showgrid A B C D E +----------+----------+----------+----------+----------+ 1 | 21 | 66 | 89 | 87 | . | +----------+----------+----------+----------+----------+ 2 | . | 109 | . | . | . | +----------+----------+----------+----------+----------+ 3 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 4 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 5 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 6 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 7 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 8 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 9 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 10 | . | . | . | . | . | +----------+----------+----------+----------+----------+ |
||||
| tenij000 Regular Member Joined: 30/05/2025 Location: NetherlandsPosts: 61 |
i try this bas program ' Spreadsheet Test Programma ' Maakt een simpele berekening voor 3 producten ' 1. Maak het grid eerst helemaal leeg (optioneel) CLS PRINT "Spreadsheet Grid Test wordt geladen..." ' 2. Productnamen en prijzen invoeren ' We gebruiken CELLINPUT voor tekst en vaste getallen CELLINPUT 1, 1, "Appels" CELLINPUT 1, 2, 1.50 ' Prijs per stuk CELLINPUT 2, 1, "Bananen" CELLINPUT 2, 2, 0.80 CELLINPUT 3, 1, "Peren" CELLINPUT 3, 2, 1.25 ' 3. Aantallen invoeren (je zou hier ook een prompt kunnen gebruiken) CELLINPUT 1, 3, 10 ' 10 appels CELLINPUT 2, 3, 5 ' 5 bananen CELLINPUT 3, 3, 12 ' 12 peren ' 4. Berekeningen maken met CELLSET en CELL() ' We berekenen de subtotalen: Prijs (kolom 2) * Aantal (kolom 3) PRINT "Berekeningen uitvoeren..." CELLSET 1, 4, CELL(1, 2) * CELL(1, 3) CELLSET 2, 4, CELL(2, 2) * CELL(2, 3) CELLSET 3, 4, CELL(3, 2) * CELL(3, 3) ' 5. Totaal berekenen van de hele kolom 4 CELLSET 5, 4, CELL(1, 4) + CELL(2, 4) + CELL(3, 4) CELLINPUT 5, 3, "TOTAAL:" ' 6. Het resultaat tonen PRINT "Klaar! Hier is het overzicht:" SHOWGRID output picomite > run Spreadsheet Grid Test wordt geladen... Berekeningen uitvoeren... Klaar! Hier is het overzicht: A B C D E +----------+----------+----------+----------+----------+ 1 | "Appels" | 1.50 | 10 | 15 | . | +----------+----------+----------+----------+----------+ 2 | "Bananen"| 0.80 | 5 | 4 | . | +----------+----------+----------+----------+----------+ 3 | "Peren" | 1.25 | 12 | 15 | . | +----------+----------+----------+----------+----------+ 4 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 5 | . | . | "TOTAAL:"| 34 | . | +----------+----------+----------+----------+----------+ 6 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 7 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 8 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 9 | . | . | . | . | . | +----------+----------+----------+----------+----------+ 10 | . | . | . | . | . | +----------+----------+----------+----------+----------+ |
||||
| Volhout Guru Joined: 05/03/2018 Location: NetherlandsPosts: 5671 |
Hoi tenij000, Kun je ook je library subs laten zien. Volhout PicomiteVGA PETSCII ROBOTS |
||||
| The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2026 |