Hello, I've made a little progress. This program already works, but it can't do everything I want.

```
$ cd ~/Rust && ( rm -f Argumente_1 ; rustc Argumente_1.rs; ~/Rust/Argumente_1 -a Romeo -b Julia -c Cäsar)
Das 0. Vektorelement: /home/manfred/Rust/Argumente_1
Das 1. Vektorelement: -a
Der Wert hinter '-a' lautet: Romeo
Das 2. Vektorelement: Romeo
Das 3. Vektorelement: -b
Der Wert hinter '-b' lautet: Julia
Das 4. Vektorelement: Julia
Das 5. Vektorelement: -c
Der Wert hinter '-c' lautet: Cäsar
Das 6. Vektorelement: Cäsar
```

Argumente_1.rs

```
use std::env;
fn main() {
let vector: Vec<String> = env::args().collect();
let l = vector.len();
for i in 0..l {
println!("Das {}. Vektorelement: {}", i, &vector[i]);
if &vector[i] == "-a" {
let p = i + 1;
if p < l {
println!("Der Wert hinter '-a' lautet: {}", &vector[p]);
}
}
if &vector[i] == "-b" {
let p = i + 1;
if p < l {
println!("Der Wert hinter '-b' lautet: {}", &vector[p]);
}
}
if &vector[i] == "-c" {
let p = i + 1;
if p < l {
println!("Der Wert hinter '-c' lautet: {}", &vector[p]);
}
}
}
}
```

But this program is supposed to store the required values in variables (aaa, bbb, ccc), but it doesn't. What am I doing wrong?

```
use std::env;
fn main() {
let vector: Vec<String> = env::args().collect();
let l = vector.len();
let mut aaa;
let mut bbb;
let mut ccc;
for i in 0..l {
println!("Das {}. Vektorelement: {}", i, &vector[i]);
if &vector[i] == "-a" {
let p = i + 1;
if p < l {
aaa = &vector[p];
}
}
if &vector[i] == "-b" {
let p = i + 1;
if p < l {
bbb = &vector[p];
}
}
if &vector[i] == "-c" {
let p = i + 1;
if p < l {
ccc = &vector[p];
}
}
}
println!("Alpha: {}", aaa);
println!("Beta : {}", bbb);
println!("Gamma: {}", ccc);
}
```

I know, that ist working:

```
...
if &vector[i] == "-a" {
let p = i + 1;
if p < l {
aaa = &vector[p];
println!("Alpha: {}", aaa);
}
}
...
```

but I need the variables (aaa, bbb, ccc) outside of the for loop.

And in the end I would like to outsource the repeated if-queries to a function, but unfortunately I cannot transfer the content of "vector".