mid$(a$,1,len(a$)-1)は right$(a$,len(a$)-1)と書けるが長さは変わらなかったよとほほ if len(a$)>0 then は if len(a$) then でいいです。 if x then は if x<>0 then の意味だけど、len()<0はありえないから、この場合に限ってはok