Ladies and Gents,
This is for working with TARGET for "Warthog Thrustmaster HOTAS"
I am trying to use a string as a variable for condition detection:
Code:
if (my_condition == 'red') do_something();
I've looked at "strcmp" function, but I keep getting a "Runtime Error: Bad alias" error in code:
alias test3 = 'test';
alias test4 = 'test';
int myfunction() {
if ( strcmp(test3, test3) ) {
printf("OK 12 \xa");
}
}
What variable type do I need/can use to achieve this feat?
And in this manner, would I be able to pass this variable into a function?
Code:
??? my_string_var = 'blue';
my_function(my_string_var);
// snip
int my_function (??? my_local_var = 'some default value') {}
I've been trying to use Alias, but it does not comply well. I went as far as trying to use structs and char-array compare functions, but have not gotten that to work either.
And, while done with that, can I output the variable contents somehow?
Code:
printf(" and the var is " + my_string_var + "!\xa");
// or I will take even
printf(my_string_var);
I understand printf wants a "parameter" for printing, but %s doesn't work =(
printf("OK 2 %s \xa", 'test3');
I figure I can use int conditions, but they would be a number and not a string.
I would also love to know if I can actually build C-style Class functionality in tmc files, but I am not holding my breath on possibility of this. =)
Thanks much.
~T