Variable problem

I try to add a number at the end of a variable to use in a loop for I imported a csv with Import-Csv file into a variable called $csvImport that contains 8 items referenced as csvImport.disk1, csvImport.disk2 and so on up to disk8.

I'm trying to increment the number at the end of the disc, so that I don't have to use 8 if statements. Here is my code:

for ($i = 1; $i - lt 9; $i ++)

{

If ($csvImport.disk "$i" - not "" ")

{

do things

}

}

The code is wrong, but I'm looking for some advice on how I can achieve with $csvImport.disk "$i" $csvImport.disk1, $csvImport.disk2 and so on in the loop back. ' "

Try something like this

for ($i = 1; $i - lt 9; $i ++)

{

If ($csvImport. ("' Disk$ ($i) '-not '")

{

do things

}

}

Tags: VMware

Similar Questions

  • Shared variable problem reading after deployment

    Hello

    I tried to create an OPC client to communicate with a server KUKA. I have a project with an i/o library configuration server. When I run the project, I can perfectly read/write my variables using the Distributed System Manager. If I put all the variables, I can read the correctly updated value at the server end. However, as soon as I start a VI that contains variables (which deploys them automatically), everything stops working and I can not write them to the VI or the DSM.

    I would be very happy if anyone knows how I could handle it.

    Best,

    Glauber

    OK, so it seems that the problem was that the request from the client to the server rate was too high. I added a wait on the loop that r/w, the variables and now this works. There is no need to be a single writer, and the autodeploy option can be.

    in any case, thanks to those who responded to the message.

  • Shared variables problem

    Hello

    I'm using LabVIEW 8.5.I uses about 80 variables shared in my project using Datasocket also to write on the network

    wanted to know if I face any problem while doing the exe? What I have to follow a special procedure to generate exe?

    Help, please...

    Thank you

    GAK

    Hello

    Thanks for help.will certainly work on that.

    GAK

  • Global variable problem using as reference file

    Hi all

    This code is trivial, but illustrates the problem that I have.  I want to open a file with vi a, dynamically open vi B, pass the reference file in vi B, vi B to close, and then close the fiel with A vi.  VI B is designed for SAMPLES continuously and add it to the file.  Unfortunately I can't implement this solution because it seems that global variables do not work for the file references (!).  Thank you!

    You have a race condition in this image.  The global variable refnum to could be read the file write before the opened file has been fortunate to write a valid file for the other reference copy refnum of global variable.  You should have a thread open to write it directly.  If you want to store it in the global variable as well, then branching off there this direct wiring.

  • variable problem in odi

    Hi little problem... I keep a variable. so whenever the mapping fails, then set this variable on there or well n. How can you do with variable?

    1. you can use evaluate the variable

    initially set, then handed it

    2 use the refresh like query:

    Select case when #HYP. Var1 = 1 then... else... end

  • Simple variable problem

    It is a really simple problem and I'll probably be a little dim but as I do not code things very often simple things tends to leave my brain.

    Summed up quite simply I have an if statement which, instead of using the current value of a variable appears to be implemented.

    More detailed description:

    I have 2 symbols, 'Olive', which is a three marked positions timeline animation, ' open, 'enabled' and 'closed' who defined the value of the variable 'positionO' as a result. I tested this little with alerts and is very well.

    When I mouse over the second symbol I want to retrieve the variable and play different parts of the animation depending on its value, well?

    I have this piece of code on the mouseover element:

    var myVariable = sym.getComposition().getStage().getSymbol("Olive").getVariable("positionO");
    if (positionO = 'open'){
    alert (positionO);
    }
    

    Now to me, this should trigger the alert if the variable is set to 'open' and do nothing if the value is something else, but what he is doing is setting the variable 'open' and shooting alert anyway.

    Thanks in advance,

    Alex.

    Try this (equal) 2 for comparison:

    if (positionO is 'open') {alert (positionO) ;}

  • JSON/Jquery Variable problem

    I have a problem in the construction of a yardsale using jquery google map card, while providing some time via a Json call yahoo weather.

    I put markers of card via a call from Json to addresses. Place the marker (if the address is found) he built the infowindow with the info I provided (from the yardsale Json call). This works. I am trying to add weather data in each information window. I can get the data I need and assign it to a variable, but when I try to enter the room that puts the information in the window, it is as undefined.

    I tried to place the variable as a global variable outside the function (under the call for loan doc)?

    Can any body show / tell me how to get the drive to work (and why so I don't make the same mistake)

    Here is the code below:

    $(document) .ready (function() {}

    var val

    var address="Boston, Mass.

    var currdate

    //weatherwidget (address)

    $('#map_canvas') .gmap ("search for", { 'address': 'Boston, Mass' }, function(results, isFound) { })

    if (isFound)

    {

    $('#map_canvas') .gmap ('you','sheet') .panTo (results [0]. geometry.location);

    $('#map_canvas') .gmap ('option', 'zoom', 10);   

    }

    });

    $.getJSON ("Yardsaleagate.json", function(yard_data)

    {

    $.each (yard_data.yardsales, function{}

    var val = thep:System.NET.Sockets.IPPacketInformation.address

    var = thiskey .stuff

    setTimeout (function() {}

    $('#map_canvas') .gmap ('search', { 'address': val}, { function(results, isFound))

    if (isFound)

    {

    $.getJSON ('http://query.yahooapis.com/v1/public/yql?q=select%20 *%20from%20weather.forecast%20where%20 %20 in %20 location (%0A%20%20select%20id%20from%20weather.search%20where%20query%3D%22'+ address +'% 22% 0a) % 20limit % 201 & format = json & diagnosis = true & env=store%3A%2F%2Fdatatables.or g % 2Falltableswithkeys & callback =?', function (data) )

    {

    currdate var = (data.query.results.channel.item.forecast [0] .date)

    Console. Journal (currdate)

    })

    $('#map_canvas') .gmap ('addMarker', { 'position': results [0]. geometry.location, 'description': key, icon: 'map-icons/pins/32/pin_ys.png','animation': google.maps.Animation.DROP, 'info': val}) .mouseover (function () {weatherlocation (val)}) ravishing (function () {}

    var infocontent = ' < div class = 'info' > '+ currdate +"< div class ="header"> < h3 > '+ val+" "< / h3 > < / div > < p > '+this.description+' <>< / div >" "

    $('#map_canvas') .gmap ('openInfoWindow', { 'content': infocontent, 'maxWidth': 300 }, this);

    });

    }

    })

    }, i*700);

    });

    });

    });

    Figured it out (or a solution that works) move the infowindow build in the infowindow will stll build call weather

  • Variable problem score

    Hello

    Having a problem with a system of rating based

    I have the first image below:

    Stop();

    var score: Number = 0;

    with a dynamic text box with the score variable

    Then, some executives with:

    _root.score += 20;

    This set works very well

    The problem is when I want a mc to go to a certain range according to the final score, I have below but does not, any suggestions would be welcome

    Stop();

    If (score == 100) {}

    options.gotoAndStop("100");

    }

    If (score == 80) {}

    options.gotoAndStop("80");

    }

    If (score == 60) {}

    options.gotoAndStop("60");

    }

    If (score == 40) {}

    options.gotoAndStop("40");

    }

    If (score == 20) {}

    options.gotoAndStop("20");

    }

    If (score == 0) {}

    options.gotoAndStop("0");

    }

    First of all, if those are numbers of images in your lines of goto, do not use quotation marks.  If they are image tags, do not use the image tag numbers.

    You should avoid using the var of a textfield property and just read the text property of the textfield object.  So all in all, by using a variable, your code would turn the numbers with the strings, as in...

    If (score.text == '100') {}

    options.gotoAndStop (100);

    }

  • Range variable problem

    Here is the snippet of my function.

    He reads the values of the XML file and get the URL of an Image file for example Abc.jpg.

    To read the URL, I create an empty movieclip to create animations. But now my problem is that I can't read one of the variables to store the XML values because it is not in the scope. I have tried to look for a workaround solution and failed again. Little help?

    private function init (): Void {}

    var polaroid_image:String;

    var myXML:XML = new XML();

    myXML.ignoreWhite = true;

    myXML.load ("content.xml");

    var myImage = myXML.firstChild.childNodes;

    myXML.onLoad = {function (success)}

    If (success) {}

    myImage = myXML.firstChild.childNodes;

    polaroid_image = myImage [1].firstChild.childNodes;

    trace (polaroid_image);

    }

    }

    trace (polaroid_image);  / / PROBLEM HERE: output 'undefined'

    This ._border = 10;

    this.initSize ();

    this.setPosition (48.35).

    this.createBackground ();

    var _mcPolaroid:MovieClip = this._mcBg.createEmptyMovieClip ("polaroid_mc", this._mcBg.getNextHighestDepth ());

    _mcPolaroid.loadMovie (polaroid_image, "polaroid_mc"); / / PROBLEM HERE: as the value is 'undefined', it cannot be used.

    _mcPolaroid._x = _border;

    _mcPolaroid._y = _border;

    var _rmcPolaroid:MovieClip = this._rmcBg.createEmptyMovieClip ("rpolaroid_mc", this._rmcBg.getNextHighestDepth ());

    _rmcPolaroid._yscale * =-1;

    _rmcPolaroid._y = _rmcPolaroid._y + _it _border;

    _rmcPolaroid._x = _border;

    }

    It is not a question of importance.  You try to deal with a value that is not yet defined.  Just because you place this code after the onload function does not mean it runs after the onload function.  The onload function sits and expected that the loading completes, but the rest of the code after it is running before loading is performed.

    You must have all the treatments that are supposed to happen once the loading is completed within the onload function.

    You can confirm that this is not a question of scope by assigning a value to polaroid_image when it is declared... you should see this value when you run...

    var polaroid_image:String = 'value before loading file ';

  • simple variable problem and question preloader

    I am new to AS3 and have a problem with the following code:

    Stop();
    var xmlLoader:URLLoader = new URLLoader();
    var xmlData:XML = new XML();
    var homeText:URLLoader = new URLLoader();
    var slideLoader:Loader = new Loader();
    var sprContainer1:Sprite;
    var projectPath:String;

    LOADING XML

    xmlLoader.addEventListener (Event.COMPLETE, LoadXML);

    xmlLoader.load (new URLRequest("XML/main.xml"));

    function LoadXML(e:Event):void {}
    xmlData = new XML (e.target.data);
    ParseCategories (xmlData);
    }

    PARSE XML
    function ParseCategories(projectInput:XML):void {}
    This. Title.Text = projectInput.category.project[0].@name;
    projectPath = "projects / ' + projectInput.category[0].@path + ' / ';.
    trace (projectPath);

    }

    LOAD THE TEXT FILE

    homeText.addEventListener (Event.COMPLETE, onLoaded);
    homeText.load (new URLRequest (projectPath + "/ text.txt"));

    function onLoaded(e:Event):void {}
    this.homeTxt.text = e.target.data;
    }

    IMAGES LOAD - LOAD FROM XML MULTIPLE IMAGES - COMPLETE

    sprContainer1 = new Sprite();
    homeImg.addChild (slideLoader);
    slideLoader.load (new URLRequest (projectPath + "/ image2.jpg")); < < CURENTLY LOADING AN IMAGE

    The above code shows how to load an XML file that contains the path to the text and image files, I am able to trace the path correctly in the service of ANALYSIS above, but I'm not able to recover the variable (or he also traces) in the TEXT section of the LOAD, please help.

    As I continue to code, I would also like to dynamically load images multiples (in the section LOAD IMAGES) using the projectPath and iterate through each image appearing in an XML file. I'm still not at this time, but my question is how to create a preloader/progressbar that overall progress is displayed for all URL requests (the text file and several images contained in the XML file). Thank you immensely.

    :

    Stop();
    var xmlLoader:URLLoader = new URLLoader();
    var xmlData:XML = new XML();
    var homeText:URLLoader = new URLLoader();
    var slideLoader:Loader = new Loader();
    var sprContainer1:Sprite;
    var projectPath:String;

    LOADING XML

    xmlLoader.addEventListener (Event.COMPLETE, LoadXML);
     
    xmlLoader.load (new URLRequest("XML/main.xml"));
     
    function LoadXML(e:Event):void {}
    xmlData = new XML (e.target.data);
    ParseCategories (xmlData);
    }

    PARSE XML
    function ParseCategories(projectInput:XML):void {}
    This. Title.Text = projectInput.category.project[0].@name;
    projectPath = "projects / ' + projectInput.category[0].@path + ' / ';.
    trace (ProjectPath);

    useProjectPathF();

    }

    LOAD THE TEXT FILE

    function useProjectPathF() {}

    homeText.addEventListener (Event.COMPLETE, onLoaded);
    homeText.load (new URLRequest (projectPath + "/ text.txt"));

    }

    function onLoaded(e:Event):void {}
    this.homeTxt.text = e.target.data;
    }

    IMAGES LOAD - LOAD FROM XML MULTIPLE IMAGES - COMPLETE

    sprContainer1 = new Sprite();
    homeImg.addChild (slideLoader);
    slideLoader.load (new URLRequest (projectPath + "/ image2.jpg"));

  • Field Variable problem

    Hello

    Overview: I'm having a confusing time to know what is happening with the scope of a project I'm trying. I mocked a version of what I am looking for and have attached all of the code (as follows). I want to access/modify a var that resides on the timeline of a movieclip.

    Problem: a movieclip (called test) lies in the first frame of the main timeline. To the inside of the test on it is the first image it says a var called test. The main scenario I ask what is the value of the tests , and it returns the value undefined.

    Attempt to resolve: I programmed in Java, and it has what they call accessors and mutators methods. I tried to create accessor/mutator functions in the movieclip, but this does not change the error message. I also thought it might be a problem with the worm AS I use. I have MX 2004 (v7.0) and I checked the livedocs to look on to see if I was on the right track. I can say that I am.

    Thank you for the help,

    Here is the code:

    you encounter a timing problem. the code on the first frame of your main timeline runs before the code in the first frame of movieclips attached to the first frame of the main timeline.

    so, if you want to access the variables in the first frame of the movieclip you must wait until these variables are set by expect an advance timeline or launch a loop that checks to see if the variables are defined.

  • Bind the Variable problem

    Hi all

    CREATE OR REPLACE PROCEDURE PRMADM_BATCH. UPDATE_PROC_LOG (p_SRC_SYS_ID VARCHAR,
    p_APPL_MOD_NM VARCHAR, p_INPT_OBJ_NM VARCHAR, VARCHAR, p_OUTPT_OBJ_NM p_ERR_ID
    VARCHAR, p_ERR_DESC VARCHAR)
    AS
    number of p_OUTPT_ROW_CNT;
    number of p_INPT_ROW_CNT;
    p_OUTPT_SQL VARCHAR2 (4000);
    p_INPT_SQL VARCHAR2 (4000);
    number of p_ERR_ID_CHK;
    BEGIN
    IF p_ERR_ID = 0 THEN - success
    p_OUTPT_ROW_CNT: = 0;
    p_INPT_ROW_CNT: = 0;
    p_OUTPT_SQL: = NULL;
    p_INPT_SQL: = NULL;
    p_ERR_ID_CHK: = 0;
    DBMS_OUTPUT. PUT_LINE ('SRC_SYS_ID =' | p_SRC_SYS_ID);
    p_OUTPT_SQL: = 'SELECT COUNT (*) FROM "| p_OUTPT_OBJ_NM | ' WHERE
    SRC_SYS_ID =: a ';
    p_INPT_SQL: = 'SELECT COUNT (*) FROM "| p_INPT_OBJ_NM | ' WHERE
    SRC_SYS_ID =: b';
    DBMS_OUTPUT. Put_line (p_OUTPT_SQL);
    DBMS_OUTPUT. Put_line (p_INPT_SQL);
    EXECUTE IMMEDIATE p_OUTPT_SQL IN p_OUTPT_ROW_CNT IN USING p_SRC_SYS_ID;
    EXECUTE IMMEDIATE p_INPT_SQL IN p_INPT_ROW_CNT IN USING p_SRC_SYS_ID;
    Else - failure
    p_OUTPT_ROW_CNT: = - 1;
    p_INPT_ROW_CNT: = - 1;
    p_OUTPT_SQL: = NULL;
    p_INPT_SQL: = NULL;
    p_ERR_ID_CHK: = - 1;
    SELECT COUNT (*) IN the p_ERR_ID_CHK OF PRMADM. ERR WHERE ERR_ID =
    p_ERR_ID;
    IF p_ERR_ID_CHK = 0 THEN
    INSERT INTO PRMADM. ERR (ERR_ID, ERR_DESC) VALUES (p_ERR_ID,
    p_ERR_DESC);
    COMMIT;
    END IF;
    END IF;
    UPDATE PRMADM. PROC_LOG
    SET PROC_END_DY_DT = SYSDATE,
    INPT_ROW_CNT = p_INPT_ROW_CNT,
    OUTPT_ROW_CNT = p_OUTPT_ROW_CNT,
    ERR_ID = p_ERR_ID
    WHERE APPL_MOD_NM = p_APPL_MOD_NM
    AND PROC_END_DY_DT IS NULL
    AND OUTPT_OBJ_NM = p_OUTPT_OBJ_NM
    AND INPT_OBJ_NM = p_INPT_OBJ_NM
    AND SRC_SYS_ID = p_SRC_SYS_ID;
    COMMIT;
    END UPDATE_PROC_LOG;
    /

    The proc above is running well and gives the result below

    SRC_SYS_ID = 1030
    SELECT COUNT (*) IN THE PRMADM. PGM WHERE
    SRC_SYS_ID =: a
    SELECT COUNT (*) IN THE PRMADM. INPT_PGM WHERE
    SRC_SYS_ID =: b


    My question is where can I enter the value for the variable bind a and b...

    I want to put two to 1030

    Thanks in advance

    Ndiaye (ndiaye) wrote:
    p_SRC_SYS_ID (input in my proc parameter) takes the value of 1030 and I want that the connection variable: an and: b take the same value...

    But they take this value...

    EXECUTE IMMEDIATE p_OUTPT_SQL IN p_OUTPT_ROW_CNT IN USING p_SRC_SYS_ID;
    EXECUTE IMMEDIATE p_INPT_SQL IN p_INPT_ROW_CNT IN USING p_SRC_SYS_ID;

    The 'USE' of the declaration part links the value to bind variables in the SQL statement.

    Where is the problem?

  • ORACLE ADMINISTRATION TOOLS - MANAGE SECURITY AND THE VARIABLE - PROBLEM

    To manage security, I use an external "DIM_DMT_PRIVILEGE" table with 3 columns: user, Type and value

    I created a block of initialization in the variable management section named 'CATEGORY' by the next expression of inititialisation:

    SELECT "CATEGORY", DMT_VALUE_CD
    OF DIM_DMT_PRIVILEGE T
    WHERE T.DMT_TYPE_CD = 'CT '.
    AND)
    High (T.DMT_USER_CD) = upper ('VALUEOF (NQ_SESSION.) THE USER) ")"
    OR T.DMT_USER_CD in ('VALUEOF (NQ_SESSION.) (GROUP)')

    The problem is that the initialization state * "upper (T.DMT_USER_CD) = upper ('VALUEOF (NQ_SESSION.)" "USER)") "* success but the other *" or T.DMT_USER_CD in ('VALUEOF (NQ_SESSION.) GROUP) ")" * don't.

    In the external table, the column user contain users and groups of users, security groups, and users.

    Thanks for your help,

    Kevin

    Hello

    In your select statement, you must use the name of the database table columns and not the names of the variables defined in the initialization block.

    Looks like you used the names of variables in a query, if I understand correctly.

    According to my understnading, you must use...

    SELECT DMT_TYPE_CD, DMT_VALUE_CD
    OF DIM_DMT_PRIVILEGE T
    WHERE T.DMT_TYPE_CD = 'CT '.
    AND)
    High (T.DMT_USER_CD) = upper ('VALUEOF (NQ_SESSION.) THE USER) ")"
    OR T.DMT_USER_CD in ('VALUEOF (NQ_SESSION.) (GROUP)')

    It will store these values corresponding to you first two variables defined in the initialization block.

  • ODI Variable problem

    Hi all

    I'm using ODI 11 g.

    So I have a requirment where

    When I execute the script

    Enter v_name value: test

    After execution, it will create the a UNIX file called test.dat with some content in the file if possible.
    ---------------

    Basically what I need, is the extracted file that the ODI package would create have the same name as stored in the variable.
    May be something like v_Julian_date. ». DAT '.

    Please suggest ideas.

    Thank you
    Lony

    Create a refresh variable that will hold the sysdate in the required format. Then use this variable when you provide the name of file in odiSqlUnload or odiOutfile, etc.,

    RefreshMode
    T_DATE: Select to_char (sysdate, 'YYYYMMDD') of double

    When you give to the use of file name

    D:\ODI\#V_DATE.dat

  • SET the VARIABLE problem

    Hello world!

    I added a line to my report of responses on the tab advanced, prefix section as follows:
    SET VARIABLE DISABLE_CACHE_HIT = 1 DISABLE_CACHE_SEED = 1;

    I also put a session variable by using the dashboard line. Then when I start my report, you receive the following error message:

    A general error occurred. [nQSError: 27002] About < GAME >: Syntax error [nQSError: 26012]. (HY000)

    Publ. SQL: SET VARIABLE sv_test = "Test"; SET VARIABLE DISABLE_CACHE_HIT = 1 DISABLE_CACHE_SEED = 1; SELECT...

    So, the first SET statement is generated from Dashboard prompt and the second section of a throug prefix. I also tried to exclude 'SET the VARIABLE' section of my report prefix, but it still does not work. What is the correct syntax?

    Help me, please!

    TNX!

    user10203008 the error is in a semi instead of the comma
    SET the VARIABLE sv_test = "Test"<; !comma="" have="" to="" be="" here!="">SET VARIABLE DISABLE_CACHE_HIT = 1 DISABLE_CACHE_SEED = 1;

    So you can do this quickly with variable pvVar presentation. And a prefix write
    * SET VARIABLE sv_test='@{pvVar}',SET VARIABLE DISABLE_CACHE_HIT is 1 DISABLE_CACHE_SEED = 1;. *

    It must works.

    Published by: AnTonic January 26, 2011 12:23

Maybe you are looking for