Member
Join Date: Aug 2014
Posts: 52
|
Sorry for all these questions, I'm only asking about things that I can't find on the wiki.
What does the splice function do and what are the parameters passed into it? splice(x,y,z), what are x, y, and z? Thanks. |
#1 |
Senior Member
Volunteer Data File Contributor
Join Date: Jan 2010
Location: Chicago, IL (USA)
Posts: 10,729
|
So normally Splice() is used in languages like JavaScript to splice apart a long string (ie URL) into tokens by a specific value. So for a URL you normally slice it apart by its "/" to get each piece as a token. Anyways it appears that HL splice does the exact opposite.
So splice() here puts strings together by a specific value. Code:
~append any special details for this weapon special = splice(special,field[wpSpecial].text,", ") So if Special had "shadow" and field[wpSpecial].text had "chemosh" then special at the end would have "shadow, chemosh" in it. Hero Lab Resources: Pathfinder - d20pfsrd and Pathfinder Pack Setup 3.5 D&D (d20) - Community Server Setup 5E D&D - Community Server Setup Hero Lab Help - Hero Lab FAQ, Editor Tutorials and Videos, Editor & Scripting Resources. Created by the community for the community - Realm Works kickstarter backer (Alpha Wolf) and Beta tester.- d20 HL package volunteer editor. |
#2 |
Member
Join Date: Aug 2014
Posts: 52
|
Thanks. Yeah that's kind of an odd use of the word splice. I guess what's being "spliced" is the middle character between two strings.
|
#3 |
|
|