NASutils Knowledge BaseUnofficialPolski

Programming on the NAS

Learn to program on your QNAP NAS in BASIC, Pascal, Go and Bash. Each language has 30 short lessons, from one printed line to a small finished tool, and bigger projects: menus, a game, a greeting at sign-in and a summary of the NAS. You write a program over SSH and run it on the NAS. TurboShell has BASIC, Free Pascal, Bash and the editors; Go comes from Bucket & Code.

BASIC

30 lessons · 6 projects

The lessons use yabasic, a BASIC without line numbers. The interpreter reads your file and runs it at once, so there is nothing to compile.

  1. 1–6First steps
  2. 7–12Decisions and loops
  3. 13–18Data, functions and the command line
  4. 19–24Files and errors
  5. 25–30Tools for the NAS

Start All lessons

Pascal

30 lessons · 6 projects

The lessons use Free Pascal. fpc compiles your file into one program that starts by itself and needs no other file.

  1. 1–6First steps
  2. 7–12Decisions and loops
  3. 13–18Data, functions and the command line
  4. 19–24Files and errors
  5. 25–30Tools for the NAS

Start All lessons

Go

30 lessons · 6 projects

Go compiles a program into one static file. You build it in Bucket & Code with the Go runtime and run it on any QNAP NAS with the same type of processor.

  1. 1–6First steps
  2. 7–12Decisions and loops
  3. 13–18Data, functions and the command line
  4. 19–24Files and errors
  5. 25–30Tools for the NAS

Start All lessons

Bash

30 lessons · 6 projects

Bash is the shell you type into. A script is a file of the same commands, with variables, conditions and loops.

  1. 1–6First steps
  2. 7–12Decisions and loops
  3. 13–18Data, functions and the command line
  4. 19–24Files and errors
  5. 25–30Tools for the NAS

Start All lessons

Projects

Longer programs that draw a menu, play a game, greet you at sign-in or show the state of the NAS. Each page shows the screen as the program drew it on a test NAS.

BASIC

Pascal

Go

Bash

All projects with their sample data and the test runner (57 KB)

TurboShell command examples · The programs to download