[R-gregmisc-users] SF.net SVN: r-gregmisc:[1827] trunk/SASxport/R
Brought to you by:
warnes
From: <wa...@us...> - 2014-07-17 02:15:47
|
Revision: 1827 http://sourceforge.net/p/r-gregmisc/code/1827 Author: warnes Date: 2014-07-17 02:15:45 +0000 (Thu, 17 Jul 2014) Log Message: ----------- Minor code reformatting. Modified Paths: -------------- trunk/SASxport/R/parseFormat.R trunk/SASxport/R/write.xport.R Modified: trunk/SASxport/R/parseFormat.R =================================================================== --- trunk/SASxport/R/parseFormat.R 2014-07-17 02:14:21 UTC (rev 1826) +++ trunk/SASxport/R/parseFormat.R 2014-07-17 02:15:45 UTC (rev 1827) @@ -3,7 +3,7 @@ { retval <- list("name"="", "len"=0, "digits"=0) - + if( !is.null(format) && (length(format)==1) && (format > "") ) { index <- regexpr("[0-9]+", format) @@ -16,9 +16,9 @@ else { retval$name <- substr(format,0,index-1)[1] - - lenStr <- substr(format,index, nchar(format)) - + + lenStr <- substr(format, index, nchar(format)) + index <- regexpr("\\.", lenStr) if(index==-1) { @@ -31,10 +31,10 @@ retval$digits <- as.numeric(substr(lenStr, index+1, nchar(lenStr))) } } - + if(is.na(retval$len)) retval$len <- 0 if(is.na(retval$digits)) retval$digits <- 0 - + } return(retval) Modified: trunk/SASxport/R/write.xport.R =================================================================== --- trunk/SASxport/R/write.xport.R 2014-07-17 02:14:21 UTC (rev 1826) +++ trunk/SASxport/R/write.xport.R 2014-07-17 02:15:45 UTC (rev 1827) @@ -196,15 +196,10 @@ offsetTable[i, "len"] <- varLen offsetTable[i, "offset"] <- lenIndex - - - # parse format and iformat formatInfo <- parseFormat(varFormat) iFormatInfo <- parseFormat(varIFormat) - - # write the entry out( xport.namestr( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |