Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/17/08 23:00
Read: times


 
#150971 - Not sure how it should work...
Responding to: ???'s previous message

If bit 6 is the write strobe, surely the ascii characters need some manipulation eg: ascii 'A' = 0x41, so a lookup table or other method would need to be used. I'd need more information in order to give a more concise answer.


As for the term 'parsing' - I don't think that is correct in this context. The compiler 'parses' the for loop in order to decompose its structure, you want to find out how to arrange the code to do what you want. Anyway, for variable length strings a while loop would probably be a better choice.



void print_msg(char *msg)
{
    while(*msg)
       {
       P0 = *msg;
       ...do whatever
       msg++;
       }
}
'c' appends a null character '\0' or 0x00 onto the ends of strings, so the statement 'while (*msg)' translates into "while the current character value is not equal to zero, do"



List of 13 messages in thread
TopicAuthorDate
For loop parsing with a rising edge write            01/01/70 00:00      
   Forgot to mention            01/01/70 00:00      
      Not sure how it should work...            01/01/70 00:00      
   I don't quite understand what's your problem...            01/01/70 00:00      
      Better clarification of error I hope...            01/01/70 00:00      
      No, it would not work            01/01/70 00:00      
         yeah. my bad...            01/01/70 00:00      
   No problem here            01/01/70 00:00      
   Is the string fixed or variable length ?            01/01/70 00:00      
      Ment to mention            01/01/70 00:00      
   Oh - I C            01/01/70 00:00      
      I have the answer thanks to you folks...:)            01/01/70 00:00      
   sounds like missing pullups            01/01/70 00:00      

Back to Subject List