[Vala] Very basic question.. about strings and arrays...



Hello every body.
I have some function in my code:
public void execProgram(string working_dir, string[] argv)

This function executes some program.

Here is how I can call it successfully:
execProgram("/",{"ls", "-l" ,"-h"});

But, I want to call it another way. something like that:

  public void on_btn_search_what_clicked (Button source) {
     private string [3] argv;
     argv[0] = app_path + "repST.beta";
     argv[1] = "-l";
     argv[2] = txt_search_what.text();

     execProgram(app_path,argv);
  }

I what to create an array of strings, fill them with data, and them pass the
array to my function...


This code doesn't compile... could some one show me how to declare an array
of strings in a correct way?

Thanks.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]