It looks like you're new here. Sign in or register to get started.
foreach (DataRow JournalDR in objJournal.GetAllNonSyncedJournalsAndNonProcessed().Rows)
VAR TableDict@1000000000 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Collections.Generic.Dictionary`2"; PROCEDURE TableNameFromID@1000000007(TableNo@1000000000 : Integer) Name : Text; VAR Enum@1000000003 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Collections.Generic.Dictionary`2+Enumerator"; KeyVal@1000000002 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Collections.Generic.KeyValuePair`2"; FieldNoDict@1000000004 : DotNet "'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.System.Collections.Generic.Dictionary`2"; No@1000000005 : Integer; BEGIN IF ISNULL(TableDict) THEN FillTableDict; Enum := TableDict.GetEnumerator; WHILE Enum.MoveNext DO BEGIN KeyVal := Enum.Current; No := KeyVal.Value; IF No = TableNo THEN EXIT(KeyVal.Key); END; EXIT(FORMAT(TableNo)); END;
Answers
Below is an example where I search a Dictionary for a Value to get back the Key:
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Yes, i know
but I can't figure out how to use it like :
foreach (DataRow JournalDR in objJournal.GetAllNonSyncedJournalsAndNonProcessed().Rows)
FOREACH JournalDR IN objJournal.GetAllNonSyncedJournalsAndNonProcessed().Rows DO
BEGIN
//your code.
end;
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n