To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.robotics.handyboardOpen lugnet.robotics.handyboard in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / Handy Board / 7063
7062  |  7064
Subject: 
Re: IC trouble - function definition
Newsgroups: 
lugnet.robotics.handyboard
Date: 
Sat, 13 Nov 1999 15:50:38 GMT
Original-From: 
David Kott <DAKOTT@HOME.avoidspamCOM>
Viewed: 
870 times
  
On Sat, 13 Nov 1999, John Bachman wrote:

Thanks for all the helpful device but the darned thing still does not work.  I have created a simplified program to try to figure out what I am doing wrong.  Here it is:

/* A simplified program to figure out what is wrong */

long time;

void start()
{
       phony();

       void phony() /*  Line 9 syntax error is reported here */
       {
       while (digital(2) == 1)
                      {
time = mseconds();
}
       }
}



whoa!  Local function definitions.  Even GCC doesn't grok that.  Try
extracting the function definition phony() from start() like so:


long time;


void
phony()
{
while (digital(2) == 1) {
time = mseconds();
}
}


void
start()
{
phony();
}


-d




Curiosity may, or may not, have killed Schrodinger's cat.
                                                        -townba



Message is in Reply To:
  Re: IC trouble - function definition
 
Thanks for all the helpful device but the darned thing still does not work. I have created a simplified program to try to figure out what I am doing wrong. Here it is: /* A simplified program to figure out what is wrong */ long time; void start() { (...) (25 years ago, 13-Nov-99, to lugnet.robotics.handyboard)

7 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR