User Tag List

Results 1 to 10 of 10

Thread: What does the 'List Objects' 'Find String' parameter <Flag> do?

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    What does the 'List Objects' 'Find String' parameter <Flag> do?

    Hi
    Im trying to use the List Objects 'Find String' expression.
    I found that when using the expression, there are 2 parameters required: <String to find> and <Flag>.
    So i consulted the documentation, which says:

    Find String
    The Find String function searches for a line that begins with a given text. If no line begins with this text, the function returns -1, otherwise it returns the index of the line. The second parameter is the start index: the search will start from the next index. Use -1 to search from the beginning of the list. If the search reaches the end of the list, it continues from the beginning to the start index.


    The documentation says the second parameter should be an index, but when i use the expression it asks for a <Flag>.
    I tried setting the second parameter to '-1', as the documentation states, but the expression editor wont accept it as it ewants to eat a flag.

    What does the second parameter <Flag> of the 'List Objects' 'Find String' Expression do?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It does what the documentation says. <Flag> determines which line in the list the search should start from, -1 will start from the beginning, though So will 0 and 1 depending on if you have the list's 1-based index option disabled (0) or enabled (1).

    So entering -1 should work. What is the error message the expression editor gives you?

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Never really understood completely,
    since:

    If the search reaches the end of the list, it continues from the beginning to the start index

    what's the point in starting from another index, if the search will anyway restart back and up to the selected index?
    Won't you always end up having the same result, as the search is always performed through all indices?

    (though mine accepts "-1", you must enter it as a numerical value, without quotes)

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've thought about that too.

    I guess if you have a list with a large amount of data, the search would be faster if the desired line, provided it does exist, by design must be in e.g. the second half of the list. If it doesn't, well I assume it wouldn't be more taxing than starting the search from the first index.

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    That's a really good point and makes perfect sense.

    Mistery unveiled


    EDIT:
    Mobichan's post >>>>
    that's another good reason I never thought about!

    Thanks guys

  6. #6
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)
    I think the idea is that you can search the whole list without having to manually set the starting index to the first line. Since the last line searched becomes the "current line" you might not want to lose the List's current line before the search. Having a feature that wraps around to the beginning would let the search actually go through every line and end up where you started. This would save you the trouble of storing the line you used to have as the "current line". Or that's my understanding of "why".

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My mistake, the error i got must have ben related to something else.
    It is very possible to set the <Flag> to -1.
    Alittle missleading though, as Flags in Fusion are usually 0 or 1.

    Why does Fusion use the term Flags instead of Boolean anyway?
    Because Flag is more understandable maybe, its either up or down?
    Something thats has stuck from the early Clickteam days i presume?
    I like Flag better.
    I cant relate to the term Boolean in any way, sounds like something slow and clumsy, a green or blue blob maybe.

  8. #8
    Clicker Fusion 2.5Android Export ModuleSWF Export Module
    EE's Avatar
    Join Date
    Sep 2009
    Posts
    200
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    I've always thought of it as a donut - a boolean, don't ask me why. ^^
    Flag is the correct term for selecting an index since you flag it in memory I guess.

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    You know, Boolean comes from George Boole, english logician
    he came to the highly successful mathematical ideas behind our computer's logic,
    0/1, commutations, that's what all (non-fuzzy) logic does, in the very end.

    "Flag" makes me think of those options that can be ticked or unticked,
    those "V"s you put in (electronic or paper) forms to choose options,
    that's possibly where the term comes from?

    Anyway, in this situation, I think the term is misused,
    since I think you can use any index number and not just 0-1 for this parameter?

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    Chrille's Avatar
    Join Date
    Jul 2006
    Posts
    389
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    On the topic of flags; since they are just boolean values, I wish it was possible to write/read from them using the expression editor. Not only would it be easier to set things up if you were writing/reading data to an object with a save game-system, but also opening the value in the expression editor and changing it from "0" to "1" would be much faster than having to browse through the actions list and choosing "Turn Flag 1 On/Off" for example.

Similar Threads

  1. Item list - find a line by string and delete it
    By blurymind in forum Fusion 2.5
    Replies: 8
    Last Post: 12th January 2015, 12:42 AM
  2. What exactly is the list's "Find String"?
    By BartekB in forum Fusion 2.5
    Replies: 8
    Last Post: 17th October 2014, 12:54 PM
  3. Find String Exact List help
    By Sumo in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 30th May 2013, 09:51 PM
  4. list object's "find string exact" help
    By Sumo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th November 2012, 08:09 AM
  5. Converting a Parameter to a String
    By Jaffob in forum Extension Development
    Replies: 2
    Last Post: 26th October 2008, 02:55 PM

Posting Permissions

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