I'm having a problem with reading boolean states from a scenario file and need someone to check my work.
Is there any reason that the following shouldn't work?
LES_attached and SLA_attached are booleans
I've already confirmed that the 1s and 0s are being read they're just not making the translation into "true" and "false". I suspect that I've missed something obvious but have no clue what.
Is there any reason that the following shouldn't work?
Code:
void CSM::clbkLoadStateEx (FILEHANDLE scn, void *status)
{
int i = 0;
char *cbuf;
while (oapiReadScenario_nextline (scn, cbuf))
{
if (!_strnicmp (cbuf, "LES_ATTACHED", 12))
{
sscanf (cbuf+12, "%i", &LES_attached);
}
if (!_strnicmp (cbuf, "SLA_ATTACHED", 12))
{
sscanf (cbuf+12, "%i", &SLA_attached);
}
...
LES_attached and SLA_attached are booleans
I've already confirmed that the 1s and 0s are being read they're just not making the translation into "true" and "false". I suspect that I've missed something obvious but have no clue what.