0 Members and 1 Guest are viewing this topic.
item.endlocation(1,"btm")
if (Value1>= .0625 and Value1 < .1875) then fraction = "1/8"endif
dim sBtm = item.endlocation(1,"Btm")dim pt = instr(1,sBtm,".")dim getfrac = right(sBtm,(len-pt))dim getinch = left(sBtm,pt-1)dim frac = other code heredim BtmElev = getinch + " " + frac + quotereturn BtmElev
right(sBtm,(len-pt))
Dave,the code is erroring out on right(sBtm,(len-pt))Unknown variable "len"
You can find the decimal part this way. Dim the original prefix getinch, then re-add it to the string.dim sBtm = item.endlocation(1,"Btm")insert new dim from belowdim pt = instr(1,sBtm,".")dim getfrac = right(sBtm,(len-pt))dim getinch = left(sBtm,pt-1)dim frac = other code heredim BtmElev = getinch + " " + frac + quotereturn BtmElev
if (getfrac>= .1875 and getfrac < .3125) thendim frac = "1/8"endif
dim sBtm = item.endlocation(1,"Btm")dim len = len(sBtm)dim pt = instr(1,sBtm,".")dim getfrac = right(sBtm,(len-pt))dim getinch = left(sBtm,pt-1)dim frac[b]if (getfrac>= .1875 and getfrac < .3125) thenfrac = "1/8"endif[/b]dim BtmElev = getinch + " " + frac + quotereturn BtmElev
dim fracif......then 1/8if.....then 1/4endifendif