What is the use of *progam ?



Software AG's platform-independent programming language with full support for open-source and Internet applications

What is the use of *progam ?

Postby diptisaini » Tue May 18, 2010 4:45 pm

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
diptisaini
 
Posts: 90
Joined: Sun Mar 14, 2010 5:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: What is the use of *progam ?

Postby RGZbrog » Tue May 18, 2010 8:18 pm

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.
User avatar
RGZbrog
 
Posts: 101
Joined: Mon Nov 23, 2009 1:34 pm
Location: California, USA
Has thanked: 0 time
Been thanked: 0 time

Re: What is the use of *progam ?

Postby diptisaini » Thu May 20, 2010 3:29 pm

Thanks for clearing my doublt.
diptisaini
 
Posts: 90
Joined: Sun Mar 14, 2010 5:12 pm
Has thanked: 0 time
Been thanked: 0 time

Re: What is the use of *progam ?

Postby NicC » Fri Sep 03, 2010 5:12 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to Natural