c4 icon indicating copy to clipboard operation
c4 copied to clipboard

How to call external functions.

Open jenya7 opened this issue 3 years ago • 1 comments

In order to make a script useful for a real world I'd like to write

int main() { int sens1_val; int sens2_val; while(1) { sens1_val = m_sensor.GetDataByValType(1, SENS_VAL_TYPE_TEMP); sens2_val = m_sensor.GetDataByValType(2, SENS_VAL_TYPE_HUM); if ( sens1_val > 30.5 && sens2_val > 60) Out(1, true);

}

}

But how to point the script to external functions (m_sensor.GetDataByValType, Out)?

jenya7 avatar Jan 10 '22 09:01 jenya7

You are writing in C, not C++

Also this is an extremely limited dialect of C. You might want to add a new opcode to the interpreter to handle this

iProgramMC avatar Mar 19 '22 11:03 iProgramMC