WelshyWizard
IS-IT--Management
Hi all,
I've the following code:
This code basically splits a string when it finds an underscore '_'.
I want the code skip if it doesn't find an underscore. At the moment it just crashes... Any ideas?
Cheers
Today is the tomorrow you worried about yesterday - and all is well.....
I've the following code:
Code:
tcSplit.open("Temp Import.db")
tcSplit.edit()
scan tcSplit:
strSptGdr = tcSplit."USER1" ;// Look in this field for Gdr No's
strSptGdr.breakApart(arSplit, "_") ;// The underscore will split the Gdr No's
;ar.view()
if tcSplit."USER2" = "SPBF" OR tcSplit."USER2" = "SPWEB" OR tcSplit."USER2" = "SPTF"
OR tcSplit."USER2" = "BR" OR tcSplit."USER2" = "BP" then
tcSplit."Gdr1" = arSplit[1] ;// Place the first Gdr number in field Gdr1 (before the underscore)
tcSplit."Gdr2" = arSplit[2] ;// Place the second Gdr number in field Gdr2 (after the underscore)
tcSplit.unlockRecord()
endif
endscan
tcSplit.endedit()
tcSplit.close()
This code basically splits a string when it finds an underscore '_'.
I want the code skip if it doesn't find an underscore. At the moment it just crashes... Any ideas?
Cheers
Today is the tomorrow you worried about yesterday - and all is well.....