03-29-2025, 07:12 AM
(This post was last modified: 03-29-2025, 09:58 AM by 1micha.elok.)
Perhaps these examples may help you ....
Example 1
Example 2
Example 3 [ Edited ]
unzip [starwars.zip] and compile [starwars.n7]
Example 4
unzip [Shell.zip] and compile [game.n7]
Example 1
Code:
' system
' ------
' 'system cmd' executes a system command.
system "dir"
' This executes the system command 'pause', which waits for the user to press any key.
system "pause"
' Clear the console window
system "cls"
' If called in an expression, 'system' returns the output of the command instead of printing it
' to the console window.
result = system("dir")
' Print the first line.
pln "First line: " + split(result, chr(10))[0]
pln
system "pause"
Example 2
Code:
' 'system' works as in n6, but can also be used in an expression to capture the
' output instead of sending it to stdout.
' This probably doesn't work on Linux.
result = system("dir /b /a-d")
pln "Press enter to see the captured result!"
a = rln()
pln result
pln "Press enter to see it again!"
a = rln()
system "dir /b /a-d"
pln
pln "Press enter to exit"
tmp = rln()
Example 3 [ Edited ]
unzip [starwars.zip] and compile [starwars.n7]
Example 4
unzip [Shell.zip] and compile [game.n7]