Jump to content

TheT

Members
  • Posts

    4
  • Joined

  • Last visited

  1. I take that back, still had the single-quotes. Got it to work. Thank you very much, good sir.
  2. Had a chance to test out some code. Unfortunately, getting a bad-alias error: "Runtime Error: Bad alias" Code: alias test3 = 'test'; alias test4 = 'test'; int my_function( ) { if ( strcmp(&test3, &test3) == 0 ) { printf("OK 12 \xa"); } }
  3. Achiral, Thanks for the help. It is very much appreciated. I was not aware the Double-Quotes were required. Good to know. I have not tried out your suggestions yet, but just to double-check: Alias is passed by reference, with the use of & sign? Just want to confirm that's the case. All of the other variable seem to be by-value. I can see the use for alias for items like Joystick and Thruster box inputs (aka you send your commands to a physical location, which is kind of clever). I was thinking about defines, but wanted to make sure I have the string base down first without using defines as scapegoats. Thanks.
  4. 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
×
×
  • Create New...