String.sub not working on ios 8.1

this has been working on previous iOS versions, it quit when phone and iPad updated…

 local theHeadings=string.sub(createDBLine, 34, string.len(createDBLine)-1)

I want to get createDBLine text from chr 34 - length-1

as I said it worked before and still works in Simulator.

is this a bug or not the best way to do this ?

Hi @sierramanagement,

What does “createDBLine” look like, and where do you set/get it from?

Thanks,

Brent

Brent,

Thanks for your reply, 

createDBLine is created 2 lines above…

this is the code concerned.

local path = system.pathForFile(“sierra.sqlite”, system.DocumentsDirectory)

            db = sqlite3.open( path ) 

            – get existing table info

            if(db:isopen()) then

                     

                for row in db:nrows(“PRAGMA table_info(Quotes)”) do

                createDBLine = createDBLine…row.name…","

                

                end

                

                db:close()

            end

                

        local theHeadings=string.sub(createDBLine, 34, string.len(createDBLine)-1)

        

        

this is literally the text returned :

CREATE TABLE IF NOT EXISTS Quotes(“Unique_ID”,“CreateDate”,“Company”,“GroupName”,“PUCity”,“DPCity”,“PUDate”,“DPDate”,“Total_Days”,“Day_Rate”,“Driver_Days”)Unique_ID,CreateDate,Company,GroupName,PUCity,DPCity,PUDate,DPDate,Total_Days,Day_Rate,Driver_Days)

This has been working for 6 month to 9 month… it stopped when I updated to is is ios8  … it still works in 

the simulator (Yosemite)   I have not been able to check android yet but is was working there also.

thanks in advance,

Roger

Hi @sierramanagement,

What does “createDBLine” look like, and where do you set/get it from?

Thanks,

Brent

Brent,

Thanks for your reply, 

createDBLine is created 2 lines above…

this is the code concerned.

local path = system.pathForFile(“sierra.sqlite”, system.DocumentsDirectory)

            db = sqlite3.open( path ) 

            – get existing table info

            if(db:isopen()) then

                     

                for row in db:nrows(“PRAGMA table_info(Quotes)”) do

                createDBLine = createDBLine…row.name…","

                

                end

                

                db:close()

            end

                

        local theHeadings=string.sub(createDBLine, 34, string.len(createDBLine)-1)

        

        

this is literally the text returned :

CREATE TABLE IF NOT EXISTS Quotes(“Unique_ID”,“CreateDate”,“Company”,“GroupName”,“PUCity”,“DPCity”,“PUDate”,“DPDate”,“Total_Days”,“Day_Rate”,“Driver_Days”)Unique_ID,CreateDate,Company,GroupName,PUCity,DPCity,PUDate,DPDate,Total_Days,Day_Rate,Driver_Days)

This has been working for 6 month to 9 month… it stopped when I updated to is is ios8  … it still works in 

the simulator (Yosemite)   I have not been able to check android yet but is was working there also.

thanks in advance,

Roger