Difference between revisions of "Category talk:LSL String"

From Second Life Wiki
Jump to navigation Jump to search
m
Line 3: Line 3:
The == operator needs an example.
The == operator needs an example.


== Working with the dataserver event I discovered that "\n" within a string taken from a notecard is not read by for example llSetText() as a new line. ==
== Working with the [[dataserver]] event I discovered that "\n" within a string taken from a notecard is not read by for example [[llSetText]]() as a new line. ==


Assuming "data" was a string such as "Douglas Adams,High on a rocky promontory\nsat an Electric Monk on a bored horse." is presented as "High on a rocky promontory\nsat an Electric Monk on a bored horse."
Assuming "data" was a string such as "Douglas Adams,High on a rocky promontory\nsat an Electric Monk on a bored horse." it is presented as "High on a rocky promontory\nsat an Electric Monk on a bored horse." by the [[llSetText]]
<lsl>
<lsl>
default
default
Line 28: Line 28:
</lsl>
</lsl>


is presented as "High on a rocky promontory
is presented as "High on a rocky promontory                                                                                                            
           sat an Electric Monk on a bored horse." as one would expect. I can't figure out why the structure of this discussion is so messed up though.
           sat an Electric Monk on a bored horse." as one would expect. (I can't figure out why the structure of this discussion is so messed up though.)
-- '''[[User:EddyFragment Robonaught|Eddy]]''' 01:48, 29 May 2009 (UTC)
-- '''[[User:EddyFragment Robonaught|Eddy]]''' 01:48, 29 May 2009 (UTC)

Revision as of 17:55, 28 May 2009

Value1 equals value2 is how I spelled value1 == value2, back over in the Category tab. Please fix the spelling, if you're enough more Wiki literate than I to know how.

The == operator needs an example.

Working with the dataserver event I discovered that "\n" within a string taken from a notecard is not read by for example llSetText() as a new line.

Assuming "data" was a string such as "Douglas Adams,High on a rocky promontory\nsat an Electric Monk on a bored horse." it is presented as "High on a rocky promontory\nsat an Electric Monk on a bored horse." by the llSetText <lsl> default {

   dataserver(key id, string data)
   {
       llSetText(llList2String(llCSV2List(data),1), <1.0,1.0,1.0>, 1.0);
   }

} </lsl>

Whereas

<lsl> default {

   state_entry()
   {
       llSetText("High on a rocky promontory\nsat an Electric Monk on a bored horse.", <1.0,1.0,1.0>, 1.0);
   }

} </lsl>

is presented as "High on a rocky promontory

          sat an Electric Monk on a bored horse." as one would expect. (I can't figure out why the structure of this discussion is so messed up though.)

-- Eddy 01:48, 29 May 2009 (UTC)