Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Windows Program Console
#1
Big Grin 
What's up guys! Can we have examples of practical use of codes for the Windows console?

1 - Search.
2 - create directory.
3 - A program to receive two numbers from the user and make the sum and display it on the screen.
4 - Remove directories.
5 - Search within files, .txt, Doc.
6 - Basic Mini Compiler.
7 - Receive arguments via the prompt command line.

Something to learn more about the language.
thanks Smile
Reply
#2
Hello!

Below is the first example. Console program name: add.n7a

Code:
' Programa para somar dois números recebidos do usuário
' Program to add two numbers received from the user

' Função principal
function main()
    ' Variáveis para armazenar os números e o resultado
    ' Variables to store the numbers and the result
    num1 = 0
    num2 = 0
    resultado = 0

    ' Solicitar o primeiro número
    ' Prompt for the first number
    pln("Enter the first number:")
    num1 = rln() ' Ler o primeiro número do console
                 ' Read the first number from the console
  
    ' Solicitar o segundo número
    ' Prompt for the second number
    pln("Enter the second number:")
    num2 = rln() ' Ler o segundo número do console
                 ' Read the second number from the console
 
    ' Realizar a soma
    ' Perform the sum
    resultado = int(num1) + int(num2)

    ' Exibir o resultado
    ' Display the result
    pln("The result of the sum is: " + resultado)
endfunc

' Chamar a função principal
' Call the main function
main()
Reply
#3
I'll see if I can write some examples for the undocumented file library (file.n7). It contains functions for listing files etc. You can also use the 'system' command/function directly to execute any command line command.

I believe someone wrote an interpreter for tiny basic in n7, should be somewhere around here Smile
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)