SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 4 of 4
  1. #1
    Senior Member
    Join Date
    May 2007
    Location
    San Diego, CA
    Posts
    108
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    putting tab characters in FileWriteLine function

    When I try to put a "\t" character in a file write line function, instead of a tab character, Silk Test puts in the literal "\t" Help!

    Heres the code:
    [ ] lwWindow = wWindow.GetChildren()
    [ ] nWinDepth = WinDepth(wWindow)
    [ ]
    [ ] sRootWin = GetField("{wWindow}",".",nWinDepth - 1)
    [ ] // Write record to types.inc
    [ ] sTypeDef = "type "+sRootWin+"Rec"+" is record"
    [ ] FileWriteLine (FileHandle, sTypeDef)
    [-] if LOGLEVEL == INFO // Print record to screen
    [ ] Print(sTypeDef)
    [-] for each wWin in lwWindow
    [ ] sWin = GetField("{wWin}",".",nWinDepth)
    [ ] sFieldDeclaration = "\t"+"STRING "+ "{sWin}"+"\n"
    [ ] PrintfToString("\t"+"STRING "+ "{sWin}"+"\n",sFieldDeclaration)
    [ ] FileWriteLine (FileHandle,sFieldDeclaration)
    [-] if LOGLEVEL == INFO // Print record to screen
    [ ] Printf(sFieldDeclaration)
    [ ] fileClose(FileHandle)


    Here's the result:

    type SquirrelMail1Rec is record
    \tSTRING Folders\n
    \tSTRING LastRefresh\n
    \tSTRING N1\n
    \tSTRING CheckMail\n
    \tSTRING HtmlLink3\n
    \tSTRING INBOX\n
    \tSTRING N4\n
    \tSTRING Drafts\n
    \tSTRING Sent\n
    \tSTRING Trash\n
    \tSTRING N2\n
    \tSTRING Purge\n
    \tSTRING HtmlText("Tue, 10:59 am")\n

  2. #2
    Advanced Member
    Join Date
    May 2005
    Location
    Fremont, CA
    Posts
    832
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: putting tab characters in FileWriteLine functi

    you can use a Chr(9), where 9 is an ASCII representation of TAB
    So, your statement is going to be:
    FileWriteLIne (FileHandle, "{Chr(9)Your string")

    dimaj

  3. #3
    Advanced Member
    Join Date
    Oct 1999
    Location
    Chicago, IL
    Posts
    652
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: putting tab characters in FileWriteLine functi

    Don't forget the closing braces...

    FileWriteLIne (FileHandle, "{Chr(9)}Your string")

    :-)

  4. #4
    Advanced Member
    Join Date
    May 2005
    Location
    Fremont, CA
    Posts
    832
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: putting tab characters in FileWriteLine functi

    Whoops [img]/images/graemlins/wink.gif[/img]
    damn keyboard didn't type a character I told it to type [img]/images/graemlins/smile.gif[/img]

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 03:58 AM.

Copyright BetaSoft Inc.