|
|
|
Valued Member
      
Group: General Forum Members
Last Login: 2 days ago @ 7:09 AM
Points: 73,
Visits: 253
|
|
Hi guys,
It would be nice if you could help me with the following issue:
I need to read a DFT level variable in a script component (set as transformation). Depending on its value make some calculation and then update its value again. That's should be made for every incomming row. The problem that I´ve encountered is I tried to read the variable in the row processing method and write it in the postexecute() method. I got this error "The collection of variables locked for read and write access is not available outside of PostExecute." But I really need the value of the variable in the main method. Below is my code
public override void PostExecute() { base.PostExecute(); /* Add your code here for postprocessing or remove if not needed You can set read/write variables here, for example: Variables.MyIntVar = 100 */ Variables.receiptKey = newReceipt; }
public override void Input0_ProcessInputRow(Input0Buffer Row) { /* Add your code here */ //currentReceipt = Row.BelegKey; currentReceipt = Variables.receiptKey; newReceipt = Row.TransactionExtId;
MessageBox.Show("The stored receipt key is: " + currentReceipt.ToString() + " The new is: " + newReceipt.ToString()); if ( currentReceipt == newReceipt) { Counter++; } else { Counter = 0; } Row.Position = Counter;
} Any comment would be appreciated.
Kind Regards
Paul Hernández http://hernandezpaul.wordpress.com/ https://twitter.com/paul_eng
|
|
|
|