sendVarNoDupe(int number, sometype name) // sometype is the type for sPmdgData.MCP_name
{
if ((int) name!= T7X_MCP_name)
{
T7X_MCP_name = name;
IOCP.sendVarData(number, T7X_MCP_name);
}
}
Then change your code to sendVarNoDupe(number, sPmdgData.MCP_name); using find/replace
I have several hundred c++ code lines in a text file in this format:
You didn't say whether the lines are all contiguous. If they are, then create a vector or array containing all the data, then use a loop to call the function. This will make it easier to make changes in the future, and the code will be a lot smaller.
Using regex in NotePad ++ seems to work Ok with given example, but it dosn't work with all name formats.
Looking more in detail how the names can be, this is correct
examples of name
MCP_RangeTFC_Sw_Pushed[1]
MCP_IAS_MACH_Toggle_Sw_Pushed
LTS_RunwayTurnoff_Sw_ON[0]
I hope these are all integral values and not strings or something. I suspect that MiiNiPaa's comment was pointing out that the otherwise, a C-style cast won't do what you probably want.
I am very interested by your IOCP C++ code to read/write SIOC variables from a C++ program. After long searchs through the web, I have not find an IOCP client based on the SIOC protocol.
Any help to find the source including the IOCP.sendVarData method will be highly apreciated !
I have downloaded a light IOCP client using winsock. From this code and some inormations about IOCP protocol applied to SIOC, I am writing my own c++ class to manage SIOC variables from a c++ program. My first results are very positive. I am experimenting delay times for executing SIOC commands impresively shorter than those required by FSUIPC !