Like Tree2Likes
  • 1 Post By rags_to_riches
  • 1 Post By iMalc

syntax errors

This is a discussion on syntax errors within the C++ Programming forums, part of the General Programming Boards category; Hi all, I am absolutely new to C++ programming. Had a requirement to write a piece of c++ code as ...

  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    3

    syntax errors

    Hi all,
    I am absolutely new to C++ programming. Had a requirement to write a piece of c++ code as part of my project. Tried to write with limited knowledge but ran into several syntax issues. Can someone please help me diagnose them.

    Below is the code
    ************************************************** ***********
    Code:
    APT_Int32    l_startyear;
    APT_Int32    l_startmonth;
    APT_Int32    l_endyear;
    APT_Int32    l_endmonth;
    APT_Int32    l_numberofyears;
    APT_Int32    l_numberofmnths;
    APT_Int32    l_monthlyvalue;
    APT_Int32    l_year_start_value;
    APT_Int32    l_mv_jan_1;
    APT_Int32    l_mv_feb_1;
    APT_Int32    l_mv_mar_1;
    APT_Int32    l_mv_apr_1;
    APT_Int32    l_mv_may_1;
    APT_Int32    l_mv_jun_1;
    APT_Int32    l_mv_jul_1;
    APT_Int32    l_mv_aug_1;
    APT_Int32    l_mv_sep_1;
    APT_Int32    l_mv_oct_1;
    APT_Int32    l_mv_nov_1;
    APT_Int32    l_mv_dec_1;
    
    //----Assign Values to the Local Variables----
    l_startyear = in0.start_year;
    l_startmonth = in0.start_month;
    l_endyear = in0.end_year;
    l_endmonth = in0.end_month;
    l_numberofyears = in0.number_of_years;
    l_numberofmnths = in0.number_of_mnths;
    l_monthlyvalue = in0.monthly_value;
    
    l_mv_jan_1 = if((l_startmonth > 1) || (l_numberofyears = 1 && l_endmonth < 1)) { 0 } else l_monthlyvalue;
    l_mv_feb_1 = if((l_startmonth > 2) || (l_numberofyears = 1 && l_endmonth < 2)) { 0 } else l_monthlyvalue;
    l_mv_mar_1 = if((l_startmonth > 3) || (l_numberofyears = 1 && l_endmonth < 3)) { 0 } else l_monthlyvalue;
    l_mv_apr_1 = if((l_startmonth > 4) || (l_numberofyears = 1 && l_endmonth < 4)) { 0 } else l_monthlyvalue;
    l_mv_may_1 = if((l_startmonth > 5) || (l_numberofyears = 1 && l_endmonth < 5)) { 0 } else l_monthlyvalue;
    l_mv_jun_1 = if((l_startmonth > 6) || (l_numberofyears = 1 && l_endmonth < 6)) { 0 } else l_monthlyvalue;
    l_mv_jul_1 = if((l_startmonth > 7) || (l_numberofyears = 1 && l_endmonth < 7)) { 0 } else l_monthlyvalue;
    l_mv_aug_1 = if((l_startmonth > 8) || (l_numberofyears = 1 && l_endmonth < 8)) { 0 } else l_monthlyvalue;
    l_mv_sep_1 = if((l_startmonth > 9) || (l_numberofyears = 1 && l_endmonth < 9)) { 0 } else l_monthlyvalue;
    l_mv_oct_1 = if((l_startmonth > 10) || (l_numberofyears = 1 && l_endmonth < 10)) { 0 } else l_monthlyvalue;
    l_mv_nov_1 = if((l_startmonth > 11) || (l_numberofyears = 1 && l_endmonth < 11)) { 0 } else l_monthlyvalue;
    l_mv_dec_1 = if((l_startmonth > 12) || (l_numberofyears = 1 && l_endmonth < 12)) { 0 } else l_monthlyvalue;
    
    For(int l_year_start_value=1;l_year_start_value=<l_numberofyears;l_year_start_value++)
    {
        if ( l_year_start_value = 1)
           {
              out0.JAN  =  l_mv_jan_1;
              out0.FEB  =  l_mv_feb_1;
              out0.MAR  =  l_mv_mar_1;
              out0.APR  =  l_mv_apr_1;
              out0.MAY  =  l_mv_may_1;
              out0.JUNE =  l_mv_jun_1;
              out0.JULY =  l_mv_jul_1;
              out0.AUG  =  l_mv_aug_1;
              out0.SEP  =  l_mv_sep_1;
              out0.OCT  =  l_mv_oct_1;
              out0.NOV  =  l_mv_nov_1;
              out0.DEC  =  l_mv_dec_1;
              writeRecord(0);
           }
       else
           {
              out0.JAN  =  if( l_numberofyears == l_year_start_value && l_endmonth < 1 ) { 0 } else l_monthlyvalue; 
              out0.FEB  =  if( l_numberofyears == l_year_start_value && l_endmonth < 2 ) { 0 } else l_monthlyvalue;
              out0.MAR  =  if( l_numberofyears == l_year_start_value && l_endmonth < 3 ) { 0 } else l_monthlyvalue;
              out0.APR  =  if( l_numberofyears == l_year_start_value && l_endmonth < 4 ) { 0 } else l_monthlyvalue;
              out0.MAY  =  if( l_numberofyears == l_year_start_value && l_endmonth < 5 ) { 0 } else l_monthlyvalue;
              out0.JUNE =  if( l_numberofyears == l_year_start_value && l_endmonth < 6 ) { 0 } else l_monthlyvalue;
              out0.JULY =  if( l_numberofyears == l_year_start_value && l_endmonth < 7 ) { 0 } else l_monthlyvalue; 
              out0.AUG  =  if( l_numberofyears == l_year_start_value && l_endmonth < 8 ) { 0 } else l_monthlyvalue;
              out0.SEP  =  if( l_numberofyears == l_year_start_value && l_endmonth < 9 ) { 0 } else l_monthlyvalue;
              out0.OCT  =  if( l_numberofyears == l_year_start_value && l_endmonth < 10 ) { 0 } else l_monthlyvalue;
              out0.NOV  =  if( l_numberofyears == l_year_start_value && l_endmonth < 11 ) { 0 ) else l_monthlyvalue;
              out0.DEC  =  if( l_numberofyears == l_year_start_value && l_endmonth < 12 ) { 0 ) else l_monthlyvalue;
              writeRecord(0);
           }
    }
    ************************************************** ***********

    below are the errors, might seem simple to you guys but getting to be a little difficult for me to understand. I have spent the last 6 hours trying everything i could have (there was effort ).

    ************************************************** ***********

    Code:
    ##E TBLD 000000 Subprocess command failed with exit status 256.
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd): In member function 
       `virtual APT_Status TPUBNPPIBJ405MonRptRecCreate::runLocally()':
    Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):42: error: invalid 
       conversion from `const void*' to `APT_Int32'
    ##I TBLD 000000 g++ -fPIC -O   -I/ford/.p_fedw_dev/fedw/FEDW_DEV/FEDW_DEV_proj/buildop -I/ford/thishost/proj/Ascential/DataStage/PXEngine/include -O -fPIC -Wno-deprecated -c /ford/.p_fedw_dev/fedw/FEDW_DEV/FEDW_DEV_proj/buildop/bosource17608-0.C -o /ford/thishost/proj/Ascential/Projects/FEDW_DEV/scratch/def/bosource17608-0_s.o.
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):45: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):46: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd): At global scope:
    Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):47: error: ISO C++ 
       forbids declaration of `l_mv_mar_1' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):47: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):48: error: ISO C++ 
       forbids declaration of `l_mv_apr_1' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):48: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):49: error: ISO C++ 
       forbids declaration of `l_mv_may_1' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):49: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):50: error: ISO C++ 
       forbids declaration of `l_mv_jun_1' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):50: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):51: error: ISO C++ 
       forbids declaration of `l_mv_jul_1' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):51: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):52: error: ISO C++ 
       forbids declaration of `l_mv_aug_1' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):52: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):53: error: ISO C++ 
       forbids declaration of `l_mv_sep_1' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):53: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):54: error: ISO C++ 
       forbids declaration of `l_mv_oct_1' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):54: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):55: error: ISO C++ 
       forbids declaration of `l_mv_nov_1' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):55: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):56: error: ISO C++ 
       forbids declaration of `l_mv_dec_1' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):56: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):58: error: syntax 
       error before `;' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):59: error: ISO C++ 
       forbids declaration of `For' with no type
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd): In function `int 
       For(...)':
    Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):60: error: `
       l_year_start_value' undeclared (first use this function)
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):60: error: (Each 
       undeclared identifier is reported only once for each function it appears 
       in.)
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):62: error: `out0' 
       undeclared (first use this function)
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):62: error: `
       l_mv_jan_1' undeclared (first use this function)
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):63: error: `
       l_mv_feb_1' undeclared (first use this function)
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):74: error: `
       APT_Bop_outCur' undeclared (first use this function)
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):78: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):79: error: syntax 
       error before `if'
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd): At global scope:
    Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):80: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):81: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):82: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):83: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):84: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):85: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):86: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):87: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):88: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):89: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: Per-Record Code (buildop/TPUBNPPIBJ405MonRptRecCreate.opd):90: error: syntax 
       error before `.' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: bosource17608-0.C:572: error: `APT_Bop_transfers' was not declared in this 
       scope
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: bosource17608-0.C:572: error: syntax error before `;' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: bosource17608-0.C:572: error: syntax error before `++' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: bosource17608-0.C:579: error: `APT_Bop_outputs' was not declared in this scope
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: bosource17608-0.C:579: error: syntax error before `;' token
    ##W TBLD 000000 Output from subprocess: 
    
    ##W TBLD 000000 Output from subprocess: bosource17608-0.C:579: error: syntax error before `++' token
    ##W TBLD 000000 Output from subprocess:
    ************************************************** ***********

    Please help,
    Thanks in Advance.

  2. #2
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,651
    Code:
    f ( l_year_start_value = 1)
    That assigns the value 1 to l_year_start_value. Use == for comparison.

    These are wrong, including containing the same problem as above:
    Code:
    l_mv_jan_1 = if((l_startmonth > 1) || (l_numberofyears = 1 && l_endmonth < 1)) { 0 } else l_monthlyvalue;
    You could use the ternary operator like this:
    Code:
    l_mv_jan_1 = (l_startmonth > 1 || (l_numberofyears == 1 && l_endmonth < 1)) ? 0 : l_monthlyvalue;
    Of course much of this screams out for the use of arrays.

    There is too much noise in your error printout, coupled with a lack of line numbers in your code, for it to be helpful.

    What kind of variables are in0 and out0?
    Salem likes this.

  3. #3
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,307
    All keywords in C++ are entirely lowercase, including "for".
    Salem likes this.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  4. #4
    Registered User
    Join Date
    Jul 2011
    Posts
    3
    Quote Originally Posted by rags_to_riches View Post
    Code:
    f ( l_year_start_value = 1)
    That assigns the value 1 to l_year_start_value. Use == for comparison.

    These are wrong, including containing the same problem as above:
    Code:
    l_mv_jan_1 = if((l_startmonth > 1) || (l_numberofyears = 1 && l_endmonth < 1)) { 0 } else l_monthlyvalue;
    You could use the ternary operator like this:
    Code:
    l_mv_jan_1 = (l_startmonth > 1 || (l_numberofyears == 1 && l_endmonth < 1)) ? 0 : l_monthlyvalue;
    Of course much of this screams out for the use of arrays.

    There is too much noise in your error printout, coupled with a lack of line numbers in your code, for it to be helpful.

    What kind of variables are in0 and out0?

    Thanks for the reply there "rags_to_riches ".....the errors have now been nullified after the syntax changes you suggested. Going to the in0 and out0, those represent the input and output records of the tool i use the c++ code within.

    Really appreciate your help and info.
    Have a nice day.

  5. #5
    Registered User
    Join Date
    Jul 2011
    Posts
    3
    I was able to solve most of the errors, but the below 2 keep on persisting. Can some one help:

    Code:
    //----Assign Values to the Local Variables----
    l_startyear = in0.start_year;
    l_startmonth = in0.start_month;
    l_endyear = in0.end_year;
    l_endmonth = in0.end_month;
    l_numberofyears = in0.number_of_years;
    l_numberofmnths = in0.number_of_mnths;
    l_monthlyvalue = in0.monthly_value;
    
    
    l_mv_jan_1 = (l_startmonth > 1 || (l_numberofyears == 1 && l_endmonth < 1)) ? 0 : l_monthlyvalue;
    l_mv_feb_1 = (l_startmonth > 2 || (l_numberofyears == 1 && l_endmonth < 2)) ? 0 : l_monthlyvalue;
    l_mv_mar_1 = (l_startmonth > 3 || (l_numberofyears == 1 && l_endmonth < 3)) ? 0 : l_monthlyvalue;
    l_mv_apr_1 = (l_startmonth > 4 || (l_numberofyears == 1 && l_endmonth < 4)) ? 0 : l_monthlyvalue;
    l_mv_may_1 = (l_startmonth > 5 || (l_numberofyears == 1 && l_endmonth < 5)) ? 0 : l_monthlyvalue;
    l_mv_jun_1 = (l_startmonth > 6 || (l_numberofyears == 1 && l_endmonth < 6)) ? 0 : l_monthlyvalue;
    l_mv_jul_1 = (l_startmonth > 7 || (l_numberofyears == 1 && l_endmonth < 7)) ? 0 : l_monthlyvalue;
    l_mv_aug_1 = (l_startmonth > 8 || (l_numberofyears == 1 && l_endmonth < 8)) ? 0 : l_monthlyvalue;
    l_mv_sep_1 = (l_startmonth > 9 || (l_numberofyears == 1 && l_endmonth < 9)) ? 0 : l_monthlyvalue;
    l_mv_oct_1 = (l_startmonth > 10 || (l_numberofyears == 1 && l_endmonth < 10)) ? 0 : l_monthlyvalue;
    l_mv_nov_1 = (l_startmonth > 11 || (l_numberofyears == 1 && l_endmonth < 11)) ? 0 : l_monthlyvalue;
    l_mv_dec_1 = (l_startmonth > 12 || (l_numberofyears == 1 && l_endmonth < 12)) ? 0 : l_monthlyvalue;
    
    for(l_year_start_value=1;l_year_start_value=<l_numberofyears;l_year_start_value++)
    {
        if ( l_year_start_value == 1)
           {
              out0.JAN  =  l_mv_jan_1;
              out0.FEB  =  l_mv_feb_1;
              out0.MAR  =  l_mv_mar_1;
              out0.APR  =  l_mv_apr_1;
              out0.MAY  =  l_mv_may_1;
              out0.JUNE =  l_mv_jun_1;
              out0.JULY =  l_mv_jul_1;
              out0.AUG  =  l_mv_aug_1;
              out0.SEP  =  l_mv_sep_1;
              out0.OCT  =  l_mv_oct_1;
              out0.NOV  =  l_mv_nov_1;
              out0.DEC  =  l_mv_dec_1;
    
              writeRecord(0);
           }
       else
           {
              out0.JAN  =  (l_numberofyears == l_year_start_value && l_endmonth < 1) ? 0 : l_monthlyvalue; 
              out0.FEB  =  (l_numberofyears == l_year_start_value && l_endmonth < 2) ? 0 : l_monthlyvalue;
              out0.MAR  =  (l_numberofyears == l_year_start_value && l_endmonth < 3) ? 0 : l_monthlyvalue;
              out0.APR  =  (l_numberofyears == l_year_start_value && l_endmonth < 4) ? 0 : l_monthlyvalue;
              out0.MAY  =  (l_numberofyears == l_year_start_value && l_endmonth < 5) ? 0 : l_monthlyvalue;
              out0.JUNE =  (l_numberofyears == l_year_start_value && l_endmonth < 6) ? 0 : l_monthlyvalue;
              out0.JULY =  (l_numberofyears == l_year_start_value && l_endmonth < 7) ? 0 : l_monthlyvalue; 
              out0.AUG  =  (l_numberofyears == l_year_start_value && l_endmonth < 8) ? 0 : l_monthlyvalue;
              out0.SEP  =  (l_numberofyears == l_year_start_value && l_endmonth < 9) ? 0 : l_monthlyvalue;
              out0.OCT  =  (l_numberofyears == l_year_start_value && l_endmonth < 10) ? 0 : l_monthlyvalue;
              out0.NOV  =  (l_numberofyears == l_year_start_value && l_endmonth < 11) ? 0 : l_monthlyvalue;
              out0.DEC  =  (l_numberofyears == l_year_start_value && l_endmonth < 12) ? 0 : l_monthlyvalue;
    
              writeRecord(0);
           }
    }

    error observed:

    Code:
    39: error: invalid 
       conversion from `const void*' to `APT_Int32'
    
    55: error: syntax 
       error before `<' token
    Thanks in Advance.

  6. #6
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Code:
    for(l_year_start_value=1;l_year_start_value=<l_numberofyears;l_year_start_value++)
    Backwards. (Also: you are allowed to use spaces in C code, which would make this infinitely easier to spot.)

    Counting backwards, I guess that means this is line 39?
    Code:
    l_monthlyvalue = in0.monthly_value;
    If so, that means that in0.monthly_value is not a number, despite your wish that it is.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Vector syntax errors
    By SterlingM in forum C++ Programming
    Replies: 1
    Last Post: 10-27-2009, 09:17 PM
  2. why i get 2 syntax errors here .
    By transgalactic2 in forum C Programming
    Replies: 2
    Last Post: 11-30-2008, 02:18 PM
  3. HELP!! Syntax errors
    By theused96 in forum C Programming
    Replies: 2
    Last Post: 09-20-2007, 04:29 PM
  4. syntax errors
    By nesagsar in forum C++ Programming
    Replies: 33
    Last Post: 12-14-2006, 01:03 PM
  5. errors syntax
    By bazzano in forum C Programming
    Replies: 2
    Last Post: 09-30-2005, 02:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21