| View previous topic :: View next topic |
| Author |
Message |
Fixxxer How do I cheat?
Reputation: 0
Joined: 29 Apr 2013 Posts: 7
|
Posted: Fri Oct 04, 2013 5:15 pm Post subject: getProcessIDFromProcessName - How to call |
|
|
Hi,
I decided to try something new and create a process listbox
I found many examples but I would like an explanation why my approach does not work.
| Code: |
processList = createStringlist()
processList=getProcesslist()
for i = 0, strings_getCount(processList) - 1 do
process = strings_getString(processList, i)
pid = getProcessIDFromProcessName(process) <--wrong call????
strings_add(items,process.."-"..pid)
end |
I get the error attempt to concatenate global 'pid' (a nil value)
So I understand the the getProcessIDFromProccessName didn't work???
Thanks in advance
Edit: One guess would be that the getProcessIDFromProcessName does not return string or number therefore the concatenation fails?
|
|
| Back to top |
|
 |
Dark Byte Site Admin
Reputation: 470
Joined: 09 May 2003 Posts: 25812 Location: The netherlands
|
Posted: Fri Oct 04, 2013 5:48 pm Post subject: |
|
|
You don't need to call createStringList, getProcesslist creates it for you
The problem is that the processlist is build up as pid-processname
So, first strip the processid from the list , or just use that
_________________
Do not ask me about online cheats. I don't know any and wont help finding them.
Like my help? Join me on Patreon so i can keep helping |
|
| Back to top |
|
 |
Fixxxer How do I cheat?
Reputation: 0
Joined: 29 Apr 2013 Posts: 7
|
Posted: Fri Oct 04, 2013 6:17 pm Post subject: |
|
|
I see, reading the description thought that only returns the process name, and you have to find the PID from the getProcessIDFromProcessName
but now I figured out that it would be ambiguous to do that, since there might be the same process name a lot of times.
Thanks again
(I think not for the last time:D)
|
|
| Back to top |
|
 |
|