Problem with Parse function

I have got a predefined parse function for reading the next line from an input file.
I use it in a loop and the case is I need the read the next line and if it is *nodalloads then the loop should close and get into the next loop. In this next Loop the first line it should read is the *nodalloads but according to the parse function it reads the next line which is **comment . I need to read the previous line again and continue in the next loop. How can I fix this. I'm attaching the code.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
for (;;)
    {
        if (!Parse.ReadNextLine (m_FileInput, m_nLineNumber, szInputString, 
                             MAXCHARS, szComment))
            ErrorHandler (INVALIDINPUT);
// here if the next line read is *nodalloads then the loop should break.
        else
        {
            std::istringstream szFormatString (szInputString);
            szFormatString >> nN >> nXFC >> nYFC >> nZFC>> fXD >> fYD >> fZD;
            if (szFormatString.fail() || szFormatString.bad())
                ErrorHandler (INVALIDINPUT);
        }
        if (nN <= 0 || nN > m_nNodes) ErrorHandler (INVALIDNODENUM);
        if (nXFC < 0 || nXFC > 1) ErrorHandler (INVALIDNODALFIXITY);
        if (nYFC < 0 || nYFC > 1) ErrorHandler (INVALIDNODALFIXITY);
		if (nZFC < 0 || nZFC > 1) ErrorHandler (INVALIDNODALFIXITY);
        m_NodalData(nN).SetFixity (nXFC, nYFC, nZFC);
        m_NodalData(nN).SetDispl (fXD, fYD, fZD);
    }

// header line ( here it should read the *nodalloads line but reads the nextline
    if (!Parse.ReadNextLine (m_FileInput, m_nLineNumber, szInputString, 
                             MAXCHARS, szComment))
        ErrorHandler (INVALIDINPUT);
    // read nodal loads and temperature changes
    float fXF, fYF, fZF, fTL;					
    for (i=1; i <= m_nNodes; i++)
// and the code continues  


Please help me with this . THANK YOU
Last edited on
Registered users can post here. Sign in or register to post.