SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Junior Member
    Join Date
    Apr 2004
    Location
    Bangalore
    Posts
    29
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    GetField Function

    Hello Everybody,
    I have a Base string with a multiple character seperator. I want to retrieve the different strings found inside the base string.
    I tried using GetField. It works fine when the seperator is "+" character. As soon as I change the seperator to "xyz" the string returned becomes blank. Can some body please help.

    Thanks.
    Brain

  2. #2
    Senior Member
    Join Date
    Apr 2003
    Posts
    388
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: GetField Function

    This may help you:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">'===================================== ===========
    Function iParseDeliminatedStringToArray(sChar as string, sString as string, aArray() as string) as integer
    Dim iErrMsg as Integer
    Dim sErrString as String
    Dim sErrMsg as String
    Dim iStart as integer
    Dim iEnd as integer
    Dim sField as string

    On Error GoTo ErrorHandler
    sErrString = &quot;iParseDeliminatedStringToArray Failed. &quot;
    Redim aArray(0) as string
    iErrMsg = MSGFailure
    if trim$(sString) = &quot;&quot; then
    sErrMsg = &quot;Empty String, nothing to parse.&quot;
    iErrMsg = MSGFailure
    goto ErrorHandler
    end if

    iStart = 1
    iEnd = instr(iStart, sString , sChar , 1 )
    while iEnd &lt;&gt; 0
    sField = mid(sString , iStart , iEnd - iStart )
    iErrMsg = PushArray(aArray(), sField )
    iStart = iEnd + len(sChar)
    iEnd = instr(iStart , sString , sChar , 1 )
    wend
    sField = mid(sString , iStart )
    if sField &lt;&gt; &quot;&quot; then
    sField = trim$(sField)
    iErrMsg = PushArray(aArray(), sField )
    end if

    iParseDeliminatedStringToArray = iErrMsg
    Exit Function
    ErrorHandler:
    SQALogMessage sqaFail, &quot;ErrorMsg:&quot; + sErrMsg
    iParseDeliminatedStringToArray = iErrMsg
    End Function
    '================================================</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">

  3. #3
    Senior Member
    Join Date
    Mar 2003
    Location
    Austin, TX, USA
    Posts
    1,489
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: GetField Function

    .. not sure if this is your problem, but if you specify 'xyz' as your separator character, then the result of parsing "axyzb" will be a, null, null, b. It doesn't use "xyz" as a separator, it interprets this as "x" or "y" or "z" can be separators.

 

 

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 05:48 AM.

Copyright BetaSoft Inc.