cannot pushback a vector of Strings



within a windows forms class (form1) I declared a cliext vector of vectors of strings with



```
cliext::vector<cliext::vector<String^>^> myvector;
```

. Then, within a function in that same class I tried to push back a vector of strings in myvector but it resulted in an error. I attempted to push back the vector of vectors by using



```
myvector->push_back(cliext::vector<String^>());
```

. I can't figure out what I'm doing wrong here. I also tried to initialize myvector using



```
cliext::vector<cliext::vector<String^>^> myvector = gcnew cliext::vector<cliext::vector<String^>>;
```

within the function in the form1 class but this did not help. Debugging tells me that the vector type does not have an overloaded "->" operator. I know what an overloaded operator is but I don't know what to make of this.  

If I completely missed the protocol of how to enter code in this forum please let me know, this is my first post:)
I think String^ is like a C++ reference and thus cannot be stored in a STL container. But don't blame me if this is not right, cause I'm not familiar with mixing native C++ and C++/CLR.
you are mixing up "for all iterators i" with "for some specific kind of iterator i".

what if i decide to call foo<std::vec::intoiter<string>>? then you have a function that takes an intoiter<string>, but you tried to call it with an skip<intoiter<string>>, which is a different type. hence a type mi… Check if any of the values in the cells are null.  

If they are you need to modify your code to check for null conditions before using `ToString()`. Here's an example of one possibility. Just season to taste... 



```
extends Node2D
var x_delta = 0

func _physics_process(delta):
    var input_velocity = Vector2.ZERO

    if Input.is_action_just_pressed("ui_right"):
        x_delta = 1

    if Input.is_action_just_pressed("ui_left"):
        x_delta = -1

    if Input.is_action_just_released("ui_right") && x_delta > 0:
        x_delta = 0

    if Input.is_action_just_released("ui_left") && x_delta < 0:
        x_delta = 0

    input_velocity.x = x_delta

    print(input_velocity.x)

``` hi [@interactiverendering](/u/interactiverendering) ,

this is a little more complicated than it appears to be. in order to remove the close button from the form (because it would make revit crash in some cases) i had to remove that logo too. i’ll try and bring it back and let you know :slight\_smile: nvm, i think it might be because i was force running it. i reopened the script and it appears to work. see [creating feedback loops](https://vvvv.org/documentation/creating-feedback-loops).

it’s only the subtype of a datatype. don’t worry about that.

fyi: create an [asstring (value)](https://vvvv.org/documentation/asstring-(value)) and check its sub type for possible subtypes of the datatype “value” The problem is that your pair's closure must return two different types of objects: int if you ask for "con", and the next closure on the line if you ask for "crd".


Here's one possible implementation:


Use a speaker so you can come back.



```
public static Func<string, dynamic> Pair(int x, Func<string, dynamic> y)
{
    Func<string, dynamic> pair =
           (a) =>
           {
               if (a == "con") return x;
               if (a == "crd") return y;
               throw new Exception();
           };

    return pair;
}

public static void Print(Func<string, dynamic> pair)
{
    while (true)
    {
        var next = pair("crd");
        Console.WriteLine((next == null ? "-":"+") +"> " + pair("con"));
        if (next != null)
        {
            Console.WriteLine("|");
            pair = (x) => next(x);
            continue;
        }
        break;
    }
}

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```


  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

Test:



```
var pair = Pair(1,
            Pair(2,
                  Pair(3,
                        Pair(4, null))));

Print(pair);

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```

output:



```
+> 1
|
+> 2
|
+> 3
|
-> 4

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
``` hi

we can do that by defining a string variable in the very beginning of the process with assign activity or by defining that in variable panel in the studio at the bottom the window

but make sure that we are not assigning any value to that variable later across the workflow

if we assign later th… Resolved:  

  

FORM 1.  

  

Copy Code

```
private void btnModificaContractul\_Click(object sender, EventArgs e)
        {


            string[] IDProdusContractPrelugit = new string[dataProduseContract.Rows.Count];
            string[] IDProdusContractRetras = new string[dataProduseContract.Rows.Count];

            for (int i = 0; i < dataProduseContract.Rows.Count; i++)
            {

                if (Convert.ToBoolean(dataProduseContract.Rows[i].Cells[0].Value) == false)
                {
                    IDProdusContractPrelugit[i] = dataProduseContract.Rows[i].Cells[5].Value.ToString();
                }
                else
                {
                    IDProdusContractRetras[i] = dataProduseContract.Rows[i].Cells[5].Value.ToString();
                }
            }

           

            try
            {
                frmModificaContract ModificareContract = new frmModificaContract(IDProdusContractPrelugit, IDProdusContractRetras);
                ModificareContract.ShowDialog();
            }
            catch { MessageBox.Show("Trebuie să selectaţi un contract din listă pentru a edita.", "Datele furnizate sunt incomplete."); }
           
        }
```
  

  

FORM 2.  

  

Copy Code

```
string[] IDProdusContractPrelugit;
        string[] IDProdusContractRetras;

        public frmModificaContract(string[] IDProdusContractPrelugit, string[] IDProdusContractRetras)
        {
            InitializeComponent();
            this.IDProdusContractPrelugit = IDProdusContractPrelugit;
            this.IDProdusContractRetras = IDProdusContractRetras;
            AfisareProduseContract();
        }


        void AfisareProduseContract()
        {

            foreach (string ContractPrelungit in IDProdusContractPrelugit)
            {
                if (ContractPrelungit != null)
                {
                    Program.Connection.CommandText = "select * from ContractItems WHERE ContractItemId=@ContractItemId";
                    Program.Connection.AddParameter("@ContractItemId", ContractPrelungit);

                    DataTable Table = new DataTable();
                    Program.Connection.FillDataTable(Table, true);


                    for (int i = 0; i < Table.Rows.Count; i++)
                    {
                        if (String.IsNullOrWhiteSpace(Table.Rows[i]["DeletedId"].ToString()))
                        {
                            bool validare;
                            validare = true;

                            dataProduseContract.Rows.Add(validare, Table.Rows[i]["Name"].ToString(), Table.Rows[i]["Quantity"].ToString() + " " + Table.Rows[i]["QuantityUnit"].ToString(), Table.Rows[i]["Payment"].ToString(), Table.Rows[i]["Description"].ToString(), Table.Rows[i]["ContractItemId"].ToString());
                        }
                        else
                        {
                            bool validarescos;
                            validarescos = false;
                            dataProduseContract.Rows.Add(validarescos, Table.Rows[i]["Name"].ToString(), Table.Rows[i]["Quantity"].ToString() + " " + Table.Rows[i]["QuantityUnit"].ToString(), Table.Rows[i]["Payment"].ToString(), Table.Rows[i]["Description"].ToString(), Table.Rows[i]["ContractItemId"].ToString());
                            dataProduseContract.Enabled = false;
                        }

                    }
                }
            }

            
        }
```
  

  

The problem is allwais i have Null value in array. I'm not sure where it comes from `vlist`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

. It should probably be part of the user state of the parser. For now, let's assume this is the top-level definition:



```
vlist :: [(String, Float)]
vlist = undefined -- fill in the blanks...

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```

I assume you are using `Parsec`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

. You can simplify your parser:



```
primary :: Parser Float
primary = choice [ between (symbol "(") (symbol ")") expression
                 , do { ident <- identifier
                      ; case lookup ident vlist of
                          Nothing -> fail $ "No such identifier: " ++ ident
                          Just v -> return v
                      }
                 ]

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```


  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

You have several options for solving this problem. Here I used the parader monad function `fail`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

. This will cause the parser to return a value `Left parserError`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

. Alternatively, you can replace `error`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

with `fail`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

, which will result in an error that can only be handled in a monad `IO`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

.


 **Note** . To add `vlist`
  




 (adsbygoogle = window.adsbygoogle || []).push({});
 
  

a parser as a state, you need to define a new parser type with this state:



```
data MyParserState = MyParserState { vlist :: [(String, Float)] }
type MyParser = CharParser MyParserState

-- these parsers now need to return MyParser type!
symbol :: String -> MyParser String
identifier :: MyParser String
expression :: MyParser Float

primary :: MyParser Float
primary = choice [ between (symbol "(") (symbol ")") expression
                 , do { st <- getState
                      ; ident <- identifier
                      ; case lookup ident $ vlist st of
                          Nothing -> fail $ "No such identifier: " ++ ident
                          Just v -> return v
                      }
                 ]

        

        
        
        
 (adsbygoogle = window.adsbygoogle || []).push({});
 
        

    
```