Posted 17 October 2014 - 08:47 PM
Hello! I am trying to use a sort of config string, but the code refuses to work. After about 30 minutes of debugging, I'm honestly stumped. The code should return true, but for some reason, it returns false.
[list]
[*] [color=#000000]
[color=#AA9900][b]function[/b][/color] getValue[color=#66CC66]([/color]node[color=#66CC66])[/color][/color]
[*] [color=#000000]
[color=#AA9900][b]if[/b][/color] [color=#AA9900][b]not[/b][/color] [color=#0000AA]string.find[/color][color=#66CC66]([/color]permString[color=#66CC66],[/color] [color=#66CC66]([/color][color=#FF6666]"+"[/color][color=#66CC66]..[/color]node[color=#66CC66]..[/color][color=#FF6666]"("[/color][color=#66CC66])[/color][color=#66CC66],[/color][color=#CC66CC]1[/color][color=#66CC66],[/color][color=#AA9900]true[/color][color=#66CC66])[/color] [color=#66CC66]==[/color] [color=#AA9900]nil[/color] [color=#AA9900][b]then[/b][/color][/color]
[*] [color=#000000]
[color=#AA9900][b]return[/b][/color] [color=#AA9900]true[/color][/color]
[*] [color=#000000]
[color=#AA9900][b]else[/b][/color][/color]
[*] [color=#000000]
[color=#AA9900][b]return[/b][/color] [color=#AA9900]false[/color][/color]
[*] [color=#000000]
[color=#AA9900][b]end[/b][/color][/color]
[*] [color=#000000]
[color=#0000AA]print[/color][color=#66CC66]([/color][color=#0000AA]string.find[/color][color=#66CC66]([/color]permString[color=#66CC66],[/color] [color=#66CC66]([/color][color=#FF6666]"+"[/color][color=#66CC66]..[/color]node[color=#66CC66]..[/color][color=#FF6666]"("[/color][color=#66CC66])[/color][color=#66CC66],[/color][color=#CC66CC]1[/color][color=#66CC66],[/color][color=#AA9900]true[/color][color=#66CC66])[/color][color=#66CC66])[/color][/color]
[*] [color=#000000]
[color=#AA9900][b]end