Thanks -- I think there are a fair number of people who would like something like this.
Comments inline. On Sun, Jun 21, 2009 at 08:52:40PM +0000, robert harpham wrote: > varible should be in EMCIO section, called > TOOL_STORE = > > TOOL_STORE = 0 or not declared, means default behavour of EMC, no value stored > or read. even if value is in the file. > TOOL_STORE = 1, means the value is read on load up of EMC Unless you envision having other values of TOOL_STORE in the future, I believe you should use zero and nonzero, rather than checking for exactly 1. > +//START for read_toolInSpindle I generally don't favor adding comments like these, although you will find places in the code that have them. > + if (NULL != (inistring = inifile.Find("TOOL_STORE", "EMCIO"))) { > + if(1 == sscanf(inistring, "%i", &store_toolInSpindle)) { + > if (store_toolInSpindle == 1){ > + store_toolInSpindle = 1; > + } else { > + store_toolInSpindle = 0; > + } Another form of inifile.Find can directly read integers, and is preferable for new code. I *think* (untested): if(inifile.Find(&storeToolInSpindle, "TOOL_STORE", "EMCIO") != ERR_NONE) { store_toolInSpindle = 0; } > + //see if we need to save the toolinspindle value > + if (store_toolInSpindle == 1){ Just write 'if(store_toolInSpindle)' to check for a nonzero value. Jeff ------------------------------------------------------------------------------ Are you an open source citizen? Join us for the Open Source Bridge conference! Portland, OR, June 17-19. Two days of sessions, one day of unconference: $250. Need another reason to go? 24-hour hacker lounge. Register today! http://ad.doubleclick.net/clk;215844324;13503038;v?http://opensourcebridge.org _______________________________________________ Emc-developers mailing list Emc-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-developers