How to resolve the algorithm Program name step by step in the Seed7 programming language
Published on 12 May 2024 09:40 PM
How to resolve the algorithm Program name step by step in the Seed7 programming language
Table of Contents
Problem Statement
The task is to programmatically obtain the name used to invoke the program. (For example determine whether the user ran "python hello.py", or "python hellocaller.py", a program importing the code from "hello.py".) Sometimes a multiline shebang is necessary in order to provide the script name to a language's internal ARGV. See also Command-line arguments Examples from GitHub.
Let's start with the solution:
Step by Step solution about How to resolve the algorithm Program name step by step in the Seed7 programming language
Source code in the seed7 programming language
$ include "seed7_05.s7i";
const proc: main is func
local
var integer: i is 0;
begin
writeln("Program path: " <& path(PROGRAM));
writeln("Program directory: " <& dir(PROGRAM));
writeln("Program file: " <& file(PROGRAM));
end func;
You may also check:How to resolve the algorithm Associative array/Merging step by step in the Phix programming language
You may also check:How to resolve the algorithm Bin given limits step by step in the Haskell programming language
You may also check:How to resolve the algorithm Variable size/Set step by step in the Erlang programming language
You may also check:How to resolve the algorithm Munchausen numbers step by step in the Wren programming language
You may also check:How to resolve the algorithm Substring step by step in the PARI/GP programming language