1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 <2012> 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 | Index | 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 <2012> 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 |
<== Date ==> | <== Thread ==> |
---|
Subject: | Re: How to access menu choice strings inside record support |
From: | Till Straumann <[email protected]> |
To: | "Zhang, Dehong" <[email protected]> |
Cc: | "[email protected]" <[email protected]> |
Date: | Thu, 13 Dec 2012 14:47:51 -0600 |
Have a look at db/dbConvert.c: getMenuString() this is a non-public routine but it's simple and you can extract the relevant code/idea from there. HTH - Till On 12/13/2012 02:12 PM, Zhang, Dehong wrote:
Hi, I am writing a custom record to deal with a particular hardware. This hardware has a few different operation modes, which are represented with a set of name strings, not numbers. We can talk to it to get or set this mode, with strings. The problem is, when a choice is made, we get a menu choice number. Then I will need to find the corresponding name string, to write to the hardware; on the other direction, when I query the hardware to find its current mode, I get back a string. Then I need to find the corresponding choice number to set the button properly. All these name strings are defined in the menu definition. How can I access them inside the record support? Without having to declare an array of strings, beside the menu definition? Thanks much for your advices! Best regards, Dehong