Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2006
    Location
    Michigan
    Posts
    228

    String Manipulation Help Needed

    Can anyone help me with this ?

    I have been trying to manipulate this string from this format:

    D:\My Drivers Disc\autoplay\drivers\logitech\setup.exe

    to this format:

    autoplay\\drivers\\logitech\\setup.exe

    The folders change for other drivers.

    Example: D:\My Drivers Disc\autoplay\folder\folder\folder\program.exe

    any help with this string manipulation would be appreciated.

    Jerry

  2. #2
    Join Date
    Mar 2006
    Location
    Michigan
    Posts
    228

    I Think I Got it !

    I'm a newbe guys but I think this is the best way to do it. It works anyway.

    -- dialog the user to browse to the driver
    tbl_ProgramFile = Dialog.FileBrowse(true, "Select Program Executable", _DesktopFolder, "", "", "exe", false, true)

    if tbl_ProgramFile[1] ~= "CANCEL" then

    -- Gets total length of string count
    HowLongString = tbl_ProgramFile[1]
    StringSize = String.Length(HowLongString);
    -- Gets the length of \Autoplay count
    TargetIndex = String.Find(tbl_ProgramFile[1], "\\Autoplay", 1, false);
    StartToEnd = StringSize - TargetIndex

    Whatisit = String.Right(tbl_ProgramFile[1], StartToEnd);
    -- Creates a new string from the right-most x characters of an existing string.
    EndResult = String.Replace(Whatisit, "\\", "\\\\", false);

    -- send EndResult to where ever want
    Input.SetText("ProgramFileInput", EndResult);
    end

    -----------------------------------------------
    Any Comments ?

    Jerry

  3. #3
    Join Date
    Jun 2002
    Location
    Israel
    Posts
    1,843
    Why not use _SourceFolder? This built-in variable refers to your project folder?
    (check Global variables in the help file)

    Yossi

Similar Threads

  1. String Manipulation Advice
    By jwarrent in forum AutoPlay Media Studio 6.0
    Replies: 8
    Last Post: 04-19-2006, 04:46 PM
  2. String Manipulation
    By azmanar in forum AutoPlay Media Studio 6.0
    Replies: 3
    Last Post: 01-11-2006, 01:43 PM
  3. attempt to index a string value
    By csd214 in forum AutoPlay Media Studio 5.0
    Replies: 8
    Last Post: 08-08-2004, 01:23 AM
  4. String manipulation
    By dulux1309 in forum AutoPlay Media Studio 5.0
    Replies: 3
    Last Post: 03-31-2004, 06:47 AM

Posting Permissions

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