Page 1 of 1

What is the use of *progam ?

PostPosted: Tue May 18, 2010 4:45 pm
by diptisaini
Suppose i have opened currently CL564N program so what is the value of *program ?

> + Subprogram CL564N an ....+....1....+....2....+....3....+....4....+....5....+...
3980 #KCTGMAPP-IN-CALLER-ID := *PROGRAM
3990 CALLNAT 'KCGROUPN' #KCGROUPP-PARMS #KCPARSEP-PARMS
4000 #KCTGMAPP-PARMS #KCSBUFP0-PARMS
4010 END-SUBROUTINE

Re: What is the use of *progam ?

PostPosted: Tue May 18, 2010 8:18 pm
by RGZbrog
While you are in the program editor, *PROGRAM has no value. During execution of line 3980, it contains the value CL564N.

During run-time, *PROGRAM contains the 8-character name of the currently executing object. That object could be a program, subprogram, external subroutine, helproutine, or map. In your example, the subprogram is passing its own name as a parameter to a lower-level subprogram. You could just as easily have used a literal ('CL564N') or a named constant, but with *PROGRAM you can clone the source without worrying about those literals. Plus, *PROGRAM is self-documenting - a literal is meaningless.

A more recent addition to the language is *CURRENT-UNIT, which expands on *PROGRAM.

Re: What is the use of *progam ?

PostPosted: Thu May 20, 2010 3:29 pm
by diptisaini
Thanks for clearing my doublt.

Re: What is the use of *progam ?

PostPosted: Fri Sep 03, 2010 5:12 pm
by NicC
sam2184 wrote:Generally the program you would want to do it with would be an interpreter or a compiler. This can be anything. Visual basic, c, C++ perl -- anything. You can use a .bat file in the windows cmd.exe or a shell script in the terminal of the Mac OS X or Linux. I am on Slackware Linux as I am writing this and just wrote this script:
#!/bin/bash;
for i in a s d f g h j k l p;
do
for x in a s d f g h j k l p;
do
for n in a s d f g h j k l p;
do
for m in a s d f g h j k l p;
do
echo $i$x$n$m
done
done
done
done


And just what has this to do with Natural or the question? Or are you just trying to advertise your links - which is not the purpose of this forum and is not permitted.