Ned, Thanks for your info I just did that works fine so if I do Not declare functions and I call main funtion from bottom Of the code is that wrong? Andre -----Original Message----- On Monday 24 February 2003 03:00 pm, Andre Abelian wrote: > Hi to all engineers, > > I wrote simple led test code for microchip demo board2 > it works but when I move main () function to top it generates > an error why? > Any help will appreciate. Hitech support said I didn't > Define port_init () function but I do not get it. You should declare or define all functions that you're calling, before you call them. If you move main() to the beginning of the program (which is what I believe you're trying to do), the compiler hasn't yet seen port_init(), which you're calling from main(). You could do this: void port_init(void); /* declare it */ void main(void) { port_init(); /* stuff */ } void port_init(void) /* define it */ { /* stuff */ } -- Ned Konz http://bike-nomad.com GPG key ID: BEEA7EFE -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body