Program name: Difference between revisions
Add Ecstasy example
(Jakt) |
(Add Ecstasy example) |
||
(3 intermediate revisions by 3 users not shown) | |||
Line 351:
: _start ( rsp -- noret ) arg0 print-arg bye ;</syntaxhighlight>
=={{header|BQN}}==
<syntaxhighlight lang="bqn">•name</syntaxhighlight>
=={{header|C}}==
Line 696 ⟶ 699:
→ "http://www.echolalie.org/echolisp/"
</syntaxhighlight>
=={{header|Ecstasy}}==
<syntaxhighlight lang="ecstasy">
module WhatIsMyName {
@Inject Console console;
void run() {
console.print($"program name: {this:module}");
}
}
</syntaxhighlight>
{{out}}
<pre>
program name: WhatIsMyName
</pre>
=={{header|Elena}}==
Line 719 ⟶ 738:
<code>load-file-name</code> is the ".el" or ".elc" currently being loaded. Within a batch <code>-l</code> it will be the script name, but within sub-loads like <code>require</code> etc it is that sub-load.
=={{header|EMal}}==
<syntaxhighlight lang="emal">
writeLine("path: " + Runtime.path)
writeLine("name: " + Runtime.name)
writeLine("args: " + Runtime.args)
</syntaxhighlight>
{{out}}
<pre>
emal.exe Org\RosettaCode\ProgramName.emal sample arguments
path: C:\tmp\Org\RosettaCode\ProgramName.emal
name: ProgramName.emal
args: [sample,arguments]
</pre>
=={{header|Erlang}}==
Line 2,085 ⟶ 2,118:
=={{header|Wren}}==
Assuming we're running a script file named "
<syntaxhighlight lang="
System.print("My name is %(Process.allArguments[1])")</syntaxhighlight>
Line 2,092 ⟶ 2,125:
{{out}}
<pre>
My name is
</pre>
|