Beginners Project: Hello World (using C): Difference between revisions
Jump to navigation
Jump to search
(Reworked a bit) |
|||
(4 intermediate revisions by one other user not shown) | |||
Line 3: | Line 3: | ||
== Create a library for source and program == | == Create a library for source and program == | ||
* <code>CRTLIB</code> + <code>F4</code> | * <code>CRTLIB</code> + <code>F4</code> | ||
** Enter this:<br/>[[Image:HelloWorldC01.png| | ** Enter this:<br/>[[Image:HelloWorldC01.png|666px]] | ||
== Create a Source Physical File == | == Create a Source Physical File == | ||
* <code>CRTSRCPF</code> + <code>F4</code>, name it <tt>SNDBX</tt><ref>It is | * <code>CRTSRCPF</code> + <code>F4</code>, name it <tt>SNDBX</tt><ref>It is '''essential''', that you never, ever, use vowels! :-)</ref> | ||
== Create the C source code == | == Create the C source code == | ||
* To create the source code as member of the SPF: <code>WRKMBRPDM</code> + <code>F6</code>, enter name (<tt>hello_c</tt>) and type (<tt>C</tt>): <br/>[[Image:HelloWorldC02.png| | * To create the source code as member of the <tt>SPF</tt>: <code>WRKMBRPDM</code> + <code>F6</code>, enter name (<tt>hello_c</tt>) and type (<tt>C</tt>): <br/>[[Image:HelloWorldC02.png|666px]] | ||
* Enter this in SEU: | * Enter this in <tt>SEU</tt>: | ||
Spalten . . . : 1 100 Editieren SNDBX/SNDBX | Spalten . . . : 1 100 Editieren SNDBX/SNDBX | ||
SEU==> HELLO_C | SEU==> HELLO_C | ||
Line 24: | Line 24: | ||
* Close and save with <code>F3</code> | * Close and save with <code>F3</code> | ||
* Enter <code>14</code> to compile | * Enter <code>14</code> to compile | ||
* Check the outcome with <code>DSPMSG</code> | * Check the outcome with <code>DSPMSG</code>. If you'd rather wait for the compile than queuing it, take a look at [[Compile Sources Without Queuing]]. | ||
== Run the program == | == Run the program == | ||
*<code>CALL SNDBX/HELLO_C</code>:<br/>[[Image:HelloWorldC03.png|500px]] | * <code>CALL SNDBX/HELLO_C</code>:<br/>[[Image:HelloWorldC03.png|500px]] | ||
== Footnotes == | |||
<references /> | |||
[[Category:Programming]] | |||
[[Category: |
Latest revision as of 21:32, 23 February 2020
Since Heiko is fairly familiar with C, here's his approach for a simple "Hello World!" in C.
Create a library for source and program
Create a Source Physical File
CRTSRCPF
+F4
, name it SNDBX[1]
Create the C source code
- To create the source code as member of the SPF:
WRKMBRPDM
+F6
, enter name (hello_c) and type (C): - Enter this in SEU:
Spalten . . . : 1 100 Editieren SNDBX/SNDBX SEU==> HELLO_C FMT ** ...+... 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... 8 ...+... 9 ...+... 0 ***************** Datenanfang ******************************************************************************************* 0001.00 #include <stdio.h> 191007 0002.00 int main(void) 191007 0003.00 { 191007 0004.00 printf("Hello World!\n"); 191007 0005.00 return 0; 191007 0006.00 } 191007 ******************Datenende *********************************************************************************************
- Close and save with
F3
- Enter
14
to compile - Check the outcome with
DSPMSG
. If you'd rather wait for the compile than queuing it, take a look at Compile Sources Without Queuing.
Run the program
Footnotes
- ↑ It is essential, that you never, ever, use vowels! :-)