<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
	<id>http://i.bnu.edu.cn/wiki/index.php?action=history&amp;feed=atom&amp;title=LlJsonGetValue</id>
	<title>LlJsonGetValue - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://i.bnu.edu.cn/wiki/index.php?action=history&amp;feed=atom&amp;title=LlJsonGetValue"/>
	<link rel="alternate" type="text/html" href="http://i.bnu.edu.cn/wiki/index.php?title=LlJsonGetValue&amp;action=history"/>
	<updated>2026-06-01T03:38:02Z</updated>
	<subtitle>本wiki的该页面的版本历史</subtitle>
	<generator>MediaWiki 1.31.0</generator>
	<entry>
		<id>http://i.bnu.edu.cn/wiki/index.php?title=LlJsonGetValue&amp;diff=720&amp;oldid=prev</id>
		<title>Ty：创建页面，内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}   {{函数详情 |函数名 = Function: string llJsonGetValue( string json, list specifiers ); |…”</title>
		<link rel="alternate" type="text/html" href="http://i.bnu.edu.cn/wiki/index.php?title=LlJsonGetValue&amp;diff=720&amp;oldid=prev"/>
		<updated>2020-08-20T12:02:52Z</updated>

		<summary type="html">&lt;p&gt;创建页面，内容为“{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}   {{函数详情 |函数名 = Function: string llJsonGetValue( string json, list specifiers ); |…”&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{LSL Header|ml=*}}{{LSLC|Keywords}}{{LSLC|Flow Control}}{{LSLC|}}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{函数详情&lt;br /&gt;
|函数名 = Function: string llJsonGetValue( string json, list specifiers );&lt;br /&gt;
|参数= 参数：&lt;br /&gt;
string	json&lt;br /&gt;
list	specifiers		&lt;br /&gt;
|返回值= 返回值：返回一个通过解析 json 生成的字符串，这个字符串表示 json 并按说明符的指定进行遍历&lt;br /&gt;
&lt;br /&gt;
|注意事项=Lljsongetvalue 要比从带有 lllist2string 的列表读取值慢得多。但是使用 lllist2string 时，需要解析字符串并将其转换为 list。当您需要解析字符串时，lljsongetvalue 要快得多: 例如，通过 lllist2string (llparsestring2list (yourstring，[ delimiters ] ，[ spacers ]) ，n) ; 当您需要集中地迭代时，考虑 lljson2list。&lt;br /&gt;
&lt;br /&gt;
|示例=&lt;br /&gt;
示例一&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
default {&lt;br /&gt;
    state_entry() {&lt;br /&gt;
 &lt;br /&gt;
     //below is an example of a JSON=string with a key called &amp;quot;key&amp;quot; and a value &amp;quot;val&amp;quot; &lt;br /&gt;
     string json1 = &amp;quot;{\&amp;quot;key\&amp;quot;:\&amp;quot;val\&amp;quot;}&amp;quot;;&lt;br /&gt;
     llSay(0, llJsonGetValue( json1, [&amp;quot;key&amp;quot;]));//returns &amp;quot;val&amp;quot; in localchat&lt;br /&gt;
 &lt;br /&gt;
     string json2 = &amp;quot;{\&amp;quot;mansBestFriend\&amp;quot;:\&amp;quot;dog\&amp;quot;}&amp;quot;;&lt;br /&gt;
     llSay(0, llJsonGetValue( json2, [&amp;quot;mansBestFriend&amp;quot;]));//returns &amp;quot;dog&amp;quot; in localchat&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
示例二&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
JGetValTest(){&lt;br /&gt;
    string j=&amp;quot;[[1,2],[4,5,6]]&amp;quot;;            //JSON may be written directly as a string like this in sl.&lt;br /&gt;
    string k;                              //this will change with each command below;&lt;br /&gt;
    k=llJsonGetValue(j,[]);                //returns the whole array of a JSON. It might just be one entry or a whole nested array or whole nested object.&lt;br /&gt;
    //if &amp;quot;j&amp;quot; is a single JSON_STRING, this may return what the string represents as a JSON within a string; a JSON_NUMBER , JSON_TRUE, TRUE ...&lt;br /&gt;
 &lt;br /&gt;
    k=llJsonGetValue(&amp;quot;\&amp;quot;3.14\&amp;quot;&amp;quot;,[]);       //==k=&amp;quot;3,14&amp;quot; (float that was stored in a JSON_STRING within a JSON. and not as JSON_NUMBER for no good reason)&lt;br /&gt;
    k=llJsonGetValue(&amp;quot;\&amp;quot;TRUE\&amp;quot;&amp;quot;     ,[]);  //==k=&amp;quot;TRUE&amp;quot; (the value was stored as a JSON_STRING and is thus returned verbatim)&lt;br /&gt;
    k=llJsonGetValue(j,[0]);               //returns only the first entry (at offset 0). An entry can be any JSON type,&lt;br /&gt;
                                           //each entry being separated by a comma from other entries.&lt;br /&gt;
                                           //array and object entries may contain multiple comma separated entries within them.&lt;br /&gt;
    k=llJsonGetValue(j,[1]);//returns only the second entry... (all the above still applies) k=&amp;quot;[4,5,6]&amp;quot;;&lt;br /&gt;
    k=llJsonGetValue(llJsonGetValue(j,[1]),[2]);&lt;br /&gt;
                                           //instead of getting an entry from &amp;quot;j&amp;quot; we get a sub-entry from llJsonGetValue(j,[1]), &lt;br /&gt;
                                           //assuming the sub-entry is a JSON_ARRAY. It returns the 3rd sub-entry of the second entry, &lt;br /&gt;
                                           //that is an array with 3 entries. it would make k=&amp;quot;6&amp;quot;. &lt;br /&gt;
                                           //it will return JSON_INVALID if there is no 3rd entry in the 2nd sub-array,&lt;br /&gt;
                                           //or no 2nd sub-array.&lt;br /&gt;
    k=llJsonGetValue(j,[1,2]);             //Shorter way to do the same as in the previous example.&lt;br /&gt;
    k=llJsonGetValue(&amp;quot;true&amp;quot;,[]);           //Sets k to JSON_TRUE&lt;br /&gt;
    k=llJsonGetValue(&amp;quot;True&amp;quot;,[]);           //Sets k to JSON_INVALID because the JSON constant for 'true' is all lower case&lt;br /&gt;
    k=llJsonGetValue(&amp;quot;TRUE&amp;quot;,[]);           //Sets k to JSON_INVALID because the JSON constant for 'true' is all lower case&lt;br /&gt;
    k=llJsonGetValue(JSON_TRUE,[]);        //Sets k to JSON_INVALID. The JSON_xxxx constants are not supposed to be part of&lt;br /&gt;
                                           // a JSON string, just values to test against.&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|相关函数=&lt;br /&gt;
[[llList2Json]]&lt;br /&gt;
[[llJson2List]]&lt;br /&gt;
[[llJsonSetValue]]&lt;br /&gt;
[[llJsonValueType]]&lt;br /&gt;
|相关事件=无&lt;br /&gt;
&lt;br /&gt;
}}&lt;/div&gt;</summary>
		<author><name>Ty</name></author>
		
	</entry>
</feed>