This state simply takes a notecard with INI formatted data, reads it, and returns a list that contains the INI data. A description of this state and each function follows. A state for reading the notecard is also provided. The following functions are provided: GetINIKey, SetINIKey, GetINISectionList, GetINIKeyList, DeleteINISection, DeleteINIKey, and KeyExists. I have used modified versions there, so they’re usable on Aurora-Sim if you’re up to tracking down the different ways scripts function there. As written, these functions also will not function properly on Aurora-Sim. In addition, SL imposes limits on lists that XEngine does not. These may work over in SL, but have not been tested there. ![]() These functions were written and tested with OpenSimulator’s XEngine in mind. Unless you go nuts, this should still be sufficient for most uses. This is important because a notecard line is limited to 255 characters, so you must keep in mind that any values you store share those 255 characters with the name of the section, the key, and two null characters. Each list element is composed of a section, key, and value delimited by a null character. Within a script, the INI data is stored in a single list. They do not store them, and comments will not be preserved when the notecard is written. They cannot be appended to the end a key/value pair. Comments must start with a semicolon and occupy a notecard line of their own. These functions have some limited support for INI style comments within the notecard. I want to provide a full description of the functions available, but if you’re in a hurry to simply grab them, scroll down to the bottom of this page for the full code. Another version of these functions that uses OSSL functions is available, and has to ability to write data to a notecard. ![]() Note: This function delays the script for 0.1 seconds.Įxample: // Read out a complete notecard from the object's inventory.This page contains code from a script that enables a scripter to read and manipulate notecards that contain data in the INI File format. Requests from notecards that contain embedded inventory items will always result in EOF, regardless of the line being requested. Note that lines longer than 255 characters will be truncated without any indication that this has been done. If name is not a valid notecard, or if the notecard is empty, the object will print to the Script Errors/Warning window, “Couldn’t find notecard NAME” where “NAME” is the name of the invalid notecard. you should keep in mind that any time you edit and save such a notecard, it will get a new key. ![]() Name can be either a string containing the name of a notecard in the object’s inventory, or a key pointing to a notecard (that can be anywhere and doesn’t have to reside in the object). The key returned by llGetNotecardLine is a unique identifier which will be supplied to the dataserver event as the queryid parameter. You can get the number of lines in a notecard with llGetNumberOfNotecardLines. If the requested line is past the end of the notecard, the dataserver event will return the constant EOF (“End Of File”) string. This function fetches line number of notecard name and returns the data through the dataserver event. Key llGetNotecardLine( string name, integer line)
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |