Micro Focus QTP (UFT) Forums
control reaches the end of non void function. - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: control reaches the end of non void function. (/Thread-control-reaches-the-end-of-non-void-function)



control reaches the end of non void function. - vamsi - 08-04-2011

Code:
QString COneNavQueryBuild::buildArchiveQuery(const QString m_szRecordname,const QString m_zsOperation)
{
    ......................
    ......................
    if(m_zsOperation.startsWith("Ident"))
    {
      ..................................  
       return sQuery;
    }
    else if (m_zsOperation.contains("GeoArea"))
    {
        ................................
        ...............................      
        QString m_szWstr  = lst.at(2);
        double WLongitude = -0.0;
        ..................................
        if(m_zsOperation.startsWith("In GeoArea"))
        {
            sprintf(chBuffer,"(Latitude>=%f And  Latitu
      }
        else
        {
            sprintf(chBuffer,"(Latitude<%f And  Latitude>%f) And (Longitude<%f And Longitude>%f )",
                    -(SLatitude),NLatitude,-(WLongitude),ELongitude);
        }
        sQuery.append(QString(chBuffer));
    }
    else
    {
        sQuery.append(m_zsOperation);
        return sQuery;
    }
}

for this implementation i am getting a warning[u] as
[b]control reaches the end of non void function
,
Here i know i need to include approriate return type.. but what is the appropriate return tuype for the "Qstring".pls help me thanks.[/b]