View Issue Details

IDProjectCategoryView StatusLast Update
0000036opensim-SCBugpublic2019-07-31 06:39
Reporteronefang Assigned Toonefang  
PriorityhighSeveritymajorReproducibilityalways
Status closedResolutionsuspended 
Product Version0.8.2.1 
Target Version0.9.0.1 RC0 
Summary0000036: Double casts.
DescriptionTwo cast operations in a row works in SL, but not in OS.
Tagsscript engine

Relationships

child of 0000035 closedonefang Casting. 

Activities

onefang

onefang

2019-06-13 15:58

administrator   ~0000029

Last edited: 2019-06-17 04:07

An example of triple casting, though it uses parenthesis to control order.

onefang

onefang

2019-06-13 18:30

administrator   ~0000033

Examples from OpenCollar (The SL version)

src/collar/oc_bell.lsl

float g_fVolume=0.5; // volume of the bell

    sPrompt += "Bell Volume:  \t"+(string)((integer)(g_fVolume*10))+"/10\n"; 


src/collar/oc_bookmarks.lsl

integer isInteger(string input) { //for validating location scheme 
    return ((string)((integer)input) == input);
}

src/collar/oc_couples.lsl

    string sMessage = llList2String(lMenuParams, 1);

    if (sMessage == UPMENU) CoupleAnimMenu(kAv, iAuth);
    else if ((integer)sMessage > 0 && ((string)((integer)sMessage) == sMessage)) {
        g_fTimeOut = (float)((integer)sMessage);
onefang

onefang

2019-06-17 04:06

administrator   ~0000034

In current SL, and in OpenSim 0.8 and 0.9 this form is valid -

(string)((integer)1.2)
This form isn't -

(string)(integer)1.2

I am almost certain I have had to fix that second form in scripts that worked before but not in newer versions of OpenSim. Let's see if I can find those again, and try the first form in them.
onefang

onefang

2019-07-23 15:12

administrator   ~0000097

I'll suspend this one until I find an example out in the wild of double cast without extra parens.

Issue History

Date Modified Username Field Change
2019-06-12 23:26 onefang New Issue
2019-06-12 23:26 onefang Status new => assigned
2019-06-12 23:26 onefang Assigned To => onefang
2019-06-12 23:26 onefang Tag Attached: script engine
2019-06-12 23:26 onefang Relationship added child of 0000035
2019-06-12 23:27 onefang Product Version 0.9.0.1 RC0 => 0.8.2.1
2019-06-13 15:58 onefang Note Added: 0000029
2019-06-13 18:30 onefang Note Added: 0000033
2019-06-17 04:06 onefang Note Added: 0000034
2019-06-17 04:07 onefang Note Edited: 0000029
2019-06-18 01:52 onefang Status assigned => feedback
2019-07-23 15:12 onefang Status feedback => resolved
2019-07-23 15:12 onefang Resolution open => suspended
2019-07-23 15:12 onefang Note Added: 0000097
2019-07-31 06:39 onefang Status resolved => closed