User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 14 of 14

Thread: How to split the string 12345?

  1. #11


    Join Date
    May 2010
    Posts
    115
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there a way to retrieve a value from a value?

    In the post with number :
    #194439

    You mentioned how the string seperator selected the number wrong. You said:

    Mid$("12345", 1, 1)
    It retrieved 5

    (I believe Mid goes form the middle, in this case it was one number after it, and then 1 number after that number.
    Which the middle would be 3, and one after it would be 4, and then it goes to 5. I think if there is 2 numbers it chooses the last.



    But when I try to get the next column, following what you wrote, I tried this:

    Mid$("12345", 2, 1)
    It retrieved 0

    (It started at 5 , which is 2 numbers from 3, which is middle, and went one more number and chose the last one to output. There wasnt a number after 5, so instead of crashing because of "null", it gives 0.
    --------------------------

    Well i think Mid$ is grabbing numbers form the middle and rounding the end number selected if the number of items is uneven. There might be a different way to select and splice elements from a string other than this function. It uses similar syntax as described and may be similar to visual basic way of selecting numbers. Remember the first element in anything is always 0, so 0,1 would start at zero and select 1 elements past it.

  2. #12
    Clicker Multimedia Fusion 2 Developer

    Join Date
    Jun 2006
    Location
    Darlington, UK
    Posts
    3,298
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there a way to retrieve a value from a value?

    Wha?

    EDIT:
    To be clear: Mid$'s parameters are the start position, counting from the left (first character is 0), and a count. As per the MMF2 docs, Mid$("Hello",1,3) gives "ell" (skip one character from the left, then get 3).

  3. #13
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there a way to retrieve a value from a value?

    Mid$ returns a string, hence the $ in the expression Mid$. If there were nothing to retun it DOES NOT return "0", it returns "". If it returns "0" and you have no zero in your string then you need to check everything, ebcause "12345" doesn't have a single "0" anywhere.
    Working as fast as I can on Fusion 3

  4. #14
    Clicker Multimedia Fusion 2 DeveloperiOS Export Module
    Nifflas's Avatar
    Join Date
    Jul 2006
    Posts
    2,613
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Is there a way to retrieve a value from a value?

    GameDevs: Don't make any conclusion out of what numbers that Mid$ was supposed to return in that previous post. Mid$("12345", 1, 1) was said to return 5, and Mid$("12345", 2, 1) was said to return 0.

    ...both statements are incorrect. Mid$("12345", 1, 1) returns 2 and Mid$("12345", 2, 1) returns 3.

    Then, I of course recommend the expression in my previous post. Don't convert things to strings if the operation can be carried out with numbers.

Page 2 of 2 FirstFirst 1 2

Similar Threads

  1. Split screen 3d TV
    By MdNelson in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd October 2013, 02:41 AM
  2. String Split
    By dragonguy in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 21st September 2008, 02:11 PM
  3. split screen(sub app)
    By looner in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th March 2007, 10:29 PM
  4. Split-screen example
    By Sphax in forum File Archive
    Replies: 3
    Last Post: 20th March 2007, 05:45 PM
  5. Split keyboard
    By Clickboy in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 13th January 2007, 02:52 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
  •