View unanswered posts | View active topics It is currently Mon Sep 21, 2020 12:50 pm

Reply to topic  [ 2 posts ] 
Order of Tasks/Functions 
Author Message

Joined: Sat Jun 02, 2007 8:54 pm
Posts: 17
Post Order of Tasks/Functions
I am used to creating my main task first and then putting subroutines / functions after the main task. When I did this I got all kinds of errors.. I finally tried putting my subroutines / function before the task main and everything worked..

Is this a limitation of RobotC being interpretive rather than compiled?

(I'm going out on a limb here.. I think robotC is interpretive.. maybe I'm wrong)

It's not a huge thing to get used to, but I generally like to put my 'blocks' in order of importance as I write.


Wed Oct 24, 2007 6:50 am
Site Admin
Site Admin

Joined: Wed Jan 24, 2007 10:44 am
Posts: 442
Location: Pittsburgh, PA
Hi again :) Actually, that's a formality of the C language. If you want to place functions above task main, you must first "prototype" the functions above task main.

For example:
void moveForward();

task main()
   motor[motorC] = 100;


void moveForward()
   motor[motorC] = 100;
   motor[motorB] = 100;

Thanks :)

Vu Nguyen
Software Training Development Team | Webmaster
Need more support? Email ROBOTC Support at to put in a support ticket| Robomatter Store | Robotics Academy | CS2N

Wed Oct 24, 2007 9:44 am
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.