Difference between revisions of "Talk:LlGetListEntryType"

From Second Life Wiki
Jump to navigation Jump to search
Line 11: Line 11:
An else will handle the string nicely, as anything that is not an integer/float/etc. is therefore a string...  But I can't figure out how to detect a float.  Any ideas? <br />
An else will handle the string nicely, as anything that is not an integer/float/etc. is therefore a string...  But I can't figure out how to detect a float.  Any ideas? <br />
[[User:Cron Stardust|Cron Stardust]] 23:21, 7 March 2007 (PST)
[[User:Cron Stardust|Cron Stardust]] 23:21, 7 March 2007 (PST)
:Using your technique to determine the type by examining the data is going to be flawed and slow. It is best to include type data in your output. Try out TightListTypeParse and TightListTypeDump on my userpage. If you are interested I'll post the Tightlist {{HoverText|ESL|Extended LSL}} header file (the advantage of that being there are extra features to the functions that aren't included by default). [[User:Strife Onizuka|Strife Onizuka]] 05:08, 8 March 2007 (PST)

Revision as of 06:08, 8 March 2007

List entries that are strings, but look like other types

(Maybe there's a shorter title for this topic?)

Most of us who have ever had to "unserialize" know that this function returns a type of TYPE_STRING when we have ["<123, 45.4, 0>"]. I have a list coming to me that is like unto ["blah", "133", "1.04"]. So far I can find out what is an integer by using this magic:

    tempStr = llList2String(raw, index);
    if ((string) ((integer) tempStr) == tempStr) { // Test for integer,
        ....
    }

An else will handle the string nicely, as anything that is not an integer/float/etc. is therefore a string... But I can't figure out how to detect a float. Any ideas?
Cron Stardust 23:21, 7 March 2007 (PST)

Using your technique to determine the type by examining the data is going to be flawed and slow. It is best to include type data in your output. Try out TightListTypeParse and TightListTypeDump on my userpage. If you are interested I'll post the Tightlist ESL header file (the advantage of that being there are extra features to the functions that aren't included by default). Strife Onizuka 05:08, 8 March 2007 (PST)