Array structure

I'm stillnew to array.
So i'm trying to create a dynamic structure like this:
this_array = new Array();
some_values = new Array();
some_values = param.split ( " , " )
for ( i = 0 ; i < param.length ; i ++ ){
this[ "values_" + i ] = param[ i ] ;
return_values = this[ "values_" + i ]
this_array_structure = [ some_object , return_values ]
this_array.push( this_array_structure )
trace ( this_array ) // returns: computer_A , usb
the problem is that the "return_values" consists more than
one variable, in this case it has 5 : " dvi , firewire , audio ,
video , usb "
Somehow it only returns the last variable which is usb.
I'm trying to make it so that it would return something like
this:
[ computer_A , dvi , firewire , audio , video , usb ]
The reason why I want to make it dynamic because each item
has a different number of properties. In this case computer_A has
5, computer_B may only have 4 and so forth.
Any help would be greatly appreciated.

The 350Z wrote:
> this_array = new Array();
> some_values = new Array();
> some_values = param.split ( " , " )
> for ( i = 0 ; i < param.length ; i ++ ){
> this = param ;
> return_values = this
> }
> this_array_structure =
> this_array.push( this_array_structure )
> trace ( this_array ) // returns: computer_A , usb
Sorry but your code doesn't make any sense: you are
overwritting the this
reference in a for loop and I think you may be confusing the
length
property of strings and the length property of arrays, this
just cannot
work. Was that a copy paste of the code you are actually
using?
Anyway, since you have a string, you don't need a for loop at
all, the
method split will return an array directly. So as an example:
var param = "dvi , firewire , audio , video , usb"
var the_array = param.split(" , ");
trace(the_array); // done!
And if you need to add the content of this array to another,
check out the
method "concat".
Best luck,
Tim.

Similar Messages

  • Loop through Array structure - using xpath

    Hello,
    My BPEL process logic is as follows:
    a. Extract data into variable - receiveMessageInputVariable
    The variable 'receiveMessageInputVariable' in turn has data in array structure. (set of items)
    b. Transform the data to target structure
    c. Call target partner link to store extracted data into varaible 'ServiceInputVariable'
    The variable 'ServiceInputVariable' structure is similar to 'receiveMessageInputVariable'
    In the BPEL process 'at process' level - I have catch-all exception handler - which must send the list of 'items' which failed during a BPEL instance.
    i. If my email body has the following code as below:
    <%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER')%>
    It successfully fetches only the first item_number record of the array structure. But does not fetch the other records in the array.
    ii. Similarly, I wish to print all the items (as received) to be available in the email body in the following pattern:
    <%"Record One-"%>
    <%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[1]/ITEM_NUMBER')%>
    <%"<br/>"%>
    <%"Record Two-"%>
    <%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[2]/ITEM_NUMBER')%>
    <%"Record Nth-"%>
    <%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM[N]/ITEM_NUMBER')%>
    Please suggest a suitable syntax in my email body - which can loop through all itemline_item array and print all the item_numbers.
    (pseudo code below)
    for i in 1 .. ora:countNodes(bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER'))
    loop
    <%"Item Number-"%><%bpws:getVariableData('i')%>
    <%bpws:getVariableData('receiveMessageInputVariable','XXINV_ITEM_PAY_ROW_TYPE','/ns4:XXINV_ITEM_PAY_ROW_TYPE/ITEMLINE/ITEMLINE_ITEM/ITEM_NUMBER')%>
    end loop;
    Thanks,
    Santhosh

    Hi Santhosh
    Try with the following approach. It may work for you
    1. Create one XSD, for the HTML content
    <xsd:element name="HTML">
    <xsd:complexType>
    <xsd:sequence>
    <xsd:element name="C1" type="xsd:string" nxsd:style="terminated" nxsd:terminatedBy="${eol}">
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:element>
    </xsd:schema>
    2. Create one XSL, may be you have to do this manually, as JDev will not support HTML transformations. This XSL will map your input XML to an HTML format.
    3. Create one variable in BPEL of type in the above XSD
    4. Use assign activity to assign the XSL transformation to the variable defined in Step#3
    <from expression="ora:processXSLT('HTMLTransformation.xsl',bpws:getVariableData('Variable_Input',INPUT_TYPE'))"/>
    <to variable="invokeWriteHTMLService_Input" part="HTML" query="/ns6:HTML/ns6:C1"/>
    5. Copy the variable to the email body variable
    <copy>
    <from expression="bpws:getVariableData('invokeWriteHTMLService_Input','HTML','/ns6:HTML/ns6:C1')"/>
    <to variable="varNotificationReq" part="EmailPayload"
    query="/EmailPayload/ns8:Content/ns8:ContentBody"/>
    </copy>
    Basically, the above approach converts your input to a string value whose content is a complete HTML, and you will use only one value to assign to the email body.
    Note: Please change the Variable names/XPATH Expressions/XSL file name/element names etc according to your BPEL
    Hope this helps you
    Regards
    Ayon

  • How to get dynamic query results from an array/structure

    I have an edit page that is set up to display phone number fields from the user stored in our database. The properties for the phone number fields are set by a structure of arrays. My problem is that when a user has more than 1 phone number in my database, my structures correctly show this on the form by displaying 2 phone numbers. The problem I am having is that when it shows multiple phone numebrs, it always shows the first result and just repeats it as opposed to dropping the 2nd or 3rd phone number in their respective fields.
    array and structure code below:
          <!--- Mobile --->
          <cfset mobile = StructNew()>
          <cfset mobile.dynamic = false>
          <cfset mobile.dynamicLabel = '+ Add'>
          <cfset mobile.fields = ArrayNew(1)>
    <cfif #checkuserv.recordcount# GT '0'>   
          <cfset mobile.fields[1] = StructNew()>
          <cfset mobile.fields[1].required = false>
          <cfset mobile.fields[1].label = 'Phone Number 1'>
          <cfset mobile.fields[1].displayIcon = false>
          <cfset mobile.fields[1].voice = true>
          <cfset mobile.fields[1].voiceChecked = true>
          <cfset mobile.fields[1].toolTip = "Please choose if you would like to receive a text or voice call on this number">
    </cfif>
    <cfif #checkuserv.recordcount# IS '2'>    
          <cfset mobile.fields[2] = StructNew()>
          <cfset mobile.fields[2].required = false>
          <cfset mobile.fields[2].label = 'Phone Number 2'>
          <cfset mobile.fields[2].displayIcon = false>
          <cfset mobile.fields[2].toolTip = "Please choose if you would like to receive a text or voice call on this number">
          <cfset mobile.fields[2].voice = true>
          <cfset mobile.fields[2].voiceChecked = true>
    </cfif>
    <cfif #checkuserv.recordcount# IS '3'>     
          <cfset mobile.fields[3] = StructNew()>
          <cfset mobile.fields[3].required = false>
          <cfset mobile.fields[3].label = 'Phone Number 3'>
          <cfset mobile.fields[3].displayIcon = false>
          <cfset mobile.fields[3].toolTip = "Please choose if you would like to receive a text or voice call on this number">
          <cfset mobile.fields[3].voice = true>
          <cfset mobile.fields[3].voiceChecked = true>
    </cfif>
    Here is the code for my fields that call the array info:
    <!--- Voice 1 --->      
            <cfloop index="i" from="1" to="#ArrayLen(mobile.fields)#">
                <cfif i EQ 1 OR NOT mobile.dynamic OR form.mobileDisplayed GTE i>
                    <cfparam name="form.areacode_#i#" default="">
                    <cfparam name="form.prefix_#i#" default="">
                    <cfparam name="form.suffix_#i#" default="">
                <div class="fieldBlock phoneBlock" id="phoneBlock#i#">
                    <label for="areacode_#i#">
                        <cfif mobile.fields[i].required><span>*</span></cfif>
                        <cfif mobile.fields[i].displayIcon><img src="/images/sm_phone.jpg" /></cfif>
                        #mobile.fields[i].label#:
                    </label>
                    <div class="inputBlock">
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'prefix_#i#', 3, event)" name="areacode_#i#" id="areacode_#i#" class="areacode" value="#trim(left(checkuserv.sub_user_number, '3'))#" />
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'suffix_#i#', 3, event)" name="prefix_#i#" id="prefix_#i#" class="prefix" value="#trim(mid(checkuserv.sub_user_number, "4", '3'))#" />
                        <input type="text" maxlength="4" name="suffix_#i#" id="suffix_#i#" class="suffix"  value="#trim(mid(checkuserv.sub_user_number, "7", '4'))#" />
                        <cfif StructKeyExists(mobile.fields[i], "voice") and mobile.fields[i].voice>
                            <div class="voice" id="voice#i#">
                                <input type="radio" value="0" name="voice_#i#"<cfif Not StructKeyExists(mobile.fields[i], "voiceChecked") or Not mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Text</label>
                                <input type="radio" value="1" name="voice_#i#"<cfif StructKeyExists(mobile.fields[i], "voiceChecked") and mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Voice</label>
                            </div>
                        </cfif>
                        <cfif StructKeyExists(mobile.fields[i], "toolTip") and mobile.fields[i].toolTip neq "">
                            <div class="toolTip" id="toolTip_#i#" title="#mobile.fields[i].toolTip#" onClick="alert('#mobile.fields[i].toolTip#')">?</div>
                        </cfif>
                    </div>
    <!--- This number was invalid or if geocoding failed, and they've picked a carrier to override, display the carrier override dropdown--->
                    <cfif ListFindNoCase(invalidMobileIndexList, i) or ( showMap and IsDefined("form.carrierOverride" & i) )>
                        <div id="carrierOverrideBox#i#" class="carrierOverrideBlock">
                            <label>Carrier:</label>
                            <div class="inputBlock">
                                <select name="carrierOverride#i#" id="carrierOverride#i#">
                                    <option value="-1">-- Pick your carrier --</option>
                                    <cfloop query="carriers">
                                        <!--- 1111 is voice, 0 is NONE, don't display  --->
                                        <cfif Not ListFindNoCase("0,1111", carriers.carrier_id)>
                                            <option value="#Trim(carriers.carrier_id)#"<cfif IsDefined("form.carrierOverride" & i) and form["carrierOverride" & i] eq Trim(carriers.carrier_id)> selected="selected"</cfif>>#Trim(carriers.carrier_title)#</option>
                                        </cfif>
                                    </cfloop>
                                </select>
                                <a href="http://www.inspironlogisticscontact.cfm?account_id=#account_id#&carrierOverride=1"
                                       title="Carrier help"
                                       onClick="window.open('http://www.inspironlogisticscontact.cfm?account_id=#account_id#&carrierOverride=1','#accou nt_id#','width=500,height=800,scrollbars=no,screenX=100,screenY=100,top=100,left=100,resiz able=1'); return false;"
                                      >?</a>
                            </div>
                        </div>
                    </cfif>
                    <cfif mobile.dynamic AND i EQ form.mobileDisplayed AND i LT ArrayLen(mobile.fields)>
                    <div class="dynamicAddBlock dynamicAddMobileBlock" id="dynamicAddmobile_#i#">
                          <a href="javascript: submitAddField('mobile')">#mobile.dynamicLabel#</a>
                    </div>
                    </cfif>
                </div>
                </cfif>
            </cfloop>
            <cfif mobile.dynamic>
                <input name="mobileDisplayed" id="mobileDisplayed" value="#form.mobileDisplayed#" type="hidden" />
            </cfif>
            <input name="carrierOverrideActive" id="carrierOverrideActive" value="<cfif carrierOverrideActive>1<cfelse>0</cfif>" type="hidden" />
    I have been stuck on this for days, finally turning to the forum today with a few different issues. I hate trying to work within the framwork of other peoples code.
    I use coldfusion 8

    I broke the chunk of code away from the page and am now getting teh phone numbers in the right spots, but I am still getting a coldfusion error.
    Element 2 is undefined in a Java object of type class coldfusion.runtime.Array.
    Here is my code...
    <cfset invalidMobileIndexList = "">
    <cfset showMap = false>
    <cfset carrierOverrideActive = false>
    <!--- Voice 1 --->       
            <cfloop index="i" from="1" to="#ArrayLen(mobile.fields)#">
    <!------>            <cfif i EQ 1 OR NOT mobile.dynamic OR form.mobileDisplayed GTE i>
                    <cfparam name="form.areacode_#i#" default="">
                    <cfparam name="form.prefix_#i#" default="">
                    <cfparam name="form.suffix_#i#" default="">
                <div class="fieldBlock phoneBlock" id="phoneBlock#i#">
                <label for="areacode_#i#">
                        <cfif mobile.fields[i].required><span>*</span></cfif>
                        <cfif mobile.fields[i].displayIcon><img src="/images/sm_phone.jpg" /></cfif>
                        #mobile.fields[i].label#:
                    </label>
                    <cfoutput query="checkuserv" ><div class="inputBlock">
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'prefix_#i#', 3, event)" name="areacode_#i#" id="areacode_#i#" class="areacode" value="#trim(left(checkuserv.sub_user_number, '3'))#" />
                        <input type="text" maxlength="3" onKeyUp="numTyped(this, 'suffix_#i#', 3, event)" name="prefix_#i#" id="prefix_#i#" class="prefix" value="#trim(mid(checkuserv.sub_user_number, "4", '3'))#" />
                        <input type="text" maxlength="4" name="suffix_#i#" id="suffix_#i#" class="suffix"  value="#trim(mid(checkuserv.sub_user_number, "7", '4'))#" />
                        <cfif StructKeyExists(mobile.fields[i], "voice") and mobile.fields[i].voice>
                            <div class="voice" id="voice#i#">
                                <input type="radio" value="0" name="voice_#i#"<cfif Not StructKeyExists(mobile.fields[i], "voiceChecked") or Not mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Text</label>
                                <input type="radio" value="1" name="voice_#i#"<cfif StructKeyExists(mobile.fields[i], "voiceChecked") and mobile.fields[i].voiceChecked> checked="checked"</cfif> />
                                <label>Voice</label>
                        </cfif></div></cfoutput>
                        <cfif StructKeyExists(mobile.fields[i], "toolTip") and mobile.fields[i].toolTip neq "">
                            <div class="toolTip" id="toolTip_#i#" title="#mobile.fields[i].toolTip#" onClick="alert('#mobile.fields[i].toolTip#')">?</div>
                        </cfif>
                    </div>
                    <!--- This number was invalid or if geocoding failed, and they've picked a carrier to override, display the carrier override dropdown--->
                    <cfif ListFindNoCase(invalidMobileIndexList, i) or ( showMap and IsDefined("form.carrierOverride" & i) )>
                        <div id="carrierOverrideBox#i#" class="carrierOverrideBlock">
                            <label>Carrier:</label>
                            <div class="inputBlock">
                                <select name="carrierOverride#i#" id="carrierOverride#i#">
                                    <option value="-1">-- Pick your carrier --</option>
                                    <cfloop query="carriers">
                                        <!--- 1111 is voice, 0 is NONE, don't display  --->
                                        <cfif Not ListFindNoCase("0,1111", carriers.carrier_id)>
                                            <option value="#Trim(carriers.carrier_id)#"<cfif IsDefined("form.carrierOverride" & i) and form["carrierOverride" & i] eq Trim(carriers.carrier_id)> selected="selected"</cfif>>#Trim(carriers.carrier_title)#</option>
                                        </cfif>
                                    </cfloop>
                                </select>
                                <a href="http://www.inspironlogistics.com/wens/contact.cfm?account_id=#account_id#&carrierOverride= 1"
                                       title="Carrier help"
                                       onClick="window.open('http://www.inspironlogistics.com/wens/contact.cfm?account_id=#account_id#&carrierOverride= 1','#account_id#','width=500,height=800,scrollbars=no,screenX=100,screenY=100,top=100,left =100,resizable=1'); return false;"
                                      >?</a>
                            </div>
                        </div>
                    </cfif>
                    <cfif mobile.dynamic AND i EQ form.mobileDisplayed AND i LT ArrayLen(mobile.fields)>
                    <div class="dynamicAddBlock dynamicAddMobileBlock" id="dynamicAddmobile_#i#">
                          <a href="javascript: submitAddField('mobile')">#mobile.dynamicLabel#</a>
                    </div>
                    </cfif>
                </div>
                </cfif>
            <cfif mobile.dynamic>
                <input name="mobileDisplayed" id="mobileDisplayed" value="#form.mobileDisplayed#" type="hidden" />
            </cfif>
            <input name="carrierOverrideActive" id="carrierOverrideActive" value="<cfif carrierOverrideActive>1<cfelse>0</cfif>" type="hidden" /><!------>
           </cfloop>

  • How to declare a pointer to structure element which is array structures

     LStr, *LStrPtr, **LStrHandle structure is taken from LabView cintools extcode.h
       I used: sprintf(((*(*in_array)->Strings[*count])->str), local_str); to pass local_str string to
    LabView array.  It worked fine, but  one programmer adviced me to change code to  be more readable.
    Means - to change  (*(*in_array)->Strings[*count]) construction to a pointer. I tried many different
    ways to implement this - but in all cases it caused LabView to crash. I understand that this question
    is related to C programming not about LabView, but could you point me at a place where I have mistake ?
    The most likely incorrect string is " LV_array = &(**((**in_array).Strings[*count])); "
    Thanks in advance.
    1.  typedef struct {
    2.        int32   cnt;            /* number of bytes that follow */
    3.        uChar   str[1];         /* cnt bytes */
    4.  } LStr, *LStrPtr, **LStrHandle;
    5.      
    6.  typedef struct {
    7.        int32 dimSize;
    8.        LStrHandle Strings[1];
    9.  } LVStringArray;
    10.      
    11. typedef LVStringArray **LVStrArrayHdl;
    12.      
    13  _declspec(dllexport) void avg_hello(int *count, LVStrArrayHdl in_array)
    14.      {
    15.      
    16.       unsigned char *local_str="Entering function ma_in()";
    17.       (*count) = 0;
    18.       LStr* LV_array;
    19.      
    20.       LV_array = &(**((**in_array).Strings[*count])); //Set address to which should point LV_array
    21.       subfunc(count, &in_array);                      // Call a function which resizes array (works)
    22.       sprintf(LV_array->str, local_str);              //passing string to LabView (not working)
    23.      
    24. }
    Solved!
    Go to Solution.

    thank you Andrey Dmitriev! spasibo!
    With your example I understood where I have error in my code:
    I tried to assign to pointer an address of string which wasn't yet pre-allocated!
    that means simply swapping strings we get final code:
    1.  typedef struct {
    2.        int32   cnt;            /* number of bytes that follow */
    3.        uChar   str[1];         /* cnt bytes */
    4.  } LStr, *LStrPtr, **LStrHandle;
    5.      
    6.  typedef struct {
    7.        int32 dimSize;
    8.        LStrHandle Strings[1];
    9.  } LVStringArray;
    10.      
    11. typedef LVStringArray **LVStrArrayHdl;
    12.      
    13  _declspec(dllexport) void avg_hello(int *count, LVStrArrayHdl in_array)
    14.      {
    15.      
    16.       unsigned char *local_str="Entering function ma_in()";
    17.       (*count) = 0;
    18.       LStr* LV_array;
    19.       subfunc(count, &in_array);                      // Call a function which resizes array (works), First we resize array, and only after that we can assign an address of string to a pointer
    20.       LV_array = &(**((**in_array).Strings[*count]));  //Assigning address to which should point LV_array
    21.      
    22.       sprintf(LV_array->str, local_str);              //passing string to LabView (not working)
    23.      
    24. }

  • Array/Structure or QueryNew

    Recently I have had to work with data that I read off a Text File. I created the required pages using both Arrays and QueryNew funtions to manipulate the data. I did find QueryNew better suited for my purpose. Speed wise I could not see any noticeable difference. Server performance wise do any of you know if one is better than the other?

    A couple of years ago, I had a ColdFusion Engineer at a conference to us that ColdFusion is more efficient at hangling LARGE arrays then LARGE Record Sets.  As it is a web application server, not a database management system.
    This was in reference to the preformance of Query of Query functionality that can often be sped up with a converstion to some type of Array logic.
    And I would worry more about which version was easier to code, understand and maintain before I would ever worry about minor preformance differences until such a time is load and preformance testing tells me there is a problem.
    But depending on what you where doing with those record sets after you built them with the QueryNew() functionality, it might, possible, maybe be slightly better if they where arrays.

  • SUPStorage api in SUP 2.1 to store array or structure

    Hi,
    I am using below code to store key value pair using SUP api for offline storage in workflow apps:
    SUPStorage.prototype.setItem(j, airlineId);
    Example: var j = 1;
                  var airlineid = "lufthansa";
      This works fine, but I want to store an array or at least a structure (single row) which has multiple items. How can we do that?
    I tried passing MBO value data directly, but it gives exception while I try to read:
    var mvc = getCurrentMessageValueCollection();
          var fData = mvc.getData("flightmbo");
          var values = fData.getValue();
         var i = 1;
         SUPStorage.prototype.setItem(i, values);
       This does not give any exception, but when I try to read by using code:
    var  i = 1;
        airlineKey =  SUPStorage.prototype.key(i);
        values =  SUPStorage.prototype.getItem(airlineKey);
    var j = 0;
       var theItems = values[j];
    This gives exception saying "Type Error: Result of expression 'values' [null] is not an object".
    Any workarounds to store a structure/array with the same key (such as airline id, text, time, availability).
    Thanks,
    Rohit

    Have you tried converting the array/structure to a string using JSON (or some similar technique) and storing it that way?

  • Make unique array of structure

    Hi all.
    How can make array of unique elements ?
    Heed to get from array -> array1
    <cfset array = arrayNew(1) />
    <cfset array1 = arrayNew(1) />
    <cfset array[ 1 ] = { id = '1' } />
    <cfset array[ 2 ] = { id = '1' } />
    <cfset array[ 3 ] = { id = '1' } />
    <cfset array[ 4 ] = { id = '2' } />
    <cfset array[ 5 ] = { id = '3' } />
    <cfset array[ 6 ] = { id = '4' } />
    <cfset array[ 7 ] = { id = '4' } />
    <cfset array[ 8 ] = { id = '5' } />
    <cfdump var="#array#" label="Current" />
    <cfset array1[ 1 ] = { id = '1' } />
    <cfset array1[ 2 ] = { id = '2' } />
    <cfset array1[ 3 ] = { id = '3' } />
    <cfset array1[ 4 ] = { id = '4' } />
    <cfset array1[ 5 ] = { id = '5' } />
    <br /><br />
    <cfdump var="#array1#" label="Needfull" />

    There are a few 'tricks' that you can use here ...
    A "struct" is fundamentally an associative-array structure.  So, if you've got an "id" field of any sort, a struct can locate any "id" almost instantly.  This is much faster than searching an array (which has a hidden cost created by virtual-memory paging over a large "footprint").
    When you add a struct to another struct or to an array, you are actually moving a reference to the structure.  You should find that (afaik!), if the struct is present both in an array and in a struct, both of these are references to one-and-the-same memory block.
    Use the most-convenient data structure when building the original set of records.  This is probably going to be a "struct."  If you then need to have an array of elements sorted in a particular way, build that array last, by using a "sort" operation to arrange the records in whatever order you want.  Since you'are actually (afaik...) moving references, you're not stomping on too much RAM.
    "Sorting" is what I call an "unexpectedly fast and efficient" operation, because it's one of the most heavily-studied operations in all of data processing ... and has been since the days of Herman Hollerith.

  • How to access a Access array in flex

    Hi
          Guys can any body explain me how to access an array.Actually i am succsufully getting value from array named Dynamic array.
                       DynamicArray[i].language_1[0].translation;
    here the node language_1 is not static it may be language_2 or language_3 or language_4 ect.. so i put that getting value in a variable named key
    var key:String = 'language_1'; //Suppose i am getting right value here in key
    So please guide me how i access my dynamic array using key so that i got same value as previous code give.
    i already tried:-DynamicArray[i].key.translation;
                           DynamicArray[i][key].translation;
    but every time got error.
    for more clarity i put array structure here
    DynamicArr= Array (@43b1271)   
        [0] = Object (@43ad219)   
            contentlanguage_1 = Array (@43b1431)   
                [0] = Object (@4417a11)   
                    choice_id = "0"   
                    deleted = "N"   
                    downloadurl = "http://94.126.48.105:80/cgi-bin/WebObjects/DataVit.woa/wa/Download/getImage?imageId=1281&f ilename="   
                    selected = "Y"   
                    translation = "2_486"   
                length = 1   
        [1] = Object (@4417949)  
    please Help me out
    Thanks In Advance
       Vineet Osho

    Hi Vineet Osho,
    You haven't tried ---> DynamicArray[i][key][0].translation; This will work
    You tried -> DynamicArray[i][key].translation; (This is wrong as you havent specified on which index you want to access)
    If still doesn't work ty this...
    Try  (DynamicArray[i])[key][0].translation;
    If the above one doesn't work then try the below one...
    var obj:Object = DynamicArray[i];
    var translation:String = obj[key][0].translation;
    Thanks,
    Bhasker

  • Array problem in FL 1.x

    Is there any alternative for array in Flash Lite 1.X
    (excluding PSUEDO Array)?

    kamsky wrote:
    > Is there any alternative for array in Flash Lite 1.X
    (excluding PSUEDO Array)?
    Yes, since arrays structures are not natively supported in
    Flash Lite
    prior to 2.x, developers must use one of two methods for 1.1
    content
    (that I know of) to simulate them:
    1.) Use the eval statement (2) or a movieclip to store and
    reference
    vars. Depending on your situation and/or needs one may be
    more
    appropriate to what you are doing than the other.
    1.) eval method:
    arr1 = "a"
    arr2 = "b"
    arr3 = "c";
    for ( i=1; i<=3; i++ ) {
    trace( eval( "arr" add i ) );
    2.) Create an empty movieclip off stage. Assign it an
    instance name of
    array_mc (or whatever) ... use it to store vars. Use the
    syntax:
    array_mc[0] = "a";
    array_mc[1] = "b";
    array_mc[2] = "c";
    trace( array_mc[0] );
    Also, here is a Pseudo array class for 1.1 from Aral Balkan
    you may be
    interested in:
    http://aralbalkan.com/353
    Some addition resources you should also check out if you are
    coming from
    > 2 and are working in 1.1:
    http://www.flashmobilebook.com/
    http://www.adobe.com/devnet/devices/articles/as2_to_flashlite_print.html
    http://www.adobe.com/devnet/devices/articles/as_flashlite.html
    Alessandro Pace has a running list of useful items like this
    at:
    http://www.biskero.org/?page_id=342

  • How to Create a datatype for a storeprocedure which has got array ?

    Hi All,
    Please tell me how to create a datatype for a storeprocedure which has got an array structure ?
    Thanks,
    Sindhu.

    Hi Sindhu.
    You would have to use a JDBC Cursor for this but it's possible only Output parameters, not Input parameters.
    It's describle in a help link:
    Defining an EXECUTE Statement  http://help.sap.com/saphelp_nwpi711/helpdata/en/44/7b72b2fde93673e10000000a114a6b/frameset.htm
    The following SQL data types are supported:
    INTEGER, BIT, TINYINT, SMALLINT, BIGINT, FLOAT, REAL, DOUBLE, NUMERIC, DECIMAL, CHAR, VARCHAR, STRING, LONGVARCHAR, DATE, TIME, TIMESTAMP, BINARY, VARBINARY, LONGVARBINARY, BLOB (input and output), CLOB (input and output), CURSOR (output; only in connection with the Oracle JDBC driver)
    I think you can execute your StoreProcedure many times depends of array occurs.
    Regards.
    Bruno.

  • Setting up a multi dimensional array of objects

    Hey ya'll. How would i setup a multi dimensional array with this structure?
    TypeSave(Title, material(name, quantity))
    TypeSave[1](Lego Shop, material[1](Lego Blocks, 100))
                   material[2](Roof, 1))
    TypeSave[2](Lego Car, material[1](Door, 2))
              material[2](Gravy, 3, ounces))
    TypeSave will be saved as a serialised object to a file so i can load everything within it and keep the structures integrity.
    I'll have an add button that will add the name and quantity to the next empty position of "material" array. This will then be listed in a list box and allow me to save all the materials with a title to the TypeSave list in the next empty position.
    I'm getting mightily confused how to set up the classes and the array structure :(
    Any help would be greatly appreciated!

    private TypeSave t = new TypeSave();
    private void btnSaveItemActionPerformed(java.awt.event.ActionEvent evt) {                                             
            t.addItem(txtItemTitle.getText(), new Material(txtMaterialName.getText(),txtQuantity.getText()));
            t.saveToFile();
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new MainForm().setVisible(true);
        class Material implements Serializable {
         String name = null;
         String quantity = null;
         //To restrict default constructor
         private Material() {
         public Material(String name, String quantity) {
              this.name = name;
              this.quantity = quantity;
         public String getName() {
              return this.name;
         public String getQuantity() {
              return this.quantity;
         public String toString() {
              return "Name : " + this.name + "Quantity : " + this.quantity;
    class TypeSave implements Serializable {
         private Hashtable items = null;
         public TypeSave() {
              items = new Hashtable();
         public void addItem(String title,Material material) {
              ArrayList materials = (ArrayList) items.get(title);
              if(materials == null) {
                   materials = new ArrayList();
                   items.put(title,materials);
              materials.add(material);
         public Hashtable getItems() {
              return this.items;
         public ArrayList getItem(String title) {
              return (ArrayList)this.items.get(title);
            void saveToFile() {
        ObjectOutputStream oos = null;
            try
            oos = new ObjectOutputStream(new FileOutputStream("item.ser"));
            catch (IOException i)
              System.out.println( "Error opening file");
          try
            oos.writeObject(items);
            catch (IOException o)
                System.out.println("Error writing file");
          try
              if(oos != null)
              oos.close();
            catch (IOException x)
                System.out.println("Error closing file");
    }My save class was working, but i tried to merge it to test this code structure and now it's failing with excepion:
    "Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException"
    any ideas?

  • Actively changing number of elements in an array

    How do you use a control in the front panel to actively change the number of rows in an array which full of numeric controls?
    Is it possible to have this happen without the program to be running? Thanks for any help.
    Solved!
    Go to Solution.

    Chris B. wrote:
    Is it possible to have this happen without the program to be running? Thanks for any help.
    So you want this to work at edit time? Are you talking about the number of visible elements or are you talking about the actual size of the array (these numbers are unrelated!).
    In order for something to happen, "something" needs to be running. You could run another VI and use scripting to make changes to the array structure.
    You could also make an Xcontrol containing an array and a numeric. Xcontrols are fully operational even if the VI itself is in edit mode.
    If this is a program to run standalone, simply make sure the program is always running, but is in an idle state if nothing needs to be done at the moment. Now you can handle resize events if needed.
    LabVIEW Champion . Do more with less code and in less time .

  • SELECT Command on Associative Array

    Guys,
    I have a question on associative arrays in ORACLE.
    I m working on one assignment where I am not allowed to create any object into the database e.g. Create temporary tables, use of cursors etc.
    For data manipulation i used associative array, but at the end i want to show that result in pl/SQL developer.
    I know that I can't use select command on associative arrays.
    Any alternative/solution for it?
    Also is there any way that i can write the contents of associative array to a .csv file?

    user13478417 wrote:
    I m working on one assignment where I am not allowed to create any object into the database e.g. Create temporary tables, use of cursors etc.Then cease to use Oracle - immediately. As you are violating your assignment constraints.
    ALL SQL and anonymous PL/SQL code blocks you send to Oracle are parsed as cursors. And as you are not allowed to use cursors, it will be impossible to use Oracle as cursors is exactly what Oracle creates... and creates a lot of. For every single SQL statement. And every single anonymous PL./SQL block.
    For data manipulation i used associative array, Why? Arrays is a poor choice in Oracle as a data structure most times as it is inferior in almost every single way to using a SQL table structure instead.
    Pumping data into an array? That already severely limits scalability as the array requires expensive dedicated server (PGA) memory. It does not use the more scalable shared server (SGA) memory.
    Manipulating data in an array? That requires a "+full structure scan+" each time as it does not have the indexing and partitioning features of a SQL table.
    Running a SQL select on an array? That is using a cursor. That also means copying the entire array structure, as bind variable, from the PL/SQL engine to the SQL engine. An excellent way to waste memory resources and slow down performance... but hey you can still shout "+Look Ma, no --brains-- hands, I'm not using any SQL tables as dictated by my assignment!+".... +<sigh>+
    Any alternative/solution for it?You mean besides using Oracle correctly ?
    You could reload the shotgun and shoot yourself in the other foot too. That should distract you for from the pain in the first foot.

  • Hopefully an easy question about arrays

    hi there
    is there any way of creating an array of objects that is of unspecified size at the time of creating and then add objects as and when they are read from a file?
    longer explanation:
    i am creating molecule visualization software. the molecule's structure is stored in a text file, ie each line has info on one atom ie 3d coords etc. i'm storing the molecule structure in an object (Molecule.java) which has an array (Structure[]) of atoms (Atom.java). obviously molecules can have any number of atoms in it and you don't know how many until you've gone through the whole file and counted. The only way i can think of doing it is to go through the whole file, coun the atoms, close the file, create the Molecule object with the structure array size of NoOfAtoms and then open the file again and add the atoms as i go through them again. however, i refuse to believe this is the most efficient way of doing it as i have to go throguh the same file twice which brings me back to my original question.
    as i said i'm hopeing there is a simple answer
    cheers

    Use a Collection . Use a Vector, ArrayList or even a Hashtable. You do not need to define the size of these objects and can add and remove Objects from them whenever you want

  • Array in WSDL

    Hi there,
    I have a Proxy->PI->SOAP scenario.
    The third-party WSDL contains an array, which is unfortunately not supported by PI.
    The complex type looks as following:
    <xs:complexType name="EmployeeInfo">
      <xs:sequence>
      <xs:element name="ID" type="xs:string"/>
      <xs:element name="Name" type="xs:string"/>
      <xs:element name="Qual" type="ns1:QualItems"/>
    </xs:sequence>
    </xs:complexType>
    This is the array structure:
    <xs:complexType name="QualItems">
      <xs:complexContent>
      <xs:restriction base="soapenc:Array">
      <xs:sequence/>
      <xs:attribute xmlns:n1="http://schemas.xmlsoap.org/wsdl/"
    ref="soapenc:arrayType" n1:arrayType="ns1:QualRec[]"/>
      </xs:restriction>
      </xs:complexContent>
    </xs:complexType>
    <xs:complexType name="QualRec">
      <xs:sequence>
      <xs:element name="QualPos" type="xs:string"/>
      </xs:sequence>
    </xs:complexType>
    Ive tried to change the WSDL in the following way:
    <xs:complexType name="EmployeeInfo">
      <xs:sequence>
      <xs:element name="ID" type="xs:string"/>
      <xs:element name="Name" type="xs:string"/>
      <xs:element name="Qual" type="QualRec" minOccurs="1" maxOccurs="unbound"/>
      </xs:sequence>
    </xs:complexType>
    But the field "QualPos" is not filled in the thir-party application.
    I now asked the service provider to send me a proper payload for the web service.
    It looks like that:
    <Qual href="#id2" />
    <soapenc:Array id="id2" xmlns:q4="urn:XXX" soapenc:arrayType="q4:TSAPQualRec[1]">
      <Item href="#id3" />
    </soapenc:Array>
    <q5:QualRec id="id3" xsi:type="q5:TSAPQualRec" xmlns:q5="urn:XXX">
      <QualPos xsi:type="xsd:string">XYZ</QualPos>
    </q5:QualRec>
    How can I achieve that in PI?
    Do I have to use XSLT mapping?
    Could you please give me an example?
    Thanks in advance!

    Hi Kolz,
    A few cents. This can be done by PI, you can use a XSL or Java Mapping. Personally, i'd rather to use XSL mapping.
    If you need to do the array in the request you would need only to set the tag soapen:Array manually in the XSL (if its the attributes are not parameters) and the rest with a value-of-select.
    If you need to transform a response with the array you only need to do a for:each like this example looping through xslt split array - Xslt - our.umbraco.org
    Finally, if you share a source XML and target XML (hidding the company information with another values) we can help you with the XSL easier.
    Hope this helps.
    Regards.

Maybe you are looking for

  • How to calcualte opening balance of supplier for given period

    Hi all, i have to develoed suppler ledger report.please help me how to calculate opening balance of supplier. Thanks and regards,

  • ITunes quits unexpectedly on startup

    iTunes won't open, with a dialog box stating that iTunes quit unexpectedly while trying to restoring its windows.  Sometimes it gets as far as checking my iTunes library, but it crashes and creates a Problem Report for iTunes. Thanks for your help. 

  • Goods Movement in PI Sheet

    Hi, I have to mapped PP-PI Scenario for one of our client, so i want to know that how goods movement will be happen in t cod e COEBR at the time of PI sheet processing. And also please ellborate the Massage sending and Recieving Process. Thanks in Ad

  • Function Module to modify provider specific settings in rsdichapro

    Hi guys, does anybody know the function module used to modify the provider specific settings for an InfoCube. Thanks in advance. Alex

  • Relink Issue or just warning

    Hi Just installed 11.5.10 vision on a 64 bit linux system (Fedora 4 x86_64), following all the links and trobleshooting notes ( relatively easy really). I am now upgarding ro 11.5.10.2 and applying the new ilog libraries. Relink MST and get lots of t