Re: rtrim not working.................. -_-



x=instr(m,vbcr)
if x>0 then m=left$(m,x-1)

the above 2 lines should work for me.......

thank you a lot! -_-

daimler_smiles -_-

"Bob Butler" <tiredofit@xxxxxxxxxxx> wrote in message
news:uF8mLt8FHHA.2128@xxxxxxxxxxxxxxxxxxxxxxx
"Daimler" <daimler_6@xxxxxxxxxxxx> wrote in message
news:el1fhn$rb1$1@xxxxxxxxxxxxxxxxxxxxxxx
sorry, i just checked the asc value and found out after right-
trimming, the value is asc 13 which is vbcr.

is there a best way to right-trim a character such as vbcr, ie. asc
13?

if you mean that you want to trim after the first vbCR then
x=instr(m,vbcr)
if x>0 then m=left$(m,x-1)

if you mean after the last vbCR then use InstrRev instead but...

m = Space(100000)
Get #filenum2, 1, m
Close filenum2
mm = RTrim(m)

might be better as
m=space$(lof(filenum2))
Get #filenum2,,m
close #filenum2

That way you only read what is there and may not have to trim anything.

If you do keep it the way you have it for some reason then you could also
consider using
m=string$(100000,vbNullChar)
so that you can search the string for the first Null character afterwards
rather than dealing with spaces which may be embedded in (what I am
assuming
is) the text being read.

--
Reply to the group so all can participate
VB.Net: "Fool me once..."



.



Relevant Pages

  • Re: rtrim not working.................. -_-
    ... the value is asc 13 which is vbcr. ... Close filenum2 ... so that you can search the string for the first Null character afterwards ...
    (microsoft.public.vb.database)
  • Re: editing docvariable fields
    ... Very strange indeed, especially as vbcr *is* chr. ... the ASC() function. ... As for the empty string, I checked it -- perhaps it's ...
    (microsoft.public.word.vba.userforms)
  • Re: rtrim not working.................. -_-
    ... sorry, i just checked the asc value and found out after right-trimming, ... the value is asc 13 which is vbcr. ... Close filenum2 ...
    (microsoft.public.vb.database)

Loading