Results 1 to 3 of 3

Thread: current position on the current line

  1. #1

    Thread Starter
    Addicted Member big_k105's Avatar
    Join Date
    May 2003
    Location
    North Dakota
    Posts
    195

    current position on the current line

    ok my question is that i have a textbox on a worksheet in excel and i want to be able to find out what the current position on the current line that im on. here is what im trying to do. ok i am first off converting a file from a emacs file to beable to be read and looked at in windows. and the tab stops to look right in windows. in emacs it make the tabs 8 spaces long and for some reason they are only like 5-6 or so in the textbox. and i want to beable to take a chr(9) which is tab and replace it with space(8) but here is where the problem is.

    when you are in the first space on a line it and hit tab in emacs it moves over 8. then of you are on the 2nd it moves over 7 and goes to the same spot as the last tab this happens all the way over to space 8 where it starts over. and i need to be able to detect want spot the chr(9) was found on so i know how many spaces to go over. well hopefully someone can help. i currently dont have any code writen really. all i have is the code the replaces all chr(9) with space(8) if you want i can post that so you can look at how i do stuff.

    well thanks for your help and hope you read this soon thanks
    Last edited by big_k105; Oct 28th, 2003 at 04:22 PM.

  2. #2

    Thread Starter
    Addicted Member big_k105's Avatar
    Join Date
    May 2003
    Location
    North Dakota
    Posts
    195
    VB Code:
    1. '***********************************************'
    2. ' code that replaces the chr(9)'s with space(8) '
    3. '***********************************************'
    4.         Dim curpos1 As Integer
    5.         thispos1 = 0
    6.         thispos1 = 0
    7.         startpos1 = 1
    8.         startpos2 = 1
    9.         'chr(9) replacing with 8 spaces
    10.         Do While True
    11.             thispos1 = InStr(startpos1, strFileRecord, Chr(9))
    12.             If thispos1 = 0 Then Exit Do
    13.             strFileRecord = Left(strFileRecord, thispos1 - 1) & space(8) & Mid(strFileRecord, thispos1 + 8)
    14.             startpos1 = thispos1 + 1
    15.         Loop
    16. '***********************************************'
    17. ' code that replaces the chr(9)'s with space(8) '
    18. '***********************************************'

  3. #3

    Thread Starter
    Addicted Member big_k105's Avatar
    Join Date
    May 2003
    Location
    North Dakota
    Posts
    195
    *bump*

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width