Search found 8 matches
- Wed Jun 30, 2010 11:18 am
- Forum: Macros
- Topic: json.append() and empty properties
- Replies: 7
- Views: 1556
json.append() and empty properties
One last query (for now): I want to store some JSON Object s in a JSON Array and store the array in a property. I want to be able to add and remove object from the JSON Array whenever I like. I am trying to add items using this macro: [h:meleeWeaponList = meleeWeaponList()] [h:weaponList = "&qu...
- Wed Jun 30, 2010 1:18 am
- Forum: Macros
- Topic: Newlines in new macros
- Replies: 7
- Views: 624
Re: Newlines in new macros
Hmm. I have no idea why that didn't occur to me. I think I need some more sleep.Raoden wrote:I was also able to just literally insert a "quotation mark, 'Enter' key, quotation mark" string into a macro command in one of my projects, and it worked just fine.
- Tue Jun 29, 2010 11:21 pm
- Forum: Macros
- Topic: Newlines in new macros
- Replies: 7
- Views: 624
Re: Newlines in new macros
That's the correct answer!biodude wrote:I wonder if this works (untested)...
Try using this code to insert a new line into text: decode("%0A")
e.g.Code: Select all
[H: string = "line 1"+ decode("%0A") +"line 2" ]
Thanks!
- Tue Jun 29, 2010 10:41 pm
- Forum: Macros
- Topic: Newlines in new macros
- Replies: 7
- Views: 624
Newlines in new macros
I have some code to generate a macro command. [h:newEntry = '[h:weapons = json.append(weapons, json.set("{}", "index", json.length(weapons), "name", "' + name + '", "subtype", "", "damage", ' + damage + ', "qualities", j...
- Tue Jun 29, 2010 7:25 pm
- Forum: Macros
- Topic: Odd listSort() behavior
- Replies: 14
- Views: 889
Re: Odd listSort() behavior
Wow, thanks for the feedback!
Now that we've been through all of that, I have completely changed my implementation of the feature, making this a moot point. I like the advice about the json arrays though. Is there a performance impact to using jsons over string lists?
Now that we've been through all of that, I have completely changed my implementation of the feature, making this a moot point. I like the advice about the json arrays though. Is there a performance impact to using jsons over string lists?
- Tue Jun 29, 2010 12:15 pm
- Forum: Macros
- Topic: Odd listSort() behavior
- Replies: 14
- Views: 889
Re: Odd listSort() behavior
Can you show us the pertinent code block? Using "N+" as the second parameter is the correct solution, so maybe there's something else... Thanks for the quick response! Honestly it's nothing more complex than the following: [r:listSort("80018, 90316, 110014, 130015, 200016, 220013, 27...
- Tue Jun 29, 2010 10:36 am
- Forum: Macros
- Topic: Odd listSort() behavior
- Replies: 14
- Views: 889
Re: Odd listSort() behavior
Have you checked the documentation at listSort ? There is a parameter which tells the function whether to perform a numeric sort or an alphabetic sort. Yours is an alphabetic sort (hence the one starting with "9" comes after the ones starting with "1"). I did forget to mention i...
- Mon Jun 28, 2010 9:39 pm
- Forum: Macros
- Topic: Odd listSort() behavior
- Replies: 14
- Views: 889
Odd listSort() behavior
I have a list! "80018, 90316, 110014, 130015, 200016, 220013, 270016, 360016, 440516, 440816, 472515, 50011" I would like to sort this list. When I do this, the list is sorted a in a confusing (to me) manner: "110014, 130015, 200016, 220013, 270016, 360016, 440516, 440816, 472515, 500...