WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Winbatch Studio
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Problem wRight wLeft and wGetChar


Question:

Placed the following in WSP-USER.MNU
testing l-r
    wHome()
    while @TRUE
       C = wGetChar()
       if C == @TAB then C = "@TAB"
       if !AskYesNo(StrCat("Character Read was: ",C),"Do you want to continue?") then break
       wRight()
    endwhile
testing r-l
    wEnd()
    display(2,"You will have to run off a few EOL chars below:","")
    while @TRUE
       C = wGetChar()
       if C == @TAB then C = "@TAB"
       if !AskYesNo(StrCat("Character Read was: ",C),"Do you want to continue?") then break
       wLeft()
    endwhile
Create a "WBT" file that has the following contents, but NOTE, where I have * you should type Tab! so the first line is ", then a, then @TAB, etc.
"a*s*df"
"a*stu*dfghi"
abcdef
Now if you bring up the WBT file in Studio and click on various lines, then choose "testing l-r" or "testing r-l" on the context menu. You will see that many characters are skipped in the line scans.

Am I missing something? I am running 2005B.

Answer:

I tried it for a while and did not see any problems. Then I went to View options and changed "Insert Spaces" to "Keep Tabs". Then when I tried it again I saw what the issues were. When crossing a tab character, if the tab had inserted various virtual whitespace characters for alignment, one real character is skipped for each virtual whitespace character added.

Will forward this a a bug report. In the meantime if you goto View-Options, select the desired filettypes (WIL Files?) and select "Insert Spaces" instead of "Keep Tabs", the future problems should diminish.

I think that this bug report might deserve a special mention. I suspect this bug has been in the code for over 10 years.


Article ID:   W17305
File Created: 2007:07:03:14:29:26
Last Updated: 2007:07:03:14:29:26