In SX Microcontrollers, SX/B Compiler and SX-Key Tool, JonnyMac wrote: You could put the values into a DATA table and use READ. Also, it's considered good practice to define a routine that retursn a value as a fuction. [code]GET_LEVELS FUNC 1, 1[/code] [code]FUNC GET_LEVELS tmpB1 = __PARAM1 IF tmpB1 < 30 THEN READ Levels+tmpB1, tmpB2 ELSE tmpB2 = 0 ENDIF RETURN tmpB2 ENDFUNC[/code] [code]Levels: DATA 150, 152, 154, 156, 158, 160, 162, 164, 167, 169 DATA 171, 174, 176, 179, 182, 185, 188, 190, 194, 197 DATA 200, 203, 207, 211, 214, 218, 222, 226, 231, 235 DATA 240[/code] ---------- End of Message ---------- You can view the post on-line at: http://forums.parallax.com/forums/default.aspx?f=7&p=1&m=291663#m291675 Need assistance? Send an email to the Forum Administrator at forumadmin@parallax.com The Parallax Forums are powered by dotNetBB Forums, copyright 2002-2008 (http://www.dotNetBB.com)