FeaturesPluginsDocs & SupportCommunityPartners

NetBeans Forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
  

Run configuration / script / arguments not working? (SOLVED)

 
Post new topic   Reply to topic    NetBeans Forums -> PHP Users
View previous topic :: View next topic  
Author Message
willirl



Joined: 26 Mar 2009
Posts: 20

PostPosted: Mon Jul 06, 2009 1:04 pm    Post subject: Run configuration / script / arguments not working? (SOLVED) Reply with quote

I am trying to pass a command line arg to a script in the IDE. I set up the run config "Run as" to "Script" and the interpreter correctly - This works fine and runs the script.

When I add an "Arguments" as "abc" (without quotes) I don't see the args in the program using the argc and argv functions. Matter of fact the argv array is NULL.

Can someone point me in the right direction here?

Rick


Last edited by willirl on Mon Jul 06, 2009 1:17 pm; edited 1 time in total
Back to top
View user's profile Send private message
willirl



Joined: 26 Mar 2009
Posts: 20

PostPosted: Mon Jul 06, 2009 1:16 pm    Post subject: Reply with quote

Oops - OK it seems that in my class the $argc/$argv are not available as such however in the "main" they are available. So this won't work:

Code:

class test {
  function test() {
    var_dump($argv);
  }
}

test();


But this will:

Code:

class test{
  function test($argv) {
    var_dump($argv);
  }
}

test($argv);
Back to top
View user's profile Send private message
Tomas Mysik
Posted via mailing list.





PostPosted: Tue Jul 07, 2009 10:46 am    Post subject: Run configuration / script / arguments not working? Reply with quote

Hi,

Dne pondělí 06 července 2009 15:16:44 willirl napsal(a):
Quote:
Oops - OK it seems that in my class the $argc/$argv are not available as
such however in the "main" they are available. So this won't work:

Code:


class test {

function test() {

var_dump($argv);

}

}

test();

But this will:

Code:


class test{

function test($argv) {

var_dump($argv);

}

}

test($argv);

apparently it seems that $argv is just local varible, not global one. But I
don't know much about PHP in command line.

Tomas
--
Tomas Mysik
address-removed
Back to top
Display posts from previous:   
Post new topic   Reply to topic    NetBeans Forums -> PHP Users All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB