In SX Microcontrollers, SX/B Compiler and SX-Key Tool, peterverkaik wrote: Hi David, [quote="You"]I wonder however, could you not equate the 'field labels' as index offset constants and then use the regular index routines? [/quote]Yes and so I did. I have abandoned the index and named routines all together so now I have only 4 [u]byteindexed[/u] routines and 2 macros. The byteindexed routines do not double the index so they can be used even if an array supports wordfields and bytefields. The 'problem' with fieldaddresses is that they are absolute and not relative to the arraybegin. To support multiple instances of identical objects (like sensor1 and sensor2 in the demo) not only the address of the instance but also the address of the object definition must be given. I have resolved that using two macros GET_VAR and PUT_VAR that you call like this: \GET_VAR resultName,objectName,objectField,objectInstance \GET_VAR objectName,objectField,objectInstance \GET_VAR resultName,varName \GET_VAR varName \PUT_VAR objectName,objectField,objectInstance,value \PUT_VAR objectName,objectField,objectInstance \PUT_VAR varName,value \PUT_VAR varName Check out the generated code in the list view. The subroutines do not yet suppoert spanned banks on the sx18/20/28. regards peter ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=332288#m332605 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2009 (http://www.dotNetBB.com)