While loop: counter in the name field

Here is the code I have. I tested it and it works on the number one field. (in Formcalc)

if ((FS270Pt1 > = 28,5) and (FS270Pt1 < = 38))

then FS270Pt1.font.fill.color.value = '0,0,0 '.

else FS270Pt1.font.fill.color.value = "255,0,0".

endif

I have 15 number fields should I apply this color to font for the criteria must be respected.  I try to use a while statement to achieve this.  I know that I have deduced that it should look like this:

var i = 1

While (I < = 15)

do

If ((FS270Pt (i) > = 28.5) and (FS270Pt (i) < = 38))

then FS270Pt (i).font.color.value = "0,0,0".

else FS270Pt (i).font.color.value = "255,0,0".

endif

i = i + 1

endwhile

When I run the 'Script Check syntax' I don't get any errors.  However, when running, she says that FS270Pt is unknown.  How can I loop through the fields binding name?

It will throw the error. Because the instances of the field to which you refer is not correct. You need to loop through the instances of the field. The domain name is FS270Pt1. So it's instances and be FS270Pt1 [0], FS270Pt1 [1] FS270Pt1 [2]... etc.

Therefore, replace the code inyour

FS270Pt (i) with FS270Pt1 ["+ i +" "]. It should work.

Thank you

Sidonie.

Tags: Adobe LiveCycle

Similar Questions

  • Change the values of the cluster in while loop and in the face at the same time

    Hello.

    I have a little problem in a test program, that I'm working on. I'll try to simplify as much as possible. I have a cluster control that contains two controls A and B. I want to:

    1. switch to update the value of the command A a while loop
    2. allow the user to change the value of the B control through the face, while the loop is running

    To change the value of order in the while loop, I first get the cluster control cluster, update the value of the control for a way to group by name and finally rewrite the cluster in the cluster control.

    The problem is that if the user changes the value of the B control while control that is in the middle of the update, the new value of B control is lost because it was read before updating in the face. Is there a way to get around this?

    DennisBengs wrote:

    1. switch to update the value of the command A a while loop
    2. allow the user to change the value of the B control through the face, while the loop is running

    Then they do not belong in the same cluster.  They are disconnected obviously enough that they do not go hand in hand.

    Where it can get really complicated, it is that you're talking about the user and code changing the same cluster.  It is very dangerous and very difficult to manage.  You might be able to get there with a driving force.  But walk slightly, my friend.

  • While/loop and reset the value i in time loop

    Hello!

    I have a question about the use of while/loop for.

    I read the data of 5 devices.

    Starting with the 0 position when I = 0, I read the data at position 0.

    And when I click on NextPosition, then I = 1 and stop when I = 5.

    But in the meantime, if I want to break the system of position 3 for now. I click on the BREAK.

    I chose the position back to 0, it will go to this post.

    But if I click on NextPosition, the value is always my 0 and not 1, which is the next position upward.

    In addition, whenever I click NextPosition, it will count up to i = 5 and to stop the program.

    Is there a way I can address the issue?

    Thanks for trying!

    I don't know what your needs are, so I guess you want to keep hitting the same device until you press the button of the next device and you want to be able to specify that one then.

    In the attached code, I changed your mechanical action of the pause button and renamed position Reset.

    I also changed the code suchthat conditionally, we increment the device number (only when the next button is hit).

    I have alos moved local so that us do not draft times and put it in the case of the rest the structure so it is written or read but not both.

    If this does not meet your needs;

    1) look in bulb mode and see where I went wrong

    (2) If you are unable to set up a truth table of all combinations buttn and doc what steps should occur for each condition.

    Always trying to help,

    Ben

  • Use FOR... LOOP counter in the treatment of PL/SQL procedures with nest. Table

    Hi all!
    I learn PL/SQL on the book by Steve Bobrovsky (specified below, sample comes from it) and I have a question.

    In the procedure of the below specified program used a currentElement integer variable to get the reference to the line in the nested table of data type % ROWTYPE.
    Meanwhile, the program itself uses a common FOR... LOOP counter I have.
    DECLARE
     TYPE partsTable IS TABLE OF parts%ROWTYPE;
     tempParts partsTable := partsTable();
     CURSOR selectedParts IS 
      SELECT * FROM parts ORDER BY id;
     currentPart selectedParts%ROWTYPE;
     currentElement INTEGER;
     PROCEDURE printParts(p_title IN VARCHAR2, p_collection IN partsTable) IS
      BEGIN
       DBMS_OUTPUT.PUT_LINE(' ');
       DBMS_OUTPUT.PUT_LINE(p_title || ' elements: ' || p_collection.COUNT);
       currentElement := p_collection.FIRST;
       FOR i IN 1 .. p_collection.COUNT
       LOOP
        DBMS_OUTPUT.PUT('Element #' || currentElement || ' is ');
         IF tempParts(currentElement).id IS NULL THEN DBMS_OUTPUT.PUT_LINE('an empty element.');
         ELSE DBMS_OUTPUT.PUT_LINE('ID: ' || tempParts(currentElement).id || ' DESCRIPTION: ' || tempParts(currentElement).description);
         END IF;
        currentElement := p_collection.NEXT(currentElement);
       END LOOP;
     END printParts;
    BEGIN
     FOR currentPart IN selectedParts
     LOOP
      tempParts.EXTEND(2);
      tempParts(tempParts.LAST) := currentPart;
     END LOOP;
     printParts('Densely populated', tempParts);
     FOR i IN 1 .. tempParts.COUNT
     LOOP
      IF tempParts(i).id is NULL THEN tempParts.DELETE(i);
      END IF;
     END LOOP;
     FOR i IN 1 .. 50
     LOOP
      DBMS_OUTPUT.PUT('-');
     END LOOP;
     printParts('Sparsely populated', tempParts);
    END;
    /
    When I substituted a global variable of INTEGER type such for... The LOOP counter, an APEX have returned an error "ORA-01403: no data found.
    DECLARE
     TYPE partsTable IS TABLE OF parts%ROWTYPE;
     tempParts partsTable := partsTable();
     CURSOR selectedParts IS 
      SELECT * FROM parts ORDER BY id;
     currentPart selectedParts%ROWTYPE;
     PROCEDURE printParts(p_title IN VARCHAR2, p_collection IN partsTable) IS
      BEGIN
       DBMS_OUTPUT.PUT_LINE(' ');
       DBMS_OUTPUT.PUT_LINE(p_title || ' elements: ' || p_collection.COUNT);
       FOR i IN 1 .. p_collection.COUNT
       LOOP
        DBMS_OUTPUT.PUT('Element is ');
         IF tempParts(i).id IS NULL THEN DBMS_OUTPUT.PUT_LINE('an empty element.');
         ELSE DBMS_OUTPUT.PUT_LINE('ID: ' || tempParts(i).id || ' DESCRIPTION: ' || tempParts(i).description);
         END IF;
       END LOOP;
     END printParts;
    BEGIN
     FOR currentPart IN selectedParts
     LOOP
      tempParts.EXTEND(2);
      tempParts(tempParts.LAST) := currentPart;
     END LOOP;
     printParts('Densely populated', tempParts);
     FOR i IN 1 .. tempParts.COUNT
     LOOP
      IF tempParts(i).id is NULL THEN tempParts.DELETE(i);
      END IF;
     END LOOP;
     FOR i IN 1 .. 50
     LOOP
      DBMS_OUTPUT.PUT('-');
     END LOOP;
     printParts('Sparsely populated', tempParts);
    END;
    /
    When I tried to manage this code in SQL * Plus, the following picture emerged:
    Densely populated elements: 10
    Element is an empty element.
    Element is ID: 1 DESCRIPTION: Fax Machine
    Element is an empty element.
    Element is ID: 2 DESCRIPTION: Copy Machine
    Element is an empty element.
    Element is ID: 3 DESCRIPTION: Laptop PC
    Element is an empty element.
    Element is ID: 4 DESCRIPTION: Desktop PC
    Element is an empty element.
    Element is ID: 5 DESCRIPTION: Scanner
    --------------------------------------------------
    Sparsely populated elements: 5
    DECLARE
    *                                                 
    ERROR at line 1:                                  
    ORA-01403: no data found                          
    ORA-06512: at line 14                             
    ORA-06512: at line 35
    What's not in the code (or what I did not understand)? Help please!

    Your error occurs because you are dealing with a sparsely populated collection and using an index for items that do not exist.

    For collections of the low density of population, you must iterate through using FIRST and THEN as modeled not from 1 to COUNT.

    The crucial difference between your code and the example is:

    tempParts(i)
    

    Which, as you have demonstrated, doesn't work very well (!) if there is no item (i).

    The code example is a little unusual in my opinion.

       currentElement := p_collection.FIRST;
       FOR i IN 1 .. p_collection.COUNT
       LOOP
        ...
        currentElement := p_collection.NEXT(currentElement);
       END LOOP;
    

    It works, but it's an unusual way to iterate through a collection of rare which is perhaps most often done like this:

       currentElement := p_collection.FIRST;
       WHILE(currentElement IS NOT NULL)
       LOOP
        ...
        currentElement := p_collection.NEXT(currentElement);
       END LOOP;
    

    Which is perhaps less open to confusion.

    In the end, the distinction between

    tempParts(currentElement).id
    

    and

    tempParts(i).id
    

    is crucial.

  • While loop, wait for the function and the stop button!

    Hello

    I have a while loop and a stop button. Inside my While loop - I have a 'Wait (x ms)' function. If I press the stop button, it does not block the program immediately, he expects ms x then stops the program. How can I get rid of this?

    Thanks in advance for the help!


  • How to make a graphic inside a while loop to maintain the previous values

    At first I tried to use a the VI Express XY graphics to create a track of points.  However, the chart is a trace linear between the first point in the new line and the last point of the previous line.  It then creates the new line as you wish.

    I tried to use a loop with group a cluster for the chart, but the chart resets the plot at each iteration (as expected) and I can't find a way to maintain the previous data.  I tried using shift registers, but was unable to find a way to do it, and I tried also the cluster of a painting company, but can not find a way to make the cluster to a 1 d of a cluster of 2 elements array.

    One option is to have is to find a way to maintain the previous data, but the preferred option is to create a new path to each iteration to see the color change for each new parcel.

    I take stabbed it because I don't know exactly what you want. But I think that's what I've shown here. You must use a shift on your outside register while loop, as I showed. Your image where you tried to use a shift register shows a misunderstanding of the shift registers and how well they work, then I'd take a peek at these tutorials.

  • How to stop a while loop structure in the event of a main vi

    Hello;

    Sorry for my English

    I have to stop to a Subvi my main VI, the Subvi contains a while loop and an event structure, so I need to stop this loop while I tried directly from my main vi, global variable, but it did not work

    any help please or example!

    How about something like this (solution see attachment) using a user event.

    Explore the User Interface--> range of events and dialogue. To display the dynamic event of the terminals in the structure of the event just right click and select 'display the dynamic event posts '.

  • Count of the text fields empty

    Hello. I'm looking for a way to count empty text fields in a pdf form and have the result automatically entered in another field in the same form. Thanks in advance for your help.

    OK, here's a simple custom calculate script for a text field that displays the number of empty text that are named "nº1' - 'num.10: fields

    // Custom Calculate script
    (function () {
    
        // Initialize sum of blank fields
        var sum = 0;
    
        // Count how many fields are blank
        for (var i = 1; i < 11; i += 1) {
            if (!getField("num." + i).valueAsString) sum += 1;
        }
    
        // Set this field value to the sum
        event.value = sum;
    
    })();
    
  • How to fix a particular area (a header) on the screen while I scroll through the other fields.

    I added labelfield as a header title display and other fields which follow.

    I want to correct the label header at the top that I scroll down.

    How can I make it possible?

    Another body fields aree added to a verticalfieldmanager that is added to the screen.

    put this labelfiled setTitle or setBanner

  • Adding a '-' in the name field for things like SS # or phone number

    This seems to be a simple question, but a search is not just do what anyone.  Maybe I don't know what to look for?

    I'm doing in the fields with the hyphens "-" already in place for the fields as a social security number or phone number.

    Example of phone:

    A person in the field of 5555551212 types and fills "555-555-1212" automatically by moving the cursor to the next empty space when this section of the field is complete.

    Example of the art:
    A person types in 223233923 and the same thing happens with dashes: 223-23-3923

    I have the same question for Dates too, but with slashes: 07202012 would result in the 20/07/2012.

    This is probably a simple framework, but I don't know where to look.  Help, please!

    PS. I know how to change the 'format' to force the user to ENTER the '-' or ' / ', but what about automatically place there for them or have aready here?

    PPS. I found the Script 'Auto-onglet' here: http://www.planetpdf.com/developer/article.asp?ContentID=javascript_setfocus_method_f & gid = 6267 however, which forces me to cut to the top the field in 3 different areas and I would avoid it if I could.

    You can use the following to format your SSnumber:

    Put this in a document-level script:

    function formatSSN () {}

    var s = event.value

    var re = /^(\d{3}) [---]? (\d{2)} [ -]? (\d{4})$/;

    If (re.test (s)) {}

    var match = re.exec (s);

    Event.Value = match [1] + '-' + match [2] + '-' + match [3]

    }

    }

    Put this in the Script of custom Format for the fields that you want to format:

    formatSSN)

  • 2 while loops can work at the same time?

    I have two while loops in my program; We can read the data and the other does nothing until I hit stop on the first. I want the first and the second to run out of the time constraint, I have for it when I hit the Start button to always run. I use a DAQ and transfer data from one to another while loop. See the attached file.

    Main issues:

    How to tie the Start button?

    How to get the second loop to work with the first?

    Thank you

    Your problem is that the loops are dependent on the data.  If you want to run two loops at the same time, they cannot have wires linking one to the other.  Focus on the architecture of producer/consumer .  It uses queues to send data of a loop to the other.

  • How to control the rate of acquiring data in a while loop

    I'm trying to use a digital trigger to collect data on the rising and falling edge. The design is displayed as below. Now, I save the measured voltage 1 & 2 to the local variable in the while loop. Hoever, the while loop runs at a frequency of more compared to the structure of the case triggered. So I had a lot of repetitive data.  If I record data directly from structure of the case, it will be recorded as data-0-date-0 because of the ongoing case of fake wire.

    I wonder how to revise to save the measured voltage 1 & 2 at the same frequency of up/down edge triggered? Thank you! I have also attached my current version of Labview program, which takes place in time real Labview 2013.

    Mcdullna wrote:

    Thank you for the answer. Could you be more specific about the use of the shift register?

    The case of false just past the value through.  With this configuration, you agree that the data remain in the son, avoiding race conditions.  It is also more effective than the use of local variables.

  • Data dependence isn't the only thing to stop while loops to run simultaneously?

    I write code to turn two stepper motors with various functions. This is my first program, so I don't know it's terrible, but I'm very interested in getting this work. I checked for the data depenecy and followed some suggestions to use local variables to solve the problem. It did not work, so now I'm trying to understand this.

    I know that all features were able to simultaneously run, but after a few changes (including put everything in a while loop to keep the program running until someone clicks the exit button), no function can currently work simultaneously.

    I'll post my code in case someone has the time to watch it (I'd really appreciate it if someone did), but I am also looking for any other problem that might be the source of the problem.

    Really, any help is greatly appreciated.

    Thanks in advance


  • Producing a XY chart in a While loop that adds a new point XY to the curve from each while the loop iteration

    I would like to plot data by using the XY graph as a Visual display. I have a While loop that creates a new point X and Y during each iteration. I need the XY graph to be in the While loop, because once the order to stop has been pressed the sis loop finished and the final graph to be displayed. The problem is that after each iteration, the XY graph display clears and watch point, compared to add the new point to the previous by a line connecting the two points. It works perfectly if I move the XY graph out of the While loop, but it only shows the XY graph at the end of the While loop. I would like to visually see the XY graph updated during the execution of the While loop. Any help would be much appreciated.

    Thank you

    You can add a data both point to a chart to a chart, you must pass the entire data group.  I would use a couple of shift registers in your loop.

  • Detect the change of the value in While loop

    Hello

    I recently took a code example in examples of using Labview and I'm putting the analog output through my data acquisition card 4461 pxi. I want to have a continuous waveform, but being able to change the volume and the waveform will adjust automatically and be issued through the card.

    In the code, I have everything first to open a .wav file and write it. While playing continuously through the while loop, but I want the signal to change automatically when the volume is changed. I know that I should probably use a structure of the event but the while loop, I use to play the signal will never stop unless the user presses stop so it would play permanently in a structure of the event even when the value changes (I tried).

    So now I try to see if there is a way to make my time stop loop when the volume value.

    You must correct the issues (forget the events if you are not sure of them):

    1. If wire you the digital volume to the wall of the while structure, then the whole in structure only tell that one value that happens on the node and will not read new values.

    2. to read the new values, move the Volume Terminal inside any building (which will shock your other code that depends on it), or use a local Variable inside any node.

    3. to check if the value has changed, you must compare the value to the previous value. To do this, use a shift on the while loop register to store the previous value and then compare it to the new value with the function "not equal?". Wire the Boolean result of this to the conditional Terminal.

    A better way for you might be to wrap the multiplication and Analog Write function into the while loop so that you're constantly replaying the waveform and it's continuously being re-scaled by the volume value. This will mean your volume control is being continuously polled (once per waveform playback) and used to scale the waveform each time. You'll need to figure out how to stop, send and play the waveform once per iteration of the while loop by bringing the Stop VI inside too. 

Maybe you are looking for

  • Can I extract text from a document of numbers?

    I made a list of items in a document of numbers so I could get an alphabetical sort it. Now, I would like to copy this text into a Pages document. I select the text in the document numbers, copy it, then paste it into the page document, but what appe

  • Measurement of voltage detection failure

    Hello everyone I am a new user of Labview and I try to measure a voltage but is facing difficulties. I use: Worm - Labview 8.0 on Windows XP -Based electric circuit with a voltage generator and resistor for voltage -A connection block 68 CBS -A NI PX

  • USRobotics for vista bvrp phone tools

    Well well, after messing aroun with her for a neck [ple of days now it would sem that ther is no way to run the program. I tried to open each program in the zip folder but it seems that there is no way so he can use the wizard to guide you through th

  • Why can't upgrade windows 7 Enterprise to windows 10 pro

    Why can't spend enterpise windows 7 to windows 10 pro if I don't need company more?

  • Missing sun screen blackBerry smartphones! argghh...

    HelloI am a newbie to the forum pls so patient with me. My browser froze that night, and I had to remove the battery to heal. When restarting my screen is now really gone dim! I am unable to resolve this anywhereHelp, please!?Thanks in advance,DOM.