User Tag List

Results 1 to 3 of 3

Thread: Simple string question

  1. #1
    No Products Registered

    Join Date
    Jul 2008
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Simple string question

    Is there a way to only read the filename the extension is being used with and not the entire path?

    for example, a string says "C:\windows\hello.jpg"

    I want an edit box to be able to only show the "hello.jpg" part. Basically, only show the filename attatched to the .jpg extension and nothing else so it'll read:
    ["hello.jpg"]
    or
    ["user_file.dll"]

    Using Right$(string$( "example" ), 9) will work, but if the user changes directory,it'll pick up other lines if it's shorter than 9. (If it's "hi.jpg", it'll show everything else until it reaches 9 characters. Maybe if there's a way to set the character limit to the character length of the extension used, that'd be nice. I should probably know this, but I haven't dealt with strings often)

    Thanks in advance.

  2. #2
    Clicker Fusion 2.5
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    JimJam's Avatar
    Join Date
    Jun 2006
    Location
    USA
    Posts
    353
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Simple string question

    I'm pretty sure the File Object allows you to get the File Name and Directory as separate strings. That is, you could retreieve:

    "C:\windows\" for directory, and
    "hello.jpg" as a file name.

    Save these into two separate stirngs, then if you need to combine them, use String1 + String2 to get:
    "C:\windows\hello.jpg"

    Yeah, I'm pretty sure the File Object can do all that.

  3. #3
    No Products Registered

    Join Date
    Jul 2008
    Posts
    131
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Simple string question

    Ah, thanks. Forgot about using the File Object. If anyone else is curious, it's:

    FileName$( "File Object", FileSelReturn$( "File Object" ))+ExtensionName$( "File Object", FileSelReturn$( "File Object" ))

Similar Threads

  1. [Howto] Make String replace in a simple text?
    By BackStaged in forum Multimedia Fusion 2 - Technical Support
    Replies: 8
    Last Post: 5th September 2010, 04:41 AM
  2. Hello Please help with this simple question
    By sephetious in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 12th September 2008, 07:23 PM
  3. Simple question
    By Dynamite in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 30th August 2008, 07:39 AM
  4. A simple question
    By Bornemix in forum Extension Development
    Replies: 1
    Last Post: 22nd July 2008, 10:34 AM
  5. Simple Question
    By Peter in forum File Archive
    Replies: 4
    Last Post: 4th August 2007, 04:51 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
  •