![]() |
#1 |
Junior Member
Join Date: Feb 2011
Posts: 4
|
String arrays, sort of
Several times, I've wanted to do the same body of script code, just changing one string. Without some sort of string array, I've just made the body a function and called it several times.
It finally occurred to me, looking at StrStr, that if I just had a special delimiter character, I could get the same effect by separating the string elements with that delimiter. So here's an implementation using "$\n" as the delimiter. I hope someone finds it useful: -------- PerLine.nsh code: |
![]() |
![]() |
![]() |
#2 |
Moderator
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
|
This is one way but it is much easier (and cleaner) to use a plug-in (such as NSISArray) or use INI files/registry to store multiple values (i.e. by index or value name). You do not need to worry about the delimiter being in your array elements then.
Stu |
![]() |
![]() |
![]() |
|
Tags |
logiclib, string array |
Thread Tools | Search this Thread |
Display Modes | |
|
|