SHELL and modes

Hi
I’m trying to execute a cmd shell (own script in php) but i would like that’s my webapp doesn’t wait the result.

My current code is

Dim s As new shell s.mode = 0 s.execute("nohup my_script.php &")

With this code,the script is running, but it’s waiting for ever.
So my webapp is locked.

With mode=1
The script, the webapp does work, but the script is not launched.

If anybody can help me on this point please?

I’ve made some tests using Thread1.run including this code, same issue.

The code is developed under Xojo 2013 3.3 because i use Centos 5.

Regards

[quote=281306:@Franck Danard]With mode=1
The script, the webapp does work, but the script is not launched.[/quote]

That is because you dim the shell. It goes out of scope.

Make it a property of the webpage or session, and it will work as expected.

Hmmm
Thanks Michel.

Can you tel me more please… How can i do.
You mean that i need to delare this in a property like :
Name : s
Type : Shell

and next, i will call this property like this ?
app.s.Execute("…")

Let me know please.

add the property to a module

s = new Shell s.Execute("......")

Hi Axel.
Sorry. It doesn’t accept this methode.

for me it works

Ok i’ll try this example also.
I’m not in front of my server right now.
But however it more clear in any cases.

Thanks guys.
I’ll give you a feed back tomorrow sure.

I found an example gaves by Michel also.
I’ll try it too.

Hi all.

Good news, it works now.

I’ve created a class S with super : Shell.
Drag and drop this new class in Webpage1, so giving S1.

In my menu, under Case “Buttonx”…

S1.Mode = 1 S1.Execute("nohup my_script.php &")

Enjoy

Thanks a lot at all for your help.
Have a good day guys. :slight_smile: