Page 2 of 2 FirstFirst 12
Results 11 to 15 of 15

Thread: Custom List manager

  1. #11
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,839
    Quote Originally Posted by Sonicxtacy02 View Post
    did you modify your command so that everything shifts to compensate for the new line? you have to factor out line 1 when building your array
    It's not important because the function 'GiveLineNumberForString' return the real line !

  2. #12
    Mo' Programming Mo' Problems
    Auto Apps:loading...
    Sonicxtacy02's Avatar
    Join Date
    Sep 2004
    Location
    Woodbridge, VA
    Posts
    8,161
    Blog Entries
    51
    I'm honestly out of suggestions here. I'm just lookin at the code snippets you've offered and trying to help. Only other thing i'd say try is remove the ;TRUE parameter from your CLLOAD.
    Last edited by Sonicxtacy02; 05-23-2013 at 12:55 PM.
    mp3Car.com Senior Tech Blogger (Want a product reviewed? Contact me.)
    Find my plugins on the MP3Car App Store!
    Follow Me on Twitter or Facebook
    Live mp3Car Facebook Chat

  3. #13
    Raw Wave pierrotm777's Avatar
    Join Date
    May 2008
    Location
    Bordeaux, France
    Posts
    2,839
    I have found my issues!
    Firstly, GiveLineNumberForString doesn't return the good line , i think that is because the list is a UNICODE file ?
    Secondly, when i put my list into an array, i forgot than the first value is 0 not 1 !
    So my code can to be:
    Code:
    Public Sub ModifyCustomList(ByVal CustomList As String, ByVal StringToMofify As String, ByVal CLText As String, CLDescription As String, CLImg As String)
        Dim strPath() As String
        Dim lngIndex As Long
        strPath() = Split(CLImg, "\")
        lngIndex = UBound(strPath)
        CLImg = "$SKINPATH$include\Contacts\userpics\" & strPath(lngIndex)
        
        Const ForReading = 1: Const ForWriting = 2
        Dim objFSO, objFile, allLines, arrLines, x, strLine, strNewContents
        'GiveLineNumberForString CustomList, StringToMofify
        ReturnedLineNumberForString = (Val(RRSDK.GetUserVar("PBCLPOS")) * 2) - 1
        'RRSDK.SetUserVar "StringToMofify", StringToMofify & " --> " & ReturnedLineNumberForString
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFile = objFSO.OpenTextFile(CustomList, ForReading, True, -1)
        allLines = objFile.ReadAll
        'MsgBox allLines.Line 'number of lines
        arrLines = Split(allLines, vbCrLf)
        arrLines(ReturnedLineNumberForString - 1) = "LST" & CLText & "||" & CLDescription
        arrLines(ReturnedLineNumberForString) = "ICO" & CLImg
        objFile.Close
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFile = objFSO.OpenTextFile(CustomList, ForWriting, True, -1)
        'RRSDK.SetUserVar "LN", UBound(arrLines)
        'For x = 0 To UBound(arrLines)
            'objFile.Write (arrLines(x) & vbCrLf)
        'Next
        Dim MyLine
        For Each MyLine In arrLines
            objFile.Write (MyLine & vbCrLf)
        Next
        
        objFile.Close
        
    End Sub
    I replace my command 'GiveLineNumberForString CustomList, StringToMofify' by the line:
    Code:
    ReturnedLineNumberForString = (Val(RRSDK.GetUserVar("PBCLPOS")) * 2) - 1
    where RRSDK.GetUserVar("PBCLPOS") is the CLPOS value.

  4. #14
    The Curator
    Auto Apps:loading...
    Blue ZX3's Avatar
    Join Date
    Aug 2004
    Location
    Chicago area,IL
    Posts
    5,079
    For future ref, that first line in the file tells RR what line you want selected when the file/list is loaded, with the default being the first item or item 0. You can see this if you select an item farther down in the list and then do a CLSAVE cmd and then look at the first line. Item that was selected when that list was saved will be that first line +1
    RideRunner...The #1 FE, PERIOD.

    Current Project: DFXVoice [v1.0 Released]
    Next in line: RRMedia v2.0

    DFX 5.1.1 Skin
    Appstore Link

    My RideRunner Plugins
    RRMedia
    RRExtended
    DFXVoice

    "There are no bugs - only undocumented features."

  5. #15
    Variable Bitrate
    Join Date
    Sep 2012
    Location
    Germany - Munich
    Posts
    359
    the problem of clsave is, that clsave deletes the line with the icon-path.
    so, we needed a plugin, which do this job.
    and it works :-)

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Need little help with custom list with C#
    By pierrotm777 in forum Road Runner
    Replies: 7
    Last Post: 06-28-2012, 10:04 AM
  2. Custom List with Variables
    By MGD in forum Road Runner
    Replies: 8
    Last Post: 03-17-2012, 02:40 PM
  3. Custom List question??
    By eribs4e in forum RR Skins
    Replies: 2
    Last Post: 08-11-2009, 09:12 AM
  4. Custom List creation
    By lambosprit in forum Road Runner
    Replies: 11
    Last Post: 05-12-2009, 07:46 PM
  5. Custom List (SC)
    By EL CAMINO in forum Road Runner
    Replies: 2
    Last Post: 10-29-2007, 12:41 AM

Bookmarks

Posting Permissions

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