Array objects crushed

I have a function that creates custom objects and grows in a table.
Problem is that during the loop, all objects in the array are replaced. Obviously, it's some sort of error of mutability, but I really don't see how I can solve this problem!

function myFunc(layers){


    // Create objects of all layers
    var myNodes = [];
    for (var i in layers){
        activeDocument.activeLayer = layers[i];
        var myNode = MyNodeObj(layers[i]);
        alert("created node - pushing to myNodes-list. lyrName is: " + myNode.lyrName);


        // Works until this point
        myNodes.push(myNode);
    }
    for (var i in myNodes){
        alert("test " + myNodes[i].lyrName);
    }

I send diapers to the function and it passes through them, the creation of objects through MyNodeObj (using a class constructor). When the alert appears, I see that myNode.lyrName is different - the name of the active layer. However, once this item is pushed into the picture-myNodes it will overwrite all the objects inside.

So for three layers (known as "Object1", "object2" and 'object3') table will look like this for the first entry:
["Object1"]

then

["object2", "object2"]

and finally

["object3', 'object3',"object3"]

What happens here?

EDIT: OK, so the objects are pushed to arrays as references - but for the numbers, they are pushed as a copy.
Whatever it is, I tried to "disconnect" the old object reference by declaring myNode as an empty object initially and then by creating my object:
var monnoeud = {};

myNode = MyNodeObj (layers [i]);

EDIT2:
The underside does not either - if how it is supposed to fill a table with several objects generated?

function myFunc(layers){


    // Create objects of all layers
    var myNodes = [];
    for (var i in layers){
        activeDocument.activeLayer = layers[i];
        myNodes.push( MyNodeObj(layers[i]) ); // Also doesn't work
        // Also tried this: myNodes[i] = MyNodeObj(layers[i]);
    }
    for (var i in myNodes){
        alert("test " + myNodes[i].lyrName);
    }

MyNodeObj looks like:

function MyNodeObj(layer){


    this.height = layer.bounds[3].value - layer.bounds[1].value;
    this.width = layer.bounds[2].value - layer.bounds[0].value;
    this.lyrName = layer.name;


    return this;
}

"I think that you missed the ' new 'in the line '.

var monnoeud = new MyNodeObj (layers [i]);

Tags: Photoshop

Similar Questions

  • Filtering of unwanted virtual machines of an Array object

    I have an array object named $report

    $report has a list of virtual machines.  Each virtual machine has a large selection of native and custom properties.  These virtual machines come from 'vcenter1', 'vCenter2' or 'vcenter-old. "  vC

    However, there are a few VMs in $report that need to be purged, based on the following critierion.

    1. If the virtual machines in the vCenter named 'vcenter-old' AND that they are turned off, they must be removed from the $report variable.

    OR

    2. If the virtual machines have been removed from vcenter "older" in the last month, based on the event logs showing vCenter VMname having been removed and is no longer available in the vCenter, they must be removed from the $report variable.

    How I could accomplish this or I could?

    Get all the events for the interval, and then filter the $_ (with a Where clause). UMM Name property

  • Charger property - number of one-dimensional array objects read

    Greetings and happy independence day.

    I use the property Loader to load a local array of containers. I use a ForEach statement to iterate through the array for the number of items varies with the type of the object to measure.

    But now, I need to know how many items is in the table before starting this treatment. I could scratch a local variable and pass through a preliminary ForEach to browse it upward. Is it a better or easier way to do this?

    Thank you

    JVH

    GetNumElements (Locals.MyLocal)

    BTW, you can see which expression functions are available by clicking on the button f (x) on any field of expression. Then go to the operator/functions tab.

  • Selection of one-dimensional Array objects in a hash table

    Suppose I have a hash table with a list of names of virtual machine.  I also have a variable array containing objects of virtual machine and all of their properties.  I want to scroll the array variable and delete all virtual machine names that do not exist in the hash table.  How do I would accomplish this?

    Thank you

    If your table is called $inArray and your hash table is called $hashTab, you could do something like that

    $outArray = $inArray | %{

    If ($hashTab.ContainsKey ($_.)) VMName)) {}

    $_

    }

    }

    The selected objects will be $outArray table.

  • means of a loop with associative arrays / objects: #1034: forced conversion

    I had a long post somewhere on here and just want to start a specific post on associative arrays just.

    First of all, I have a table which I do not know if it is an array, an associative array or an object, or both.

    That is to say: I read that below would be an object but works like a table also.

    The problem is when I use this table as references to instantiate classes in a runtime shared library.

    I seem to be able to create appropriate tables and objects, BUT I certainly can't use/acess them correctly. I have a massive confusion between movieclips and objects.

    I get an error of forced conversion when I try to add objects to a movieclip. just because I want to add the elements of mc to the scene.

    var definitionsArray:Array; 
    var bubblesArray:Array;
    var currentBubble:*;
    var correct:uint;
    var incorrect:uint;



    this.definitionsArray = new Array();
    this.definitionsArray.push({ sound:"AppleSound",mc:"Apple" });
    this.definitionsArray.push({ sound:"BananaSound",mc:"Banana" });
    this.definitionsArray.push({ sound:"BreadSound",mc:"Bread" });
    this.definitionsArray.push({ sound:"CakeSound",mc:"Cake"  });
    this.definitionsArray.push({ sound:"WaterSound",mc:"Water" });
    this.definitionsArray.push({ sound:"TomatoSound", mc:"Tomato" });
    this.definitionsArray.push({ sound:"SandwichSound",mc:"Sandwich" });
    this.definitionsArray.push({ sound:"PizzaSound",mc:"Pizza" });
    this.definitionsArray.push({ sound:"PearSound",mc:"Pear" });
    this.definitionsArray.push({ sound:"OrangeSound",mc:"Orange" });

    getData("library/food.swf", definitionsArray);

    function getData(libreria:String, matriz:Array)
    {
        this.definitionsArray = matriz;
        var context:LoaderContext = new LoaderContext(false,ApplicationDomain.currentDomain);

        var loader:Loader = new Loader();
        var req:URLRequest = new URLRequest(libreria);

        loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onAssetsLoaded);
        try
        {
            loader.load(req);
        }
        catch (e:Error)
        {
            trace("Asset load error: " + e);
        }
    }



    function onAssetsLoaded(e:Event):void
    {
        this.cartelArray = new Array();
        var loader:Loader = Loader(e.target.loader);

        this.libreria = loader.content;//this isn't used

        //var mezclaMAtriz:Array = this.definitionsArray.slice();
        bubblesArray = [];
        for (var i:uint = 0; i < this.definitionsArray.length; i++)
        {
            var libraryDomain:ApplicationDomain = loader.contentLoaderInfo.applicationDomain;
            var mcClass:Class = libraryDomain.getDefinition(definitionsArray[i].mc) as Class;
            var soundClass:Class = libraryDomain.getDefinition(definitionsArray[i].sound) as Class;

            var obj:Object = new Object();
            obj.mc = new mcClass();
            obj.sound = new soundClass();

            this.bubblesArray.push(obj);
            placeBubbles();
        }
    }

    function placeBubbles():void
    {
        var bubble:MovieClip;
        for (var i:int = 0; i < bubblesArray.length; i++)
        {
            bubble = bubblesArray[i];
            bubble.addEventListener(MouseEvent.CLICK, onBubbleClick);
            bubble.x = 100 + i * 150;
            bubble.y = 100;
            addChild(bubble);
        }
        // start game
        nextChoice();
    }

    If you set as an object, and then use this way...

    bubble var: Object;

  • Pull dynamically array objects

    Hello, I'm doing a basic model of a graphical Portal as a proof of Concept, and I'm stuck at getting the correct array element.
    I have a choice of areas, broken out by remaining weeks to the event:
    {WeeksTo: '54', budget2003North: "6235", actual2003North: "4001", budget2003West: '6525', actual2003West: "4799", budget2003South: '6670', actual2003South: eventTotal "4847,": "5565"}, repeat this for several years.

    What I want to do is visualize the different years in a line chart and then fill a pie as an exploration. The graph each element as name = "event2006", name = "event2007", etc.. The problem I have is that I can tell the hitData.element.name what year was clicked on, but I can't break through the data dynamically. For example, if you clicked on a line of 2007, I have

    var year: String = e.hitData.element.name.substr (5);

    var pieDataCenter:ArrayCollection = new ArrayCollection ([] collection
    {Product: "Real" Total: "e.hitData.item.actual" + year + "Center"},
    {Product: 'Budget', Total: 'e.hitData.item.budget' + year + 'Center'},
    ]);

    It's to try to get {product: "Real", in Total: e.hitData.item.actual2007Center},
    I used the API of D.eval library () and could not get that to work and I (and colleagues) have not found what I was looking for in the books we have and online.

    Is it possible to access variables or array items this way in Flex? I know that my approach is probably wrong, but as a CEP to examine the feasibility of using Flex in the future, I am interested to know if this can be done anyway.
    The application we have is ColdFusion and we look at re-writing of our application by using a Flex front-end. As we are from a ColdFusion background, we are accustomed to pulling pages dynamically without knowing what data to rely on. My understanding of Flex is that the Committee must be stretched in advance, you can't use ActionScript to loop effectively and build panels according to the needs (for example, for a report showing the stands, at a venue might have just the North and the South, where another perhaps more). Is this something I have good or I'm not grasp the concepts correctly?

    Thanks in advance for your time,

    Mike.

    If you have an ArrayCollection of objects that you are graphics collection. Try to access your properties of the object with the notation of support like this:

    {Product: 'Real' Total: e.hitData.item ['actual' + year + 'Center']},

    In regard to panels to be stretched in advance, I think that it is a mistake. You can use ActionScript to dynamically create any container, including panels. It is quite easy to create containers after the events of the time of execution. Here is a simple function to add a panel:

    private function addPanel (): void {}
    var newPanel:Panel = new Panel();
    newPanel.width = 200;
    newPanel.height = 100;
    newPanel.title = "new Panel";
    someContainerToAddTo.addChild (newPanel);
    }

    Vygo

  • How to add listbox form in string array objects

    Hello

    I need help related to listbox

    1. currently, I am able to select and implement string in array

    Prob is

    ex.

    When I select the point 1 and 1 point will be created on arrayString but when I select article 2 and article 3 then arrary string poster article 2 and article 3 and article 1 is deleted.

    So please let me know how to add, add and delet listbox to string in array.

    2. how popup listbox and allow the user to add, delet or add the items in the listbox control and the transfer to the string table

    I have my code atatched. Please help me.

    Thank you

    Clement

    Sorry, try this:

  • How to add elements to an array without crushing it?

    probably is can a repeated question, anyone tell how to add a new element to a table at the following location without deleting the other?

    Use the table construction and the old array of the wire to the first position and the new value to the next position. This will add while leaving the old array as it is.

  • Properties of the output array object

    I worked on a simple script to pull machine virtual hard disk and the number of unique a VM vm/mutiple SCSI

    But the output returned as an object + properties for EACH disc, what I want is a table without titles, or each vm as the object and HardDiskName, ScsiId, SizeGB, RawDeviceId, path as properties.

    Any ideas?

    for example

    >.\Get-VmHdScsi.ps1 - VM vm1

    Path of the RawDeviceId SizeGB HardDiskName ScsiId VMName

    ------     ------------ ------ ------ ----------- ----

    VM1 disc 1 0: vm1/vm1.vmdk 0 36 [datastore]

    Path of the RawDeviceId SizeGB HardDiskName ScsiId VMName

    ------     ------------ ------ ------ ----------- ----

    VM1 disc 2 0:1 8 [datastore] vm1/vm1._1.vmdk

    Path of the RawDeviceId SizeGB HardDiskName ScsiId VMName

    ------     ------------ ------ ------ ----------- ----

    VM1 Disc 3 0: vm1/vm1._2.vmdk 2 26 [datastore]

    <#
    .Acknowledgment
        vNugglets http://www.vnugglets.com/2013/12/get-vm-disks-and-rdms-via-powercli.html
          
        .Example
        Get-VmHardDiskScsiId -vmName <vm>
      
        . Notes
        I have removed code that collects multiple vms
    #>
    
    # Set variables
    [CmdletBinding()]
    param (
    [string]$vm = " "
    )
    
    ## Use get-view to collect the VM object(s)
    $VmView = Get-View -Viewtype VirtualMachine -Property Name, Config.Hardware.Device, Runtime.Host -Filter @{"Name" = "$vm"}
    if (($VmView | Measure-Object).Count -eq 0) {Write-Warning "No VirtualMachine objects found matching name pattern '$vm'"; exit}
    
        $VmView | %{
            $viewVmDisk = $_
            ## get the view of the host on which the VM currently resides
            $VmView = Get-View -Id  $viewVmDisk.Runtime.Host -Property Config.StorageDevice.ScsiLun
    
            $viewVmDisk.Config.Hardware.Device | ?{$_ -is [VMware.Vim.VirtualDisk]} | %{
                $HardDisk = $_
                $ScsiLun = $VmView.Config.StorageDevice.ScsiLun | ?{$_.UUID -eq $HardDisk.Backing.LunUuid}
              
                ## the properties to return in new object
                $VmProperties = @{
                    VMName = $viewVmDisk.Name
                    HardDiskName = $HardDisk.DeviceInfo.Label
                    ## get device's SCSI controller and Unit numbers (1:0, 1:3, etc)
                    ScsiId = &{$strScsiDevice = $_.ControllerKey.ToString(); "{0}`:{1}" -f $strScsiDevice[$strScsiDevice.Length - 1], $_.Unitnumber}
                    #DeviceDisplayName = $oScsiLun.DisplayName
                    SizeGB = [Math]::Round($_.CapacityInKB / 1MB, 0)
                    RawDeviceId = $ScsiLun.CanonicalName
                    Path = $HardDisk.Backing.Filename
                }
              
                ## Select items for output
                $arrPropertiesToSelect = "VMName,HardDiskName,ScsiId,SizeGB,RawDeviceId,Path".Split(",")
                New-Object -Type PSObject -Property $VmProperties | Select $arrPropertiesToSelect | ft -a         
            }
    }
    
    
    
    
    
    

    This is because you do your Select-Object and Format-Table inside the ForEach loop.

    Move those out of the loop.

    Note that you must use the call operator (and), as the ForEach loop put anything in the pipeline.

    $VmView = get-View - Viewtype VirtualMachine-property name, Config.Hardware.Device, Runtime.Host - filter @{"Name" = "$vm"}

    If (($VmView |)) Measure - Object). Count - eq 0) {Write-Warning 'no found VirtualMachine object matching name model '$vm' '; exit}

    $arrPropertiesToSelect = "VMName, ScsiId, HardDiskName, SizeGB, RawDeviceId, path. Split(",")

    & {$VmView | %{}

    $viewVmDisk = $_

    # get the view of the host on which the virtual machine is currently

    $VmView = get-view-Id $viewVmDisk.Runtime.Host - Config.StorageDevice.ScsiLun property

    $viewVmDisk.Config.Hardware.Device |? {$_-is [VMware.Vim.VirtualDisk]} | %{

    $HardDisk = $_

    $ScsiLun = $VmView.Config.StorageDevice.ScsiLun |? {$_. {UUID eq - $HardDisk.Backing.LunUuid}

    # to return to the new object properties

    $VmProperties = @ {}

    VMName = $viewVmDisk.Name

    HardDiskName = $HardDisk.DeviceInfo.Label

    # get the device SCSI controller and unit numbers (1:0, 1:3, etc.)

    ScsiId = & {$strScsiDevice = $_.} ControllerKey.ToString (); "{0}" ': {1} "$strScsiDevice [$strScsiDevice.Length f - 1], $_." Unitnumber}

    #DeviceDisplayName = $oScsiLun.DisplayName

    SizeGB = [Math]: tour ($_.) CapacityInKB / 1 MB, 0)

    RawDeviceId = $ScsiLun.CanonicalName

    Path = $HardDisk.Backing.Filename

    }

    New-Object PSObject-property $VmProperties Type

    }

    }} | Select $arrPropertiesToSelect. FT - one

  • Problems associative Array (Object)

    Here's the function that I face
    I read in a delimited string and using indexed arrays to break them up and assign keys and values to an associative array in a loop.
    I use variables in the loop and the load as expected in the loop table
    but outside the loop, the only key is the name of the variable and the value is not set
    This is the case by using dot or rating table, as well as literal strings for keys
    any help is appreciated

    watchSuspendData = function (id, oldval, newval): String {}
    the incoming suspendData string is delimited by a semicolon;
    newVal is: firstValue = Yes; captivateKey = 1
    var listSuspendData:Array = newval.split(";"); convert to a list of key/value pairs
    If (listSuspendData.length > 0) {}
    line 123: listSuspendData.length is: 2
    for (i = 0; i < listSuspendData.length; i ++) {//for each key/value pair}
    var keyValArray:Array = new Array();
    var myNameValue:String = listSuspendData ;
    line 127: listSuspendData
    is: firstValue = Yes
    keyValArray = myNameValue.split ("="); EM on the equal sign
    var myKey:String = keyValArray [0];
    var myVal:String = keyValArray [1];
    keyValArray [0] is: firstValue
    keyValArray [1] is: Yes
    store the key and the value in an associative array
    suspendDataArray.myKey = myVal;
    trace ("line 134: suspendDataArray is:" + suspendDataArray.myKey);
    trace is line 134: suspendDataArray is: Yes on the first pass and 1 on the second

    }
    the loop below always returns an array key: myKey and the undefined value
    for (x in suspendDataArray) {}
    trace ("x is:" + x); x is: myKey
    trace ("the val is:" + suspendDataArray.x); the val is: undefined
    } //end for

    }
    return newval;

    Many thanks to blemmo and everyone who responded
    using the table syntax OK solved the problem
    really appreciate the help!

  • What is the limitation of the number of elements in the one-dimensional array objects?

    I checked the PDF 1.6 reference and have not found the prescription of a table specification?

    There is no limit to PDF versions > 1.4.

  • Place an array of objects on stage

    I'm trying to place an array of objects to a scene where they fall vertically. I was able to do by placing the array objects in an object called 'bag' but have found that the object of the bag contains the object id last table I can not apply actions various one-dimensional array objects.

    Also my objects don't loop and appear only once.

    Here's the code to date.

    var tempArray:Array = new Array(); Values of randomized stores

    var bagArray:Array = new Array ("gslow_id", "gshigh_id", "glow_id", "ghigh_id", "gdiv_id",

    'gcall_id', 'gbust_id', 'gbull_id', 'gboom_id', 'gbear_id'); List of names of bag

    function createBags() {}

    if (tempArray.length == 0) {/ / check if the table is empty}

    for (var i: Number = 0; i < target; i ++) {/ / loop - creat variable bagName to the value of the target}

    var bagName: String = bagArray [i];

    var depthLevel:Number = this.getNextHighestDepth ();

    / / movies, set in the time line

    this.attachMovie (bagName, bagName, depthLevel, {_x:random (350) + 100, _y:random (0) + spacing});

    += 45 spacing;

    tempArray.push (bagName);

    / / trace (tempArray);

    bag = _root [bagName]; create an object of the bag containing the variable bagName

    trace (bag);

    bag.onEnterFrame = function() {}

    If (this ._x < 570 & & this ._y > 0) {}

    this ._y += speed * random (8);

              } else {

    this ._x = random (500);

    } / / end if (this ._x < 570 & & this ._y > 0)

    } / / end bag.onEnterFrame)

    bag.onPress = function() {}

    / / if the bag is pressed selection action

    //trace (bag);

    xPos = this ._x

    yPos = this ._y

    unloadMovie (this);

    score += 1000

    scoreText_txt.text = score;

    / / trace (score);

    checkScore();

    { } / / end bag.onPress)

    / / trace (targets);

    / / trace (bagName);

    { } / / end for (var i: Number = 0; i < target; i ++)

    { } / / end if (tempArray.length == 0)

    } / / End createBags()

    Try:

    var bagA:Array = [];

    var bagArray:Array = new Array ("gslow_id", "gshigh_id", "glow_id", "ghigh_id", "gdiv_id",

    'gcall_id', 'gbust_id', 'gbull_id', 'gboom_id', 'gbear_id'); List of names of bag

    function createBags() {}

    If (tempArray.length == 0) {/ / check if the table is empty}

    for (var i: Number = 0; i< targets;="" i++)="" {="" for="" loop="" -="" creat="" variable="" bagname="" to="" the="" value="" of="">

    var bagName: String = bagArray [i];

    var depthLevel:Number = this.getNextHighestDepth ();

    tie movies to the time line

    bag of the var: MovieClip = this.attachMovie (bagName, bagName, depthLevel, {_x:random (350) + 100, _y:random (0) + spacing});

    bagA.push (bag);

    spacing = 45;

    trace (bag);

    bag.onEnterFrame = function() {}

    If (this ._x < 570="" &&="" this._y=""> 0) {}

    This speed of += ._y * random (8);

    } else {}

    This ._x = random (500);

    } / / end if (this ._x < 570="" &&="" this._y=""> 0)

    } / / end bag.onEnterFrame)

    bag.onPress = function() {}

    If the bag is pressed selection action

    trace (bag);

    PosX = this ._x

    yPos = this ._y

    unloadMovie (this);

    score += 1000

    scoreText_txt.text = result;

    trace (score);

    checkScore();

    } / / end bag.onPress)

    trace (targets);

    trace (bagName);

    } / / end for (var i: Number = 0; i< targets;="">

    } / / end if (tempArray.length == 0)

    } / / End createBags()

  • Hit testing objects in the table problem

    Hey guys, thank you very much in advance for any comments.  These forums are a great help.

    I have a serious problem with a loop in a table. I'm trying to hitTestObject each MC in a table against all other MC in this table.   That part works.

    The problem is that in my statement of hitTestObject, so obviously examines only 2 items at a time.  When touch 2 MC, I put a property called 'Touch' to true.  The problem is they are moving MCs and at one point touching only 2 / 3.  What is happening is:

    The loop runs once as the test Array [0] and table [1].  Say that those who are affected.  She sets their properties 'Touch' true (it's what I want).  THEN it works again test Array [1] and table [2] and finds that they are NOT overlapping.  It this process it defines two of their properties 'Touch' to false, EVEN IF one of them may overlap a different array object.

    I want to individual, set the property to "Touch" for each object in the table.  Currently, these properties are getting crushed even if 2 / 3 objects are superimposed in fact.

    That makes sense?  Essentially the "else" statement is too often called because certain combinations of array objects are not touch, but others are.

    -----------------------CODE BELOW-----------------------

    stage.addEventListener (Event.ENTER_FRAME, hitTestBalls);

    function hitTestBalls(e:Event) {}

    for (var m1:int = 0; m1 < MonsterArray.length; m1 ++) {}

    for (var m2:int = m1 + 1; m2 < MonsterArray.length; m2 ++) {}

    {if (MonsterArray [M1] .hitTestObject (MonsterArray [m2]))}

    MonsterArray [m2]. Touch = true;

    MonsterArray [m1]. Touch = true;

    trace (MonsterArray [m1]. The touching, MonsterArray [m2]. Touch);

    trace (M1, m2);

    break?

    } else {}

    trace (M1, m2);

    trace ("NotTouching");

    MonsterArray [m1]. Touch = false; MonsterArray [m2]. Touch = false;

    }

    }

    }

    While waiting for a response, here's something to consider.  You don't want to affect the Touching false at any time after that you start the analysis, only front...

    function hitTestBalls(e:Event) {}

    first put all wrong

    for (var m0:int = 0; m0< monsterarray.length;="">

    MonsterArray [m0]. Touch = false;

    }

    now test for overlapping - this way you don't overwrite anything with fake

    for (var m1:int = 0; m1< monsterarray.length;="">

    for (var m2:int = m1 + 1; m2)< monsterarray.length;="" m2++)="">

    {if (MonsterArray [M1] .hitTestObject (MonsterArray [m2]))}

    MonsterArray [m2]. Touch = true;

    MonsterArray [m1]. Touch = true;

    }

    }

    }

    }

    And if there be oinky be a pair that overlap as you say, you can add a breakdown; orders to end a loop when a hit is detected.

  • Dotnet system.array, method

    Hello Council

    I'm stuck by calling a dotnet assembly in LabVIEW. The final step is to pass a system.array into a method to have the result of calling the method listed in this table. I don't really understand how to do this.

    Help is greatly appreciated.

    The details are in the attached example of the LV2011.

    Thank you

    Dermot

    Your LabVIEW code is supposed to match the c# code in the comments above it?

    Instead of reading the file as a text file, read in a binary file and define the type of data entry in a table of the appropriate numeric type. When you play the file as a text file, it can convert the end-of-line character for you, which can cause corrupt data. In addition, it will be more efficient memory because ignore you the unnecessary conversion of an entire string.

    I understand exactly where your problem is the code is not more clear, and this link could help show how to convert an array of LabVIEW in a .NET table: http://forums.ni.com/t5/LabVIEW/How-to-pass-a-Labview-array-into-a-C-NET-array-object/m-p/1992795#M6...

  • Synchronize the object

    I'll put up to wait/Notify between to separate the tasks running (COD-separate files), so I need a known object

    for both parties. I've been using a persistent as a synchronization object storage, but this seems a bit of a "drug overdose".

    I will use the Runtime storage to provide data in the form of an array of strings. I can't use duration of storage under the synchronization object. It seems not valid to use the array object because I have to then get everything first table.

    So, what is the purpose of "system-wide" more simple that I can use?

    Published:

    Oops.  The question really is what object to use for the wait/Notify.

    This will work.

    However, I actually use a slightly different interpretation.

    To explain this in simple terms, suppose you implement a queue of client server, if you need features to add to the queue (which will awaken the server wait) and remove it from the queue.  In RuntimeStore is an object that has exposed methods add() and remove().  The client found this object and call the add() method whenever it needs.  The server detects this object and calls Delete to get the last of them.  The blocks to remove, but the server does not need to know this.

    This one that object maintains a collection of object that is synchronized and the wait/notify object that manages internal wake up.  The client code and server didn't need to know anything on this subject.

    And you have only a single identifier.

    I don't know there are many others, probably better designed, approaches to do this.  Take a look at the Client/server model (I'm sure will be there).  But you get the idea, I hope.

Maybe you are looking for