SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 9 of 9
  1. #1
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    capture script name on script.

    User Ricardo Regueira (rregueira@cruisepath.com.nospam) posted:

    Does anybody know how to capture the scripts name?


    I am working on a nice function that prints the screen of the error and
    copies it to a file. Would like to use the name of the script in the file.


    Thanks

    Rick Regueira

    ---

  2. #2
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: capture script name on script.

    User (MMcNaughton@STSSystems.com.nospam) posted:

    Unless someone has the code in front of them and wishes to send it, the
    Rational Users site (SQAEnv in Libraries i believe) and the archives have
    this.

    HTH,
    Max


  3. #3
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: capture script name on script.

    User Ricardo Regueira (rregueira@cruisepath.com.nospam) posted:


    have not found it yet.


  4. #4
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: capture script name on script.

    User (MMcNaughton@STSSystems.com.nospam) posted:

    Searching the archives 101:

    1. Go to http://www.dundee.net/sqa/
    2. Go to Change Your Settings and Searching the Archives
    3. Click on 'To go to the web interface '
    4. If you are a member of "sqa-suite-users" please type: Enter you email and
    password
    5. In the Search Editbot type 'Script + Name'

    Scroll through the dozens of entries for the answer to your question.

    Yes i know i could have sent the answer at the same time, but it's the
    principle.

    HTH,
    Max


  5. #5
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: capture script name on script.

    User Crunk John (ext3jpc) (ext3jpc@ups.com.nospam) posted:

    Max,

    I hope you don't get the same thing I got for this.

    John


  6. #6
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: capture script name on script.

    User Tom Roberts (testmachine2k@yahoo.com.nospam) posted:

    Aaaaaah.....no.
    --- "Crunk John (ext3jpc)" <ext3jpc@ups.com> wrote:
    %%email.unsub%%


    __________________________________________________

  7. #7
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: capture script name on script.

    User (MMcNaughton@STSSystems.com.nospam) posted:

    I'm innocent, the guy obviously didn't check and perhaps doesn't know how,
    i'm being helpful, mentoring him, to learn one must do, unless of course i
    have it sitting right in front of me and the person sounds nice.

    Max


  8. #8
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: capture script name on script.

    User Aidy Rutter (AidyR@TrustMarque.com.nospam) posted:


    '################################################# ##########################
    #####
    '#
    #
    '# Function TrimStringAfterToken(sString as String, sToken as String) As
    String #
    '#
    #
    '# DESCRIPTION:
    #
    '# Trims a full path string to get only the script running name
    #
    '#
    #
    '# COMMENTS:
    #
    '# None
    #
    '#
    #
    '# PARAMETERS:
    #
    '# See Function GetScriptName
    #
    '#
    #
    '#
    #
    '#
    ================================================== ==========================
    #
    '# Author I Modified I Reason
    #
    '#
    ================================================== ==========================
    #
    '# Udi Kalifon I Unknown I Created
    #
    '#
    ================================================== ==========================
    #
    '#
    #
    '#
    #
    '################################################# ##########################
    #####


    Function TrimStringAfterToken(sString as String, sToken as String) As
    String

    Dim iIndex as Integer
    iIndex = Instr (sString, sToken)

    If iIndex = 0 Then
    TrimStringAfterToken = sString
    sString = ""
    Exit Function
    End If

    TrimStringAfterToken = left$(sString, Iindex-1)
    sString = right$(sString, len(sString) - iIndex - len(sToken) + 1)


    End Function


    '################################################# ##########################
    #####
    '#
    #
    '# Function GetScriptName() as String
    #
    '#
    #
    '# DESCRIPTION:
    #
    '# Retrieves the full path and name of script running
    #
    '#
    #
    '# COMMENTS:
    #
    '# None
    #
    '#
    #
    '# PARAMETERS:
    #
    '# None
    #
    '#
    #
    '#
    #
    '#
    ================================================== ==========================
    #
    '# Author I Modified I Reason
    #
    '#
    ================================================== ==========================
    #
    '# Udi Kalifon I Unknown I Created
    #
    '#
    ================================================== ==========================
    #
    '#
    #
    '#
    #
    '################################################# ##########################
    #####

    Function GetScriptName() as String
    ' Provided by Udi Kalifon, NetFormx Ltd.
    ' Overcomes problem of "LastScript" reg entry where a shell script is
    used.
    ' Uses TrimStringByToken function in StringUtil.sbh/sbl

    ' Ask, using SQAVpGetCurrentBaselineFileName, for the path
    ' and file name of a VP called "VPName". This is good because
    ' the name of the VP would be preceeded by the script name

    dim ret as string
    ret = SQAVpGetCurrentBaselineFileName("VPName", "grd")

    ' Call TrimStringByToken to trim the path from the file name
    ' (the path would always be the VP directory in the repository)
    while instr(ret, "\") > 0
    TrimStringAfterToken ret, "\"
    wend

    ' Call TrimStringByToken to trim the extension from the file
    ' name (the extension would always be VPName.base.grd because
    ' we called SQAVpGetCurrentBaselineFileName with these params)
    ret = TrimStringAfterToken (ret, ".")

    ' Now ret holds only the script name. Bingo. Return the value
    GetScriptName = ret

    End Function

    Aidy

  9. #9
    SQA Council
    Join Date
    Mar 2001
    Posts
    14,438
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: capture script name on script.

    User Ricardo Regueira (rregueira@cruisepath.com.nospam) posted:

    thanks

    it worked


 

 

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 13.64%
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 12:31 AM.

Copyright BetaSoft Inc.