Thread Tools Display Modes
09/28/14, 04:18 PM   #1
Argusus
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 120
Extra Characters after output to debug window

Hello,

i'm seeing extra chars like "^p" and "^n" or "^Mx" when I output Item links or play names via the "d()" method. i'm also see this if I stored a custom variable. is there a way to prevent this or what are these extra charactersa
  Reply With Quote
09/28/14, 04:28 PM   #2
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by skobyjay View Post
Hello,

i'm seeing extra chars like "^p" and "^n" or "^Mx" when I output Item links or play names via the "d()" method. i'm also see this if I stored a custom variable. is there a way to prevent this or what are these extra charactersa
Use function zo_strformat(pattern, ...). For names is usually used pattern SI_UNIT_NAME or "<<C:1>>".

Lua Code:
  1. d(zo_strformat(SI_UNIT_NAME, name))

A bit more about zo_strformat, its patterns and control characters like "^p" or "^n":
http://www.esoui.com/forums/showthread.php?t=1443
  Reply With Quote
09/28/14, 04:53 PM   #3
Argusus
AddOn Author - Click to view addons
Join Date: Sep 2014
Posts: 120
awesome thanks. is there an similar function for an Item LInk? I can't seem to find in the API.
  Reply With Quote
09/28/14, 07:42 PM   #4
Garkin
 
Garkin's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2014
Posts: 832
Originally Posted by skobyjay View Post
awesome thanks. is there an similar function for an Item LInk? I can't seem to find in the API.
Function zo_strformat works for item links the same way as for regular strings.

Example:
lua Code:
  1. local itemLink = "|H1:item:16424:1:50:0:0:0:0:0:0:0:0:0:0:0:0:7:0:0:0:0|h|h"
  2. d(zo_strformat("ItemLink: <<t:1>>", itemLink))
Prints:
ItemLink: [Racial Motifs 1: The High Elves]

Last edited by Garkin : 09/28/14 at 07:47 PM.
  Reply With Quote

ESOUI » Developer Discussions » Lua/XML Help » Extra Characters after output to debug window

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off