Array string

anyone know how to create a string array without having to put number of array slots...and i do not have the string variables..so cant do the other string array style.
eg:
String anArray = new Array[X]

You can declare an array of Strings without initialising it by writing
String[] myStringArray;At some point in the code, you will have to initialise it, though, and at that point you must supply a value for its size:
myStringArray = new String[100];If you need a variable-sized array (for example, you can't tell how big you need the array to be before using it), then use an ArrayList instead.

Similar Messages

  • Flex input type for c# string array: string[]

    Quick question, what would the input type for Flex be if the data type on the asp.net c# web service was a string array, string[], it seems to autodetect it as an ArrayCollection but that isnt right, so I would assume array, but i would still like to confirm this.
    thanks
    shaine

    it was actually arraycollection :\
    the actual answer is:
    var _compEmp:ArrayCollection = new ArrayCollection(new Array("Shaine Fisher"));
    thanks

  • String[] array = (String[])vector.toArray();

    Why does the last line cause a ClassCastException?:
    Vector vector = new Vector();
    vector.add("One");
    vector.add("Two");
    vector.add("Three");
    vector.add("Four");
    vector.add("Five");
    String[] array = (String[])vector.toArray();
    Thanks
    [email protected]

    Because toArray () creates an Object array. You need the toArray(Object[]):String[] array = (String[]) vector.toArray (new String[vector.size ()]);Kind regards,
      Levi

  • New user with an  massive array/string headache

    Working with a large (365 source files, 65 mxml files) SDK 3.6.0 project in FB 4.5 and continually get :
    Resource
    Path
    Location
    Description
    Type
    TB4.mxml
    /the0bot_1/src/the0bot/gui
    line 1
    1067: Implicit coercion of a value of type String to an unrelated type Array.
    Flex Problem
    TB4.mxml
    /the0bot_1/src/the0bot/gui
    line 1
    1184: Incompatible default value of type String where Array is expected.
    Flex Problem
    It is a very strange error, as you can see, line #1 is my language declaration!
    <?xml version="1.0" encoding="utf-8"?>
    This error is virtually non-removable.  It usually attaches to a component, or an ArrayCollection, and even if I delete the accused violator, the error will find a new point of attachment.?  This is the only page in the project that involves two-way data binding.  I had at first attributed the error to a yahoo.astra.com timestepper drop-in, but even rebuilding the page without that component does not remedy the trouble....
    Any help at this point would be appreciated, There are countless hours invested in the project and this has been a hold-up for several days now. 
    Thank you.

    Nothing had changed project-wise originally. I am simply adding a new mxml component to a perfectly good runnable project. I have since moved my workspace twice to a clean folder, and if  I remove the module everything is back to normal.
    I do notice that it won't show up if I have a normal error (i.e add a visual component but have not added code yet or forget a brace or such) but then when I clear the last error and validate, the cursor will jump to the top of the page mmediately.
    currently the errors are
    Resource
    Path
    Location
    Description
    Type
    TB4.mxml
    /the0bot_1/src/the0bot/gui
    line 296
    1067: Implicit coercion of a value of type String to an unrelated type Array.
    Flex Problem
    TB4.mxml
    /the0bot_1/src/the0bot/gui
    line 296
    1184: Incompatible default value of type String where Array is expected.
    Flex Problem
    (they have moved off the header to the reinstalled numberformatter)
    the code:
    Some may seem a little unconventional, but I have been getting strange errors like 
    Resource
    Path
    Location
    Description
    Type
    TB4.mxml
    /the0bot_1/src/the0bot/gui
    line 222
    1105: Target of assignment must be a reference value.
    Flex Problem
    which is why the 2 " tbean(t) = n; " lines are commented out.     ( tbean = object, t = string, n = number)???
    (all the bindings are an attempt at elimination....)
    <?xml version="1.0" encoding="utf-8"?>
         <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"
                             xmlns:gui="the0bot.gui.*"
                             width="418" height="289">
              <mx:Script>
                        <![CDATA[
                                  import com.evony.common.beans.*;
                                  import com.evony.common.constants.*;
                                  import com.google.analytics.debug._Style;
                                  import flash.events.*;
                                  import flash.utils.*;
                                  import mx.collections.ArrayCollection;
                                  import mx.controls.Button;
                                  import mx.events.*;
                                  import mx.events.ItemClickEvent;
                                  import mx.events.PropertyChangeEvent;
                                  import mx.utils.ObjectUtil;
                                  import the0bot.common.*;
                                  import the0bot.event.CityManagerUpdateEvent;
                                  import the0bot.management.*;
                                  import the0bot.management.CityManager;
                                  import the0bot.player.*;
                                  import the0bot.scripts.*;
                                  private var cityManager:CityManager;
                                  private var city:CityState;
                                  public var _THE0BOT:String = "the0bot";
                                  public var the0bot:Boolean;
                                  public static const yes:Boolean = true;
                                  public static const no:Boolean = false;
                                  public static const zero:int = 0;
                                  public static const resource:Array = ("food", "wood", "stone", "iron", "gold");
                                  [Bindable]public var text:String;
                                  [Bindable]public var value:Number;
                                  [Bindable]public var tb2Heroes:ArrayCollection;
                                  [Bindable]public var tb2Troops:ArrayCollection;
                                  [Bindable]public var tb3Queue:ArrayCollection;
                                  [Bindable]public var tb2Resources:ArrayCollection;
                                  [Bindable]public var tb2Cities:ArrayCollection;
                                  [Bindable]public var selectedIndex:int;
                                  [Bindable]public var selectedCity:String;
                                  [Bindable]public var selectedHero:String;
                                  [Bindable]public var selectedtb3:String;
                                  // Rom
                                  public function init(citymanager:CityManager,City:CityState) : void {
                                            cityManager = citymanager;
                                            city=City;
                                            the0bot = (this.cityManager.getConfig(_THE0BOT, 0));
                                            resettb2Data();
                                            listCities;
                                            cityManager.addEventListener(CityManagerUpdateEvent.TYPE, onUpdate);
                                            Context.getInstance().addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, onContexthandler);
                                            Context.getInstance().addEventListener(CityManagerUpdateEvent.TYPE, onUpdate);
                                            Refresh();
                                  public function unInit() : void {
                                            if (cityManager.hasEventListener(CityManagerUpdateEvent.TYPE))
                                                      cityManager.removeEventListener(CityManagerUpdateEvent.TYPE, onUpdate);
                                            if (Context.getInstance().hasEventListener(CityManagerUpdateEvent.TYPE))
                                                      Context.getInstance().removeEventListener(CityManagerUpdateEvent.TYPE, onUpdate);
                                            cityManager = null;
      public function Refresh() : void {
                                            this.callLater(updateHeroes);
                                  [Bindable]private var travelTime:Number;
                                  [Bindable]private var campTime:Number;
                                  private function onContexthandler(event:PropertyChangeEvent) : void
                                            campTime = (Number(campMinutes.text)* 60000) + campSeconds.value * 1000;
                                            var t =(Utils.getServerTime() + travelTime + campTime)as Date;
                                            _arriveClock.text = TFseconds.format(t);
                                            (xSpin.value >= 800)? xSpin.value=0 : (xSpin.value <= -1)? xSpin.value = 799 :t=null;
                                            (ySpin.value >= 800)? ySpin.value=0 : (ySpin.value <= -1)? ySpin.value = 799 :t=null;
                                  private function onUpdate(event:CityManagerUpdateEvent) : void {
                                            if (event.CastleId == cityManager.id || event.CastleId == -1) {
                                                      switch (event.UpdateType) {
                                                                case CityManagerUpdateEvent.TROOPS:
                                                                case CityManagerUpdateEvent.PRODUCTION:
                                                                          Refresh();
                                                                          break;
                                  private function updateHeroes():void
                                            if (heroMenu.selectedIndex != zero) return;
                                            tb2Heroes.disableAutoUpdate();
                                            tb2Heroes = new ArrayCollection;
                                            for each (var hero:HeroBean in cityManager.heroes){
                                                      if (hero.isIdle == yes){
                                                                var obj:Object = new Object;
                                                                obj.label = hero.name;
                                                                tb2Heroes.addItem(obj);
                                            obj = {label:"any"};
                                            tb2Heroes.addItemAt(obj, 0);
                                            obj = {label:"none"};
                                            tb2Heroes.addItemAt(obj, 0);
                                            tb2Heroes.enableAutoUpdate();
                                            heroMenu.selectedIndex = zero;
                                  public function resettb2Troops() : void
                                            var tb2:Array = new Array();
                                            for (var t:int = 0; t < TroopType.justTroopIntNames.length-1; t++ )
                                                      tb2[t].label = TroopType.justTroopAbbr[t];
                                                      tb2[t].data = 0;
                                                      tb2[t].type = TroopType.justTroopIntNames[t];
                                            tb2Troops = new ArrayCollection(tb2);
                                  private function resettb2Resources():void
                                            var tb2:Array = new Array;
                                            for (var i:int = 0; i < resource.length-1; i++);
                                                      tb2.label = resource[i].charAt(0) + ":";
                                                      tb2.data = 0;
                                                      tb2.type = resource[i];
                                            tb2Resources = new ArrayCollection(tb2);
                                  private function listCities():void{
                                            tb2Cities = new ArrayCollection;
                                            for each (var gcity:CityState in Context.getInstance().cities){
                                                      var obj:Object = new Object;
                                                      obj.label = gcity.cityManager.castle.name;
                                                      obj.id = gcity.cityManager.castle.fieldId;
                                                      (obj.id == this.cityManager.castle.fieldId) ? tb2Cities.addItemAt(obj, zero) : tb2Cities.addItem(obj);
                                  private function resettb2Data():void
                                            resettb2Troops()
                                            resettb2Resources()
                                            updateHeroes();
                                            listCities();
                                  public function doesHaveEnsign(): Boolean {
                                            var player:* = Context.getInstance().Player;
                                            for each (var item:* in player.itemsArray) {
                                                      if (item.id == null) continue;
                                                      if (item.id == "player.troop.1.a") return true;
                                            return false;
                                  protected function campSwitchClick(event:MouseEvent):void
                                            /* if (campSwitch.selected = yes) arriveSwitch.selected = no;
                                            else {campMinutes.text = "0";
                                                      campSeconds.value=0;
                                  protected function arriveSwitchClick(event:MouseEvent):void
                                            if (arriveSwitch.selected = yes){
                                                      campSwitch.selected = no;
                                                      travelTime=0;
                                            else travelTime = getArmyMarchTime();
                                  public function tb2troopsToBean():TroopBean{
                                            var tbean = new TroopBean;
                                            var tb2:Array = tb2Troops.toArray()
                                            for (var i:int = 0; i < tb2.length-1; i++ )
                                            var n:Number = tb2[i].data;
                                            var t:String = tb2[i].type;
                                            //tbean(t) = n;
                                            return tbean;
                                  public function tb2resToBean():ResourceBean{
                                            var tbean = new ResourceBean;
                                            var tb2:Array = tb2Resources.toArray();
                                            for (var i:int = 0; i < tb2.length-1; i++ )
                                                      var n:Number = tb2[i].data;
                                                      var t:String = tb2[i].type;
                                                      //tbean(t) = n;
                                            return tbean;
                                  private  function spinCoordsString():String
                                            return xSpin.value + "," + ySpin.value;
                                  private  function missionTypeIndex():int
                                            var s:int=marchMenu.selectedIndex+1;
                                            if (s==4)s++;
                                            return s;
                                  private  function spinnersToFieldID():int{
                                            return (int(ySpin.value)*800 + int(xSpin.value));
                                  private  function fieldIDtoSpinners(fieldID:int):void
                                            xSpin.value = Map.getX(fieldID);
                                            ySpin.value = Map.getY(fieldID);
                                  public function getArmyMarchTime():Number{
                                            return cityManager.getAttackTravelTime(this.cityManager.id, spinnersToFieldID(), tb2troopsToBean(), missionTypeIndex());
                                  protected function xySpin_changeHandler():void
                                  protected function sendSwitchClick(event:MouseEvent):void
                                            var t:TroopBean = tb2troopsToBean();
                                            var r:ResourceBean = tb2resToBean();
                                            var camp:String = "";
                                            var time:String = campMinutes.text + ":" + campSeconds.textSnapshot;
                                            camp += (arriveSwitch.selected) ? "@:" + time : (campSwitch.selected) ? "c:" + time : "";
                                            if (!useEnsignSwitch.selected == yes)
                                                      this.city.sendTroops(spinCoordsString(), TroopType.troopBeanToString(t,","), missionTypeIndex(), heroMenu.text, r, camp);
                                            else this.city.sendBigTroops(spinCoordsString(), TroopType.troopBeanToString(t,","), missionTypeIndex(), heroMenu.text, r, camp);
                                            heroMenu.selectedIndex = zero;
                                            updateHeroes();
                                  protected function citycloseHandler(event:FlexEvent):void
                                            for each (var gcity:CityState in Context.getInstance().cities){
                                                      if (gcity.cityManager.castle.name == cityMenu.selectedLabel){
                                                                fieldIDtoSpinners(gcity.cityManager.castle.fieldId);
                                  private function herocloseHandler(event:Event):void {
                                            selectedHero = ComboBox(event.target).selectedItem.label;
                        ]]>
              </mx:Script>
              <mx:DateFormatter id="TFseconds" formatString="J:NN:SS"/>
              <mx:HBox width="415" height="288" horizontalGap="5" horizontalScrollPolicy="off" paddingTop="5"
                                   verticalScrollPolicy="off">
                        <mx:VBox width="277" height="280" horizontalAlign="center" horizontalScrollPolicy="off"
                                             verticalGap="4" verticalScrollPolicy="off">
                                  <mx:HBox x="0" y="0" height="276" horizontalGap="5" paddingLeft="5" paddingTop="3">
                                            <mx:VBox height="267" horizontalScrollPolicy="off" paddingTop="5" verticalGap="4"
                                                                 verticalScrollPolicy="off">
                                                      <mx:HBox id="troopCountBox" width="125" height="25" borderColor="#2B1296"
                                                                           borderStyle="solid" borderThickness="2" cornerRadius="5"
                                                                           horizontalAlign="center" horizontalGap="0" horizontalScrollPolicy="off"
                                                                           verticalScrollPolicy="off">
                                                                <mx:Label width="37" paddingTop="2" text="Army" textAlign="center"/>
                                                                <mx:Text width="70" paddingTop="2" text="125,000" textAlign="left"/>
                                                      </mx:HBox>
                                                      <mx:DataGrid id="table1" width="125" height="226" backgroundAlpha=".1"
                                                                                     backgroundColor="#EADFF2" borderColor="#400AAF" borderStyle="solid"
                                                                                     borderThickness="2" dataProvider="{tb2Troops}"
                                                                                     lockedColumnCount="2" lockedRowCount="12"
                                                                                     resizableColumns="false" rowHeight="20" selectionMode="singleCell"
                                                                                     showHeaders="false" sortableColumns="false"
                                                                                     variableRowHeight="false">
                                                                <mx:columns>
                                                                          <mx:DataGridColumn width="35" dataField="abbr" editable="false"
                                                                                                                      fontSize="10"/>
                                                                          <mx:DataGridColumn width="90" dataField="data" editable="true"
                                                                                                                      editorDataField="value" fontSize="10"
                                                                                                                      formatter="{nf}"
                                                                                                                      itemEditor="mx.controls.NumericStepper"/>
                                                                </mx:columns>
                                                      </mx:DataGrid>
                                            </mx:VBox>
                                            <mx:VBox width="131" height="268" horizontalAlign="center" paddingTop="5" verticalGap="4">
                                                      <mx:HBox width="125" height="25" borderColor="#2B1296" borderStyle="solid"
                                                                           borderThickness="2" cornerRadius="5" horizontalAlign="center" horizontalGap="0"
                                                                           horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                                                <mx:Label width="31" paddingLeft="0" paddingRight="0" paddingTop="2" text="Res."
                                                                                      textAlign="right"/>
                                                                <mx:Text width="80" paddingTop="2" text="999,999,999" textAlign="left"/>
                                                      </mx:HBox>
                                                      <mx:DataGrid id="table2" width="125" height="139" allowMultipleSelection="false"
                                                                                     backgroundAlpha=".1" backgroundColor="#DBE4F5" borderColor="#400AAF"
                                                                                     dataProvider="{tb2Resources}" lockedColumnCount="2" lockedRowCount="5"
                                                                                     resizableColumns="false" rowHeight="20" selectionMode="singleCell"
                                                                                     showHeaders="false" sortableColumns="false" variableRowHeight="false">
                                                                <mx:columns>
                                                                          <mx:DataGridColumn width="35" dataField="abbr" editable="false"
                                                                                                                      fontSize="10" headerText="Type" textAlign="right"/>
                                                                          <mx:DataGridColumn dataField="data" editable="true"
                                                                                                                      editorDataField="value" fontSize="10" formatter="nf"
                                                                                                                      headerText="Amt." textAlign="right">
                                                                                    <mx:itemEditor>
                                                                                              <mx:Component>
                                                                                                         <mx:NumericStepper doubleClickEnabled="true"
                                                                                                                                                    maximum="{resMax()}"
                                                                                                                                                    stepSize="1"/>
                                                                                              </mx:Component>
                                                                                    </mx:itemEditor>
                                                                          </mx:DataGridColumn>
                                                                </mx:columns>
                                                      </mx:DataGrid>
                                                      <mx:HBox horizontalScrollPolicy="off" verticalAlign="middle"
                                                                           verticalScrollPolicy="off">
                                                                <mx:Label width="33" height="19" text="Arr:" textAlign="right"/>
                                                                <mx:Text id="_arriveClock" width="76" height="21" paddingLeft="2" paddingTop="1"
                                                                                     text="00:00:00" textAlign="left"/>
                                                      </mx:HBox>
                                                      <mx:HBox width="84" horizontalGap="0" horizontalScrollPolicy="off" verticalScrollPolicy="off">
                                                                <mx:TextInput id="campMinutes" width="23" fontWeight="bold" maxChars="3"
                                                                                                 restrict="0-9" text="00" textAlign="right"/>
                                                                <mx:Text width="7" fontWeight="bold" selectable="false" text=":"
                                                                                     textAlign="right"/>
                                                                <mx:NumericStepper id="campSeconds" width="49" fontWeight="bold" maximum="59" value="" textAlign="left"/>
                                                      </mx:HBox>
                                                      <mx:ComboBox id="marchMenu" width="100" editable="false" fillColors="black,blue"
                                                                                     textAlign="center">
                                                                <mx:dataProvider>
                                                                          <mx:Array>
                                                                                    <mx:String>transport</mx:String>
                                                                                    <mx:String>reinforce</mx:String>
                                                                                    <mx:String>scout</mx:String>
                                                                                    <mx:String>attack</mx:String>
                                                                          </mx:Array>
                                                                </mx:dataProvider>
                                                      </mx:ComboBox>
                                            </mx:VBox>
                                  </mx:HBox>
                        </mx:VBox>
                        <mx:HBox width="125" height="280" borderColor="#400AAF" borderStyle="solid"
                                             borderThickness="2" cornerRadius="5" horizontalGap="3" horizontalScrollPolicy="off"
                                             paddingLeft="4" paddingTop="4" verticalScrollPolicy="off">
                                  <mx:VBox width="115" height="269" horizontalAlign="center" horizontalScrollPolicy="off"
                                                       verticalGap="5" verticalScrollPolicy="off">
                                            <mx:RadioButton id="useEnsignSwitch" width="65" label="Ensign"/>
                                            <mx:HBox width="100%" height="27" borderColor="#3F2AC1" borderStyle="solid"
                                                                 borderThickness="2" cornerRadius="5" horizontalAlign="center"
                                                                 verticalAlign="middle">
                                                      <mx:Button id="editSwitch" width="45" height="20" label="Edit" enabled="false"
                                                                             paddingLeft="1" paddingRight="1" toggle="true"/>
                                                      <mx:Button id="FMJSwitch" width="45" height="20" label="F.M.J."
                                                                             click="campSwitchClick(event)" enabled="false" paddingLeft="1"
                                                                             paddingRight="1" selected="true" toggle="true"/>
                                            </mx:HBox>
                                            <mx:ComboBox id="tb3Menu" width="100" dataProvider="{tb2Heroes}" editable="false"
                                                                           close="tb3closeHandler(event)" fillColors="black,blue" selectedIndex="0"
                                                                           textAlign="center">
                                            </mx:ComboBox>
                                            <mx:ComboBox id="cityMenu" width="100" dataProvider="{tb2Cities}" editable="false"
                                                                           close="citycloseHandler(event)" fillColors="black,blue" selectedIndex="0"
                                                                           textAlign="center">
                                            </mx:ComboBox>
                                            <mx:ComboBox id="heroMenu" width="100" dataProvider="{tb2Heroes}" editable="false"
                                                                           close="herocloseHandler(event)" fillColors="black,blue" selectedIndex="0"
                                                                           textAlign="center">
                                            </mx:ComboBox>
                                            <mx:HBox width="100" height="28" horizontalAlign="center" horizontalGap="0" paddingBottom="0"
                                                                 paddingLeft="0" paddingRight="0" paddingTop="0" verticalAlign="middle">
                                                      <mx:Label text="X:"/>
                                                      <mx:NumericStepper id="xSpin" width="55" change="xySpin_changeHandler(event)"
                                                                                                  maximum="800" minimum="-1" value="0"/>
                                            </mx:HBox>
                                            <mx:HBox width="100" height="28" horizontalAlign="center" horizontalGap="0"
                                                                 horizontalScrollPolicy="off" paddingBottom="0" paddingLeft="0" paddingRight="0"
                                                                 paddingTop="0" verticalAlign="middle" verticalScrollPolicy="off">
                                                      <mx:Label text="Y:"/>
                                                      <mx:NumericStepper id="ySpin" width="55" change="xySpin_changeHandler(event)"
                                                                                                  maximum="800" minimum="-1" value="0"/>
                                            </mx:HBox>
                                            <mx:HBox width="108" height="26" borderColor="#3F2AC1" borderStyle="solid"
                                                                 borderThickness="2" cornerRadius="5" horizontalAlign="center"
                                                                 horizontalScrollPolicy="off" verticalAlign="middle" verticalScrollPolicy="off">
                                                      <mx:Button id="sendSwitch" width="45" height="22" label="Send" borderColor="#60C592"
                                                                             click="sendSwitchClick(event)" paddingLeft="1" paddingRight="1"/>
                                                      <mx:Button id="clearSwitch" width="54" height="22" label="Clear"
                                                                             click="clearSwitch_clickHandler(event)"/>
                                            </mx:HBox>
                                            <mx:HBox width="100%" height="27" borderColor="#3F2AC1" borderStyle="solid"
                                                                 borderThickness="2" cornerRadius="5" horizontalAlign="center"
                                                                 verticalAlign="middle">
                                                      <mx:Button id="arriveSwitch" width="45" height="20" label="Arrive" enabled="true"
                                                                             paddingLeft="1" paddingRight="1" toggle="true"/>
                                                      <mx:Button id="campSwitch" width="45" height="20" label="Camp"
                                                                             click="campSwitchClick(event)" enabled="true" paddingLeft="1"
                                                                             paddingRight="1" selected="true" toggle="true"/>
                                            </mx:HBox>
                                  </mx:VBox>
                        </mx:HBox>
              </mx:HBox>
    </mx:Canvas>

  • Mapping Array string response from Web service

    Hi
    Need to map the response from a sync call to a WS which contains an array of strings the response message looks like:
    - <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    - <SOAP-ENV:Body>
    - <rpl:readAllRecFromDQStrArrayResponse xmlns:rpl="urn:AS400DBAccessVi">
    - <rpl:Response xmlns:pns="urn:java/lang">
      <pns:String>Row 1</pns:String>
      <pns:String>Row 2</pns:String>
      <pns:String>Row 3</pns:String>
      </rpl:Response>
      </rpl:readAllRecFromDQStrArrayResponse>
      </SOAP-ENV:Body>
      </SOAP-ENV:Envelope>
    Need to map it to the following MT:
    WSResponse
       Response String  1..unbounded

    Hi Udo
    This the the source and target:
    SOURCE:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:AS400DBAccessWsd/AS400DBAccessVi/rpc" targetNamespace="urn:AS400DBAccessWsd/AS400DBAccessVi/rpc">
    <xsd:import namespace="urn:java/lang" />
    <xsd:element xmlns:ns1="urn:java/lang" name="Response" type="ns1:ArrayOfString" />
    </xsd:schema>
    TARGET:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://dubal.ae/SOP/SD003" targetNamespace="http://dubal.ae/SOP/SD003">
    <xsd:element name="executeDQResponse" type="executeDQResponse" />
    <xsd:complexType name="executeDQResponse">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    4c98a2b0c22d11dbbd74001125bd7544
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="String" type="xsd:string" minOccurs="0" maxOccurs="unbounded">
    <xsd:annotation>
    <xsd:appinfo source="http://sap.com/xi/TextID">
    09d279c0c01011dbb867001641ad833b
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>
    Thanks

  • WHY WE USE VECTOR NOT ARRAY STRING

    Hi
    I want to know why we use Vector not bufferstring.
    What is the difference Vector(1,1) and STRING[1][1]?
    Which one we will prefer?
    Why we will prefer one of them?
    Please help me to find out.

    There are huge differences between array and Vector.
    Array is a special class that allows to keep references to a number of Objects of some type. It has a maximum length set during construction, and does not offer any methods to change it's size (without defining a new array).
    Vector is a class (thread-safe unlike it's new version ArrayList) that allows to keep references to any Object (may be of different types). It doesn't have a maximum length set, and can be potentionally of any size. It allows to easily remove, add, insert new elements and keeps all the elements in the order they were added (unless some object was inserted). This is a really well written class, and I'm always using it for storing some objects.
    Hope it was helpful.

  • Calling LabVIEW DLL from C with 2d array strings

    I am trying to write a DLL in C that calls a LabVIEW DLL that has a
    number of functions that each return a 2D array of strings which are the formatted
    measurements, with column 1 being the measurement name and column 2
    being the measurement. I wanted to use the 2D array of strings since
    this would give a uniform interface for returning measurements. Ive
    cobbled together bits and pieces of messages and example code I've
    found here into something that almost works, and was hoping someone
    with a little more experience in interfacing C with LabVIEW DLLs would
    be able to help me.
    Here's a little
    snippet from the header file generated when building the LabVIEW DLL:
    typedef struct {
    long dimSizes[2];
    LStrHandle String[1];
    } TD1;
    typedef TD1 **TD1Hdl;
    long __cdecl TestVI(char serialNumber[],  TD1Hdl *formattedMeasurements, char ErrorDescription[], long len);
    The "TestVI" VI generates a 2D array of strings. The cell contents and number of rows are random to
    simulate different measurement names and measurements.
    Here's a snippet for the wrapper class:
    class CArgoTestsLabVIEW 
    public:
    CArgoTestsLabVIEW();
    virtual ~CArgoTestsLabVIEW();
    // test modules called from parent DLL
    BOOL GetResult_LV(CString resultName, double *result);
    long TestVI_LV(CString serialNumber);
    private:
    TD1Hdl m_LVStringArray;
    CMapStringToString m_resultMap;
    InitMeasurementsArray();
    PopulateResultMap();
    The "m_LVStringArray" is intended to hold the 2D array of strings that
    the test modules spit out. The "m_resultMap" is just for accessing the
    measurements from the parent DLL via the "GetResult_LV" function.
    The implementation of TestVI_LV is:
    long CArgoTestsLabVIEW::TestVI_LV(CString serialNumber)
    long rc = 0;
    char errStr[BUFFERLEN];
    strcpy(errStr,"");
    rc = InitMeasurementsArray();
    if (rc == 0) {
    rc = TestVI(serialNumber.GetBuffer(serialNumber.GetLength()), &m_LVStringArray, errStr, BUFFERLEN);
    PopulateResultMap();
    return rc;
    The accessor functions InitMeasurementsArray and PopulateResultMap are:
    long CArgoTestsLabVIEW::InitMeasurementsArray()
    MgErr err;
    if (m_LVStringArray)
    DSDisposeHandle(m_LVStringArray);
    m_LVStringArray = (TD1Hdl)DSNewHandle(sizeof(TD1));
    // code to check for NULL
    // Set number of strings in array to 0
    (*m_LVStringArray)->dimSizes[0] = 0;
    (*m_LVStringArray)->dimSizes[1] = 0;
    // Set total size of array structure. For now it is only as big as the long variable.
    err = DSSetHandleSize((UHandle)m_LVStringArray, sizeof(long));
    // code to check for error
    return 0;
    void CArgoTestsLabVIEW::PopulateResultMap()
    int numberOfResults;
    int i;
    int charCnt;
    numberOfResults = (*m_LVStringArray)->dimSizes[0];
    if (numberOfResults == 0) {
    return;
    m_resultMap.RemoveAll();
    for (i = 0; i < numberOfResults; i++) {
    charCnt = (*((*m_LVStringArray)->String[i * 2]))->cnt;
    (*((*m_LVStringArray)->String[i * 2]))->str[charCnt] = '\0';
    charCnt = (*((*m_LVStringArray)->String[i * 2 + 1]))->cnt;
    (*((*m_LVStringArray)->String[i * 2 + 1]))->str[charCnt] = '\0';
    m_resultMap.SetAt((LPCTSTR) (*((*m_LVStringArray)->String[i * 2]))->str, (LPCTSTR) (*((*m_LVStringArray)->String[i * 2 + 1]))->str);
    The problem I have is that I eventually get an access violation from
    the run-time engine if I try to call the test VI in a loop. I'm
    obviously having a memory management problem, but it escapes me as to
    where the problem is. Anybody have any ideas?

    smercurio_fc wrote:
    The problem I have is that I eventually get an access violation from the run-time engine if I try to call the test VI in a loop. I'm obviously having a memory management problem, but it escapes me as to where the problem is. Anybody have any ideas?
    (*((*m_LVStringArray)->String[i * 2]))->str[charCnt] = '\0';
    Hi smercurio,
          Have you solved this?  I don't work with C much anymore, but it looks, here, as if the memory at str[charCnt] isn't yours to address/change.
    Is index "charCnt" one char past the end of the String-memory allocated by LabVIEW? 
    just an idea!
    Hmmm, maybe page 9 is a bit far back to fish in the unanswered posts.
    Message Edited by Dynamik on 03-03-2006 02:03 AM
    When they give imbeciles handicap-parking, I won't have so far to walk!

  • Beginner : Array , String Problems continue.

    Hi everybody I am so New in Java or rather not really able to understand Java yet.
    I have assignment where I do not know how to think anymore..is probably very easy to those who understand programming but sadly I do not.
    Program should do:
    1. assign any amount of different strings.
    2. user is giving any letter he/she wants and program to find it among given strings.
    If searched letter is in any string/ strings , only these strings or string are printed.
    3. If in given strings is not searched letter, program has to say it, for ex: there is not letter you search for.
    As long as now I have only, strings assigning to array. So there are strings in array but I do not know how to write code where I can find given letter by user.
    I just do not know how I should think(anymore at all ;)) here. I am really frustrated and desperate, how to understand this?? Once and for all!!!
    I was thinking maybe I should use ArrayList? but how...or Can it be done both ways with Array or with ArrayList?
         public static void main(String[] args) {
              Scanner scan = new Scanner(System.in);
              System.out.print("How many strings ?");
              int antal= scan.nextInt();
              String [] str = new String[antal];
               String string = null;     
              int x;
               scan.nextLine();
                 for( x=0;x<str.length;x++){
                      System.out.print("String "+(x+1)+": ");                       
                 string= scan.nextLine();
                 str[x]= string;
                System.out.print("Write a letter you wish to find :");
                String letter = scan.nextLine();
                char check = letter.charAt(0);
      //somthing in here ....

    Thank you very, very much for helping me, this is the first forum where I am getting any answers at all. Thanks guys!
    Yes, that is true I have a problem to "see" things in code..I feel " lost in translation " :)...Sometimes I think I understand code and than suddenly code does total different thing than I thought. I have to pass 2 exams of Java basic and bit advance level of Java , all seems very dark now..but I have a hope that I at least pass those exams. Of course it could be fantastic to start understand Java (or any other computer language) and be able to code one day for real. To be honest, I envy you that you can understand Java. When, all code works is so cool and fun! ok, Back to code...
    So I read your tips and advices , thanks.
    Here is another problem, with help of indexOf(char) I got index for character I searched, fine.
    The way i wrote the code I got separate answer for each string(check in code). What I need to have is, separate printed strings where given character is found and nothing else should be printed. Later, I need just one general comment ,only in case if character is NOT found in given strings.
    import java.util.*;
    public class upp9 {
         public static void main(String[] args) {
              Scanner scan = new Scanner(System.in);
              System.out.print("How many strings ?");
              int antal= scan.nextInt();
              String [] str = new String[antal];
              int x;
               scan.nextLine();
                 for( x=0;x<str.length;x++){
                      System.out.print("String "+(x+1)+": ");                       
                 str[x]= scan.nextLine();
                System.out.print("Write a letter you wish to find :");
                String letter = scan.nextLine();
                char check = letter.charAt(0);
                   for( x=0;x<str.length;x++){
                       str[x].indexOf(check);
                     //     System.out.println("String "+(x+1)+" "+str[x].indexOf(check));
                if((str[x].indexOf(check))>=0)
                     System.out.println("String "+(x+1)+" "+str[x]);
                else
                     System.out.println("Nothing in this string");
      System.out.println();
    }is printed.
    How many strings ?4
    String 1: hello
    String 2: other
    String 3: alex
    String 4: batman
    Write a letter you wish to find :a
    Nothing in this string
    Nothing in this string
    String 3 alex
    String 4 batmanI should get printed (with other code)...where I don't know how to think here? what code I should use?, what I can what I can not do here...hmmm
    //in case found
    How many strings ?4
    String 1: hello
    String 2: other
    String 3: alex
    String 4: batman
    Write a letter you wish to find :a
    String 3 alex
    String 4 batmanor....
    //in case NOT found
    How many strings ?4
    String 1: hello
    String 2: other
    String 3: alex
    String 4: batman
    Write a letter you wish to find : j
    Not found

  • How to break up a String into multiple array Strings?

    How do I break up a string into a bunch of String arrays after the line ends.
    For example,
    JTextArea area = new JTextArea();
    this is a string that i have entered in the area declared above
    now here is another sting that is in the same string/text area
    this is all being placed in one text field
    Sting input = area.getText();
    now how do I break that up into an array of strings after each line ends?

    Ok I tested it out and it works.
    So for future refrence to those that come by the same problem I had:
    To split up a string when using a textfield or textarea so that you can store seperate sections of the string based on sperate lines, using the following code:
    String text = area.getText() ;
    String[] lines = text.split("\n") ;
    This will store the following
    this is all one
    entered string
    into two arrays
    Cheers{
    Edited by: watwatacrazy on Oct 21, 2008 11:06 AM
    Edited by: watwatacrazy on Oct 21, 2008 11:16 AM
    Edited by: watwatacrazy on Oct 21, 2008 11:16 AM

  • Converting String Array -- String

    Hi All,
    I am converting String array to string using the following code:
    String[] a= ....;
    StringBuffer result = new StringBuffer();
    if (a.length > 0) {
    result.append(a[0]);
    for (int i=1; i<a.length; i++) {
    result.append(a);
    return result.toString();
    Is there is any other easy or efficient way to convert rather than the above code ?
    Thanks,
    J.Kathir

    It could have been written:
    StringBuffer result = new StringBuffer();
    for(int i=0; i<a.length; ++ i)
        result.append(a);
    return result.toString();
    Or in 1.5 lingo
    StringBuilder result = new StringBuilder(); //slightly less overhead
    for(String s : a)
        result.append(s);
    return result.toString();If you aren't picky about the format of the resulting string,
    you could use the java.utilArrays method )]toString(Object[]):
    String[] array= {"Hello", "World", "this", "is", "a", "1.5", "method"};
    String s = Arrays.toString(array); //[Hello, World, this, is, a, 1.5, method]

  • Custom tag setting a parameter as an array String[]

    I would like to pass a number of bind variable as an array of strings to a custom tag.
    So far I can pass an array to the tag in the following way:
    <%
    String[] bindv = {"1000","01010","EMP"};
    pageContext.setAttribute("bindv",bindv);
    %>
    <jm:q2b bind="${bindv}"/>Is there a way to do this without using the scriptlet ?

    The parameters are bind variable and usually are set from the http requestThe fact that they're bind variables doesn't make any difference. If they're passed in the request you can access them using jstl. You just need to do requestScope.bindv (replace bindv with the variable(s) name).
    If you're using an array you must know how many variables are passed, so it's easy. If you don't know just put the variables in an array (or something similar) before you put them in the request and use the forEach tag.

  • Replace 1D array string in 2D array string unknowning index

    I have 3 contols (Case A, Case B and Case C) and one array that shows only one time the status of the controls (TRUE or FALSE) and the message ([F?][0?.01][hh:mm:ss][nº message]). The example works if switch on one control and switch off the same control the next time. But if swicth on the control again, appears 2 status in the array: that last and the status when I switch off.
    The objective is show only 3 rows, everu row for one different control.
    Can you help me, please?
    Thank you.
    Win XP / LV 7.1
    Attachments:
    monitoring.vi ‏111 KB

    Hello Vicens,
    I think that what you want it's simple. But I've a problem. My current version o labview (8.2) doesn't allow me to save into your version. So I can't send you the changed .vi. But in attach i'm sending pictures of it. I hope it could help you.
    Changed:
     - Replace the insert array vi to replace vi (case true). In case A connect a constant row 0, Case B constant 1, case C constante 2
     - Don´t change the array value in case false
     - initialize the array 3 by 4 with a space
    Best regards
    Software developer
    www.mcm-electronics.com
    PS: Don't forget to rate a good anwser ; )
    Currently using Labview 2011
    PORTUGAL
    Attachments:
    control panel.zip ‏280 KB

  • The call library function require us to define the type of parameter that w are using.The type of parameter in cludes numeric, array, string,wav​eform and adapt to type.I would like to know more about waveform and adapt to type.

    In the labview manual, there is very little mention about the use of waveform.How is this waveform being called and can i have an example to see how this work.
    Also in the adapt to type paramete, what does this parameter do and in what circumstances do we need to use it.The manual say something about the use of this parametr.It says that scalar elements in arrays or clusters are in line.For example a cluster containing anumeric is passed as pointer to a structure containing a numeric. What does this statement mean?
    Can i imply t
    hat if my input is a struct, can i use a adapt to type parameter to overcome this incompatibility?Can i also have an example to let me have a better idea.thank you

    I'm going to share my experience with the "Adapt to Type" parameter.
    Attached to this message is an example. The attachment is a zip file with three files: a dll, a c file and a vi written in LabVIEW 6. The dll contains a function that return a structure with 3 values (like the coordinates of a point in space, that is, (x, y, z)). You can see how the function was constructed by looking at the c file.
    In LabVIEW, I created a cluster with the same three parameters. Then, I configured the call library function following the function prototype as in the c file. For the point variable I use "Adapt to Type".
    I hope this can give you a head star.
    Best regards;
    E. Vargas
    www.vartortech.com
    Attachments:
    pointexample.zip ‏63 KB

  • How to pass Array String to callable statement

    How can I pass an array variable to the callable statement as an out parameter and how to define that in the pl/sql procedure.
    Thanks,
    HC

    HC
    If you would refer to the link given by Anil, You can make out that there in input as well as in output it is passing an array of records.
    CallableStatement cs = conn.prepareCall("{call XX_PassTableType.XX_PassTableType_prc(:1, :2)}"); 
    ARRAY array = new ARRAY(new ArrayDescriptor("APPS.JTF_NUMBER_TABLE", conn), conn, vNumber); 
    ARRAY array1 = new ARRAY(new ArrayDescriptor("APPS.JTF_VARCHAR2_TABLE_100", conn), conn, as); 
    cs.setArray(1, array); 
    cs.setArray(2, array1); 
    cs.registerOutParameter(2, 2003, "JTF_VARCHAR2_TABLE_100");In above lines 1 is the input parameter that is an array of number while 2 is an array of varchar.
    Thanks
    AJ

  • Read very very large excel file into 2d array (strings or varient)

    Hi all,
    Long time user, first time poster on these boards.
    Looking at the copius amounts of great info related to reading Excel data from .xls files into labview, i've found that every one i've found from various people use the ActiveX method (WorkSheet.Range) which two strings are passed, namely excel's LetterNumber format to specify start and end.
    However, this function does not work when trying to query huge amounts of information. The error returned is "Type Mismatch, -2147352571" I have a very large excel sheet i need to read data from and then close the excel file (original file remains unchanged). However this file is gigantic (don't ask me, I didn't make it and I can't convince them to use something more appropriate) with over 165 columns at 1000 rows of data.I can read a large number of columns, but only a handful of rows, or vice versa.
    Aside from creating a loop to open and close the excel file over and
    over reading pieces of it at a time, is there a better way to read more
    data using ActiveX? Attached is code uploaded by others (with very minor modification) as an example.
    Thanks,
    Attachments:
    Excel Get Data Specified Field (1-46col).vi ‏23 KB

    Hi Maddox731,
    I've only had a very quick glance through your thread, and I must admit I haven't really thought it through properly yet. Sounds like you've come up with your own solution anyway. That said I thought I'd take a bit of a scatter gun approach and attach some stuff for you regradless. Please forgive my bluntness.
    You'll find my ActiveX Excel worksheet reader, which may or may not contain the problem you've come across. I've never tried it with the data size you are dealing with, so no promises. I've also attached my ADO/SQL approach to the problem. This was something I moved onto when I realised the limitations of AX. One thing I have noticed is that ADO/SQL is much faster than AX, so there may be some gains for you there with large data sets if you can implement it.
    I should add that I'm a novice to all this and my efforts are down to bits I've gleamed from MSDN and others' LV examples. I hope it's of some use, if only to spark discussion. Your ctiticism is more than welcome, good or bad.
    Regards.
    Attachments:
    Database Table Reading Stuff.zip ‏119 KB

Maybe you are looking for

  • Memory leak in AudioServicesCreateSystemSoundID with sound files

    hi ! Instruments indicates a 64Ko memory leak in "AudioServicesCreateSystemSoundID" when I use a sound that I have created with GBand / iTunes. When I use the sound file "tap.aif" from the "sysSound" sample, there is no memory leak. What's wrong with

  • Moving music from Windows Media Player to iTunes

    Hi Apologies if this is repeating what others have asked many times in the past - I know what these forums can get like sometimes! I have had a look around though and couldn't find a definitive answer, so... I have to date put all my music in Windows

  • Bean deployment

    Could any one help us regarding the connection pooling in jsp and also how to deploy a bean in jsp using javawebserver

  • Wire Payment Format Problem when payed through invoice screen

    Hi, I created a new payment format for wires and when I use this payment format throgh payment batches screen and select invoices and do formatting it works fine. But, If I create a invoice and select Actions -> Pay in full then give this bank accoun

  • Can't open pages. Does anyone have an answer?

    I can't open pages... I recently updated to OS X Lion. Does it have something to do w/that.