# List Iterator fails in case a single percent sign is in the list

**URL:** <https://www.finalbuilder.com/forums/t/list-iterator-fails-in-case-a-single-percent-sign-is-in-the-list/3383>\
**Category:** Bugs\
**Created:** [August 12, 2011, 11:32am UTC](https://www.finalbuilder.com/forums/t/list-iterator-fails-in-case-a-single-percent-sign-is-in-the-list/3383 "2011-08-12T11:32:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![finalbuilder](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/f/d07c76/32.png) [@finalbuilder](https://www.finalbuilder.com/forums/u/finalbuilder)\
**Post date:** [August 12, 2011, 11:32am UTC](https://www.finalbuilder.com/forums/t/list-iterator-fails-in-case-a-single-percent-sign-is-in-the-list/3383/1 "2011-08-12T11:32:11Z")

</div>

Hi support team,

Perforce uses to replace a hash sign (#)&nbsp;by %23

Obviously FB&nbsp;expects a variable starting at the percent sign and fails to iterate the following list:

File No.50.txt  
File #50.txt  
File %2350.txt&nbsp; \<--- forces the iterator to fail

&nbsp;

If I&nbsp;double the percent sign the iterator does nothing.

A sample project is attached.

Best regards

Michael

&nbsp;

[001\_20110811\_Percent\_in\_Iterator.fbp7](https://www.finalbuilder.com/forums/uploads/default/original/2X/5/51bb29f627eae5037a51bcd198f6d3ead3da3448.fbp7) (37.824 KB)

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [August 13, 2011, 1:58am UTC](https://www.finalbuilder.com/forums/t/list-iterator-fails-in-case-a-single-percent-sign-is-in-the-list/3383/2 "2011-08-13T01:58:14Z")

</div>

You can disable recursive variable expansion by using ! in front of the variable name, e.g %!list%   
  
 [http://help.finalbuilder.com/variable\_evaluation\_and\_recurs.htm](http://help.finalbuilder.com/variable_evaluation_and_recurs.htm)

---

<div class="post-metadata">

**Author:** ![finalbuilder](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/f/d07c76/32.png) [@finalbuilder](https://www.finalbuilder.com/forums/u/finalbuilder)\
**Post date:** [August 13, 2011, 2:24am UTC](https://www.finalbuilder.com/forums/t/list-iterator-fails-in-case-a-single-percent-sign-is-in-the-list/3383/3 "2011-08-13T02:24:23Z")

</div>

Hi Vincent,

that's quite a fast response :-) Thank you.

But, I am not quite sure how to use your answer. My problem is:

- I&nbsp;have a File with the name "File #1.txt"

- perforce cannot handle this because the # sign indicates the revision number, therefore in case I&nbsp;ask for a list of files I&nbsp;get "File %231.txt"

- if one single in the 'list of lines'&nbsp;of the 'list iterator'&nbsp;contains this file name, the iterator fails

Where I&nbsp;have to apply the exclamation mark you mentioned?&nbsp;I cannot change the filename to&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; File %!231.txt&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; because this file does not exist - Perforce will not find such a file.

Best regards

Michael

---

<div class="post-metadata">

**Author:** ![Vincent](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/vincent/32/938_2.png) [@Vincent](https://www.finalbuilder.com/forums/u/Vincent)\
**Post date:** [August 13, 2011, 7:47am UTC](https://www.finalbuilder.com/forums/t/list-iterator-fails-in-case-a-single-percent-sign-is-in-the-list/3383/4 "2011-08-13T07:47:27Z")

</div>

Hi Michael  
  
The ! symbol addresses the issue you reported, I have modified the example project and it works correctly. You should be able double quote the filename when passing it to perforce. Otherwise I guess I'm not seeing what the problem is. Perhaps if you flesh out your example a bit more so I&nbsp;can see exactly what you are trying to do?

&nbsp;

[Percent\_in\_Iterator.fbp7](https://www.finalbuilder.com/forums/uploads/default/original/2X/6/6a2fa69bb73d6cbc695446bde273929c0eac4599.fbp7) (37.82 KB)

---

<div class="post-metadata">

**Author:** ![finalbuilder](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/f/d07c76/32.png) [@finalbuilder](https://www.finalbuilder.com/forums/u/finalbuilder)\
**Post date:** [August 13, 2011, 11:05am UTC](https://www.finalbuilder.com/forums/t/list-iterator-fails-in-case-a-single-percent-sign-is-in-the-list/3383/5 "2011-08-13T11:05:36Z")

</div>

Hi Vincent,

thank your for the modified sample. Now I see WHERE&nbsp;you applied the exclamation mark... This works fine.

Thanks a lot again.

Michael
