delete the first charachter is left, 1=" "

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

delete the first charachter is left, 1=" "

Post by sal21 »

I check with this routine if the first cahracter in strbuf is " ".
Is possible to reassign to the same var strbuf the line without the first blank caharcter?

Example:

If Left$(strBuf, 1) = " " Then
'ok have a blank
Debug.Print strBuf
strBuf=new line strBuf without " "
End If

origina line:
aaaaaaaaaa

after trasformation:
aaaaaaaaa

I think Hans understand me :grin: :scratch:

User avatar
HansV
Administrator
Posts: 78510
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: delete the first charachter is left, 1=" "

Post by HansV »

strBuf = Mid(strBuf, 2)
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Re: delete the first charachter is left, 1=" "

Post by sal21 »

HansV wrote:strBuf = Mid(strBuf, 2)
Simple and effective!
:thankyou:

remember my old post about to skip Host caharcter in txt file....

i loop line by line a txt and i need to skip the line in txt attached how to?

If i dont remeber wrong is a little square, or not?
You do not have the required permissions to view the files attached to this post.

User avatar
HansV
Administrator
Posts: 78510
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: delete the first charachter is left, 1=" "

Post by HansV »

There are several characters with ASCII code 12 (form feed) in the file, perhaps you can test for Chr(12).
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Re: delete the first charachter is left, 1=" "

Post by sal21 »

HansV wrote:There are several characters with ASCII code 12 (form feed) in the file, perhaps you can test for Chr(12).
oK resolved all about Chr(12), tks.

Now new "Miracle"

During the loop in txt file when go in this line:

RIFERIMENTO: PAG. NOTE:

the code exit for loop???????????????????????

In debug.print mode i dont see the little arrow, peraphs is a specila Host character?

See wat i have in debug print:
RIFERIMENTO: P

Inother case i dont see the other part after the litle arow, is a Miracle?

User avatar
HansV
Administrator
Posts: 78510
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: delete the first charachter is left, 1=" "

Post by HansV »

There could be an end-of-file character (ASCII 26) in the file; this would cause the code to stop reading the file there.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Re: delete the first charachter is left, 1=" "

Post by sal21 »

HansV wrote:There could be an end-of-file character (ASCII 26) in the file; this would cause the code to stop reading the file there.
and how to trap this error?

User avatar
HansV
Administrator
Posts: 78510
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: delete the first charachter is left, 1=" "

Post by HansV »

You can't, if you open the file as a text file. You can only work around the end-of-file character if you open the file as binary, but that is very complicated.
Where does this file come from?
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Re: delete the first charachter is left, 1=" "

Post by sal21 »

HansV wrote:You can't, if you open the file as a text file. You can only work around the end-of-file character if you open the file as binary, but that is very complicated.
Where does this file come from?
Host!

User avatar
HansV
Administrator
Posts: 78510
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: delete the first charachter is left, 1=" "

Post by HansV »

That is outside my field, I'm afraid I can't help you with that. Sorry.
Best wishes,
Hans

User avatar
sal21
PlatinumLounger
Posts: 4357
Joined: 26 Apr 2010, 17:36

Re: delete the first charachter is left, 1=" "

Post by sal21 »

HansV wrote:That is outside my field, I'm afraid I can't help you with that. Sorry.
No prob, tks in other case.
I caal my Admin and suggest to skip all Host command Chr when the file is created, i think is possible with a Cics.