gretty
19th July 2012 07:00 UTC
Using Splice Causes Installer To Crash
I am using the function Splice in my NSIS Installer.
My Problem: When I execute the below code the Splice function causes the installer to go into an infinite loop or crash it(it doesn't respond). Whats going wrong?
Am I using Splice wrong? If I cant use splice to split my string the way I want it to, is there another function I could use to split a string?
Section "Dummy"
Push "user_lib_4d C:\12d\9.00\DTEI_Customisation\SURVEY_12d9\DTEI_Survey_User_Lib" # "user_lib_4d C:/blah"
Push "0"
Push "user_lib_4d"
Call Splice # causes an infinite loop/crash
SectionEnd
Afrow UK
19th July 2012 10:57 UTC
Why are you Pushing the first segment? It wants the delimiter character/string, which in this case is a space character is it not?
Note you may find it easier to use an array plug-in to split the string and enumerate the parts (nsArray for example).
Stu
gretty
20th July 2012 00:35 UTC
Thanks for the reply :)
I'm not sure where I'm pushing the first segment? Not sure what you mean? I am pushing the 1st parameter onto the global stack.
If I were to add a endline character to the 1st parameter would that work? I'll have a look into the array plugin thanks. Although I'm really hoping I can get splice to work.
Any ideas how I can get splice to work with this string?
MSG
20th July 2012 05:42 UTC
He means you're pushing an array string, then index 0, and then "user_lib_4d" as the array separator. You probably want the space as array separator.