Return function?

Support forum for users of the M1 Build

Return function?

Postby kareltuning on Thu Mar 10, 2022 3:59 pm

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...
kareltuning
 
Posts: 1
Joined: Sun Jan 30, 2022 6:41 am

Re: Return function?

Postby rntechnologies on Fri Jul 01, 2022 8:56 pm

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.
Regards,
Ryan
Powertune Australia
rntechnologies
Pro User
 
Posts: 91
Joined: Tue Aug 07, 2018 9:45 am
Location: Sydney, Australia


Return to M1 Build

Who is online

Users browsing this forum: No registered users and 10 guests