yeoea1
23rd July 2003, 15:41
Hi,

Can any one show me how to use pstat?

I have tried the example script from the help and it give the following error when compiling?

Argument 1 for function 'pstat' should be call by reference

my pstat statement is as follow:

procid = pstat (-1, progname, info)


Actually what I am trying to do is to using pstat to get the pid for all the processes in my bshell and show it on a form. Just like running ps on the shell. I am trying to get the session name and pid currently active from the ps command in shell and display on a form. Is this possible?

isimeon
23rd July 2003, 15:49
long info(256)
long next.processno
long save.processno
string progname(256)


save.processno=0
repeat
next.processno = pstat(save.processno, progname, info)
............
save.processno = next.processno
until next.processno=0

yeoea1
24th July 2003, 05:43
Thank.

Now I have a problem to display the result on a form. I created a type 2 form with 3 fields (multi-occ) set as save.processno, progname and info(1)

However once I run the session, it just open and close the form immediately. Is the result from the script able to be display onto a form?