Thread: Re: [Quickfix-developers] Iterate through message fields?
Brought to you by:
orenmnero
From: <or...@qu...> - 2008-08-29 16:39:59
|
Yes. foreach( StringField field in message.GetEnumerator() ) When you iterate everything is given to you as a string field, if you need it in another format you wil need to convert it. --oren > -------- Original Message -------- > Subject: [Quickfix-developers] Iterate through message fields? > From: Alexis Michaelides <ale...@ya...> > Date: Tue, August 19, 2008 5:47 am > To: qui...@li... > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html<hr>In .NET is there any way to iterate through all the fields of a QuickFix message? e.g. using foreach? > Thanks, > Alexis<hr>------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/<hr>_______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers |
From: Alexis M. <ale...@ya...> - 2008-08-29 18:57:53
|
Thanks Oren - though I'm getting an exception doing the below. Right now I'm trying something simple like: QuickFix.Message fixMsg = new Message(line); foreach (QuickFix.StringField sf in fixMsg.GetEnumerator()) { Console.WriteLine(sf.ToString()); } Getting an exception when compiling: "foreach statement cannot operate on variables of type 'System.Collections.IEnumerator' because 'System.Collections.IEnumerator' does not contain a public definition for 'GetEnumerator'" Regards, Alexis ----- Original Message ---- From: "or...@qu..." <or...@qu...> To: Alexis Michaelides <ale...@ya...> Cc: qui...@li... Sent: Friday, August 29, 2008 5:39:52 PM Subject: RE: [Quickfix-developers] Iterate through message fields? Yes. foreach( StringField field in message.GetEnumerator() ) When you iterate everything is given to you as a string field, if you need it in another format you wil need to convert it. --oren > -------- Original Message -------- > Subject: [Quickfix-developers] Iterate through message fields? > From: Alexis Michaelides <ale...@ya...> > Date: Tue, August 19, 2008 5:47 am > To: qui...@li... > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html<hr>In .NET is there any way to iterate through all the fields of a QuickFix message? e.g. using foreach? > Thanks, > Alexis<hr>------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/<hr>_______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers |
From: Mike G. <mg...@co...> - 2008-08-30 15:30:38
|
Try this: Message msg = new Message(); msg.setField(ClOrdID.FIELD, "1234"); foreach (StringField field in msg) { Console.WriteLine(field.ToString()); } -- Mike Gatny Connamara Systems, LLC http://www.connamara.com/ |
From: <or...@qu...> - 2008-09-02 15:05:18
|
Ah, yes, sorry. It should be: forwach( QuickFix.StringField sf in fixMsg ) --oren > -------- Original Message -------- > Subject: Re: [Quickfix-developers] Iterate through message fields? > From: Alexis Michaelides <ale...@ya...> > Date: Fri, August 29, 2008 1:57 pm > To: qui...@li... > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > QuickFIX Support: http://www.quickfixengine.org/services.html > Thanks Oren - though I'm getting an exception doing the below. Right now I'm trying something simple like: > QuickFix.Message fixMsg = new Message(line); > foreach (QuickFix.StringField sf in fixMsg.GetEnumerator()) > { > Console.WriteLine(sf.ToString()); > } > Getting an exception when compiling: > "foreach statement cannot operate on variables of type 'System.Collections.IEnumerator' because 'System.Collections.IEnumerator' does not contain a public definition for 'GetEnumerator'" > Regards, > Alexis > ----- Original Message ---- > From: "or...@qu..." <or...@qu...> > To: Alexis Michaelides <ale...@ya...> > Cc: qui...@li... > Sent: Friday, August 29, 2008 5:39:52 PM > Subject: RE: [Quickfix-developers] Iterate through message fields? > Yes. > foreach( StringField field in message.GetEnumerator() ) > When you iterate everything is given to you as a string field, if you > need it in another format you wil need to convert it. > --oren > > -------- Original Message -------- > > Subject: [Quickfix-developers] Iterate through message fields? > > From: Alexis Michaelides <ale...@ya...> > > Date: Tue, August 19, 2008 5:47 am > > To: qui...@li... > > QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html > > QuickFIX Support: http://www.quickfixengine.org/services.html<hr>In .NET is there any way to iterate through all the fields of a QuickFix message? e.g. using foreach? > > Thanks, > > Alexis<hr>------------------------------------------------------------------------- > > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > > Build the coolest Linux based applications with Moblin SDK & win great prizes > > Grand prize is a trip for two to an Open Source event anywhere in the world > > http://moblin-contest.org/redirect.php?banner_id=100&url=/<hr>_______________________________________________ > > Quickfix-developers mailing list > > Qui...@li... > > https://lists.sourceforge.net/lists/listinfo/quickfix-developers > > ------------------------------------------------------------------------- > This SF.Net email is sponsored by the Moblin Your Move Developer's challenge > Build the coolest Linux based applications with Moblin SDK & win great prizes > Grand prize is a trip for two to an Open Source event anywhere in the world > http://moblin-contest.org/redirect.php?banner_id=100&url=/ > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers |