Page 1 of 1

Return function?

PostPosted: Thu Mar 10, 2022 3:59 pm
by kareltuning
Is there a return statement that allows me to exit an update code function?

For example:
------------
Code execution enters Update Block:

if( testMode ) {
x = whatever;
return;
}

// perform long calculation for X after this point
-----------

So that everything doesn't have to be wrapped in if-else statements...

Re: Return function?

PostPosted: Fri Jul 01, 2022 8:56 pm
by rntechnologies
Can you explain what you are trying to achieve?
Are you trying to optimise CPU usage? or are you trying to make your code neater?

There are a tonne of ways to achieve the same thing, remembering that the code that you write in build isn't the final code that goes to the ECU as it goes through the compiler.