I have uploaded a new test release zip and firmware image to the test_releases folder on the BricxCC website.
Code: Select all
#define DRAW_OPT_CLEAR_LINE (0x0800) /*!< When drawing text, clear the entire line before drawing the text */
#define DRAW_OPT_CLEAR_EOL (0x1000) /*!< When drawing text, clear to the end of the line after drawing the text */
Use these two constants with the new firmware image to clear the entire line or clear to the end of the line after drawing text. These work with NumOut and TextOut.
Exponential numbers and floating point constants outside the range if Int64:
Code: Select all
//#define FLT_MAX 1E37
const float NEG_FLT_MAX=-1E+37;
const float FLT_MAX=1E+37;
//float max(float f1, float f2, float f3 = -FLT_MAX, float f4 = -FLT_MAX, float f5 = -FLT_MAX) {
float max(float f1, float f2, float f3 = NEG_FLT_MAX, float f4 = NEG_FLT_MAX, float f5 = NEG_FLT_MAX) {
float flarr[5], f;
flarr[0]=f1; flarr[1]=f2; flarr[2]=f3; flarr[3]=f4; flarr[4]=f5;
f=ArrayMax( flarr, 0, 5 );
return f;
}
task main() {
NumOut(0,8, max(7.1, 12.4, 5.9, 18.6)); // These both seem to work fine now
NumOut(0,0, max(7.1, 12.4, 5.9, 1e+19));
for(;;);
}
Line clearing:
Code: Select all
task main()
{
string msg = "testing";
TextOut(0, 52, msg);
Wait(SEC_2);
NumOut(24, 52, 10, DRAW_OPT_CLEAR_LINE);
Wait(SEC_2);
TextOut(0, 26, msg);
Wait(SEC_2);
NumOut(24, 26, 10, DRAW_OPT_CLEAR_EOL);
Wait(SEC_5);
}
John Hansen