To avoid flames, if I try to reply a cannot find a 'post' nor 'preview' button, so I must start a new message thread. Sorry for the inconvinience. Dear KEIL Support Team, can you solve the problem with posting ? ---------------------------------------- It simply sets the all MInfo.'values' to a defined status, that is right. It was probably used with the intention to preset more than one variable of type MfCmdInfo. Example:
MfCmdInfo MInfo, MSecondInfo, MAnotherInfo; ResetInfo(MInfo); ResetInfo(MSecondInfo); ResetInfo(MAnotherInfo); will result in: MInfo.cmd=0 MInfo.status=MI_OK; ..... MSecondInfo.cmd=0; MSecondInfo.status=MI_OK; ..... MAnotherInfo.cmd=0; MAnotherInfo.status=MI_OK; .....
"To avoid flames, if I try to reply a cannot find a 'post' nor 'preview' button, so I must start a new message thread." The buttons are there - you just have to scroll way over to the right to find them! "Dear KEIL Support Team, can you solve the problem with posting ?" The problem lies in the original post - because it was so damned wide! The buttons just position themselves at the midpoint of the width! "It was probably used with the intention to preset more than one variable of type" Which begs the question: why use a macro rather than a true function, or memset?
Hi Andrew , thanks your are right, with your hints, about the buttons. ;-) Stefan ( I keep it in mind )
"Which begs the question: why use a macro rather than a true function, or memset?" To use a function, you'd have to pass a pointer to the structure; maybe the original author didn't understand how to use structure pointers? Or maybe he was worried about efficiency - in which case memset would have been better.