There must be an easier way!

Maybe it's the lack of good sleep in recent weeks, or simply to watch the long code, but it seems that there should be an easier way to do it, but it escapes me. Here is the code example. I have 48 initial statements of the YEW, with nested IF statements. The first outter, IF the declaration has 47 IF statements nested, the second statement IF outter has 46 IF statements nested, etc.. I have shortened the code for readability.

If (thisItem.p0 == true) {}
P00. AddItem (thisItem);

If (thisItem.ItemSlots > = 1) {}
thisItem.p1 = true;
P01. AddItem (thisItem);

If (thisItem.ItemSlots > = 2) {}
thisItem.p2 = true;
P02. AddItem (thisItem);

If (thisItem.ItemSlots > = 3) {}
thisItem.p3 = true;
P03. AddItem (thisItem);

If (thisItem.ItemSlots > = 4) {}
thisItem.p4 = true;
P04. AddItem (thisItem);

If (thisItem.ItemSlots > = 5) {}
thisItem.p5 = true;
P05. AddItem (thisItem);
}
}
}
}
}
}
If (thisItem.p1 == true) {}
P01. AddItem (thisItem);

If (thisItem.ItemSlots > = 1) {}
thisItem.p2 = true;
P02. AddItem (thisItem);

If (thisItem.ItemSlots > = 2) {}
thisItem.p3 = true;
P03. AddItem (thisItem);

If (thisItem.ItemSlots > = 3) {}
thisItem.p4 = true;
P04. AddItem (thisItem);

If (thisItem.ItemSlots > = 4) {}
thisItem.p5 = true;
P05. AddItem (thisItem);
}
}
}
}
}

This--->

If (thisItem.ItemSlots > = 1) {}
thisItem.p1 = true;
P01. AddItem (thisItem);

If (thisItem.ItemSlots > = 2) {}
thisItem.p2 = true;
P02. AddItem (thisItem);

If (thisItem.ItemSlots > = 3) {}
thisItem.p3 = true;
P03. AddItem (thisItem);

If (thisItem.ItemSlots > = 4) {}
thisItem.p4 = true;
P04. AddItem (thisItem);

If (thisItem.ItemSlots > = 5) {}
thisItem.p5 = true;
P05. AddItem (thisItem);

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

and this--->

for (var i: int = 0; i<>
thisItem [("p" + i)] = true;
This [("P0" + i)]. AddItem (thisItem);
}

must be the same, (I have not tested the syntaxt throughoutly, but it should work)

Tags: Flex

Similar Questions

  • There must be an easier way to get these to plug and play

    I have attempted to put in place all the computers in my work so that they can take advantage of Microsoft Voice Recogbition and I use the Andrea Electronics USB USB sound card - MY and had recently several computers in my issues of experience at work with the USB - MY does not automatically installed on Windows 7 machines. When they connect, they get an error message saying: it has not been installed successfully, and it is not visible in the menu of recording devices. I have also a computer tries to use the USB adapter - MY with a motherboard ASUS Sabretooth X 79, and not only would not recognize it correctly the system, but would not start with the card installed in one of the USB ports. I know that these situations are very difficult to resolve because of the number of variables involved.

    I tried a number of things, such as uninstalling and reinstalling the driver, force to install the driver from different USB ports, hubs, etc., MS update catalog, but the only thing that seems to work is to uninstall the Generic USB hub and the hub root USB, and then restart the system.

    I might add that this issue was raised with other products as well USB, like a Bluetooth adapter and a wireless mouse. Is this something new? Everyone is having similar problems? Is there a simpler solution? Is this something that Microsoft should continue the investigation?

    No indication as to how or why this happens, or an easier way to fix it would be greatly appreciated.

    Thank you

    Joe

    Hey Joe,

    The question you posted would be better suited in the TechNet Forums; We recommend that you post your question in the TechNet Forums to get help:

    http://social.technet.Microsoft.com/forums/en-us/category/w7itpro

  • must be an easier way...

    Here's a screenshot of my block diagram. I keep thinking that there must be an easier way to fill values other than cluster using these two nested for loops, but I can't think one. I am taking 4 rows of an array of bytes and fill of the items in cluster 0-5 to 6 bits of rank 0, cluster items 6-12 with six bits of rank 1, elements of cluster 13-18 with 6 bits of rank 2, then the remaining elements of the 3 cluster with 3 bits of tier 3. Any suggestions or is this the best way? I seem to think there must be something more simple. I have to see this end up in the rube goldberg section easily


  • Ahhhh! There must be a better way to change fonts/colors in 'States '. Photo below. Does anyone have the magic answer?

    Hello world

    I spend (and lose) so much time trying to make fundamental changes in the States. There must be an easier way in the future in Muse with the States. But for now, here's my challenge:

    For this example, the title of the person has been in light blue.  Statement of assets was white. I want to change the type of white in the statement of assets.

    Screen Shot 2015-10-27 at 13.38.34.png

    Yellow is for example purposes.

    In the NORMAL State , I change the title to yellow color. As you can see, the first 3 States change to yellow. The State of the asset remains white. Understood.

    Screen Shot 2015-10-27 at 13.43.02.png

    So I then click on the status of the assets button, and we see the white. I used Pink for this example.

    Just after I enter rose in the statement of assets, and if I click back or escape, I get this message. No matter if I edit together checked or not.

    If this warning message doesn't make sense, how the hell do I change things in the statement of assets?

    Screen Shot 2015-10-27 at 13.53.50.png

    If the result of the evolution of the Active state to rose, all changes except the active state. There must be an answer. Thank you!

    Screen Shot 2015-10-27 at 13.54.09.png

    Select the Group of free text and a text block, select the State and change the color of the image itself.

    Thank you

    Sanjit

  • There must be a better way to do this

    There must be a better way to do this!

    25 separate reports - 1 voltage recorded by chanel every minute for 21 hours (end - times will have to be changed)

    Anyone has ideas/directions

    CC

    The DAQ Assistant reads the tensions based on the timings specified, which means that if I set the number of samples finish say 20 and the frequency of samples to 1, then data acquisition will take 20 seconds to save 20 data points (one second) per channel. Then the DAQ pump data to the loop that creates reports (N number of reports).

    TO answer this question: the DAQ Assistant will do exactly what you suggest here.

    Two questions:

    -the loop will be able to separate the different channels ie first report contains data AI1, AI2 and AI3, then the second contains data AI4, AI5 AI6 etc.. ? What is the purpose of the table screws?

    TO answer this question: If you look inside the front loop, you see I have the sub table value function. I have set the index to the increment and then multiply 3 X. The first time in the loop take 0 and multiply by 3 and I get zero. second time through I multiply 1 X 3 and get 3. The second thing I have on the sub table set is giving him a length of 3. This will make return three matrices. So this will give me the next three tables each time through. So the first time through I get AI0 AI1, AI2 AI3 AI4, AI5 second time or however you have configured channels.

    - and what is the function of painting that the subset of table is wired to (can not find the icon of my pallet table)?

    TO answer this question: Index table. Handel, it automatically becomes a 2D array.

  • Is there a quick and easy way to the entrance of calendar days in a day / diary of the page, instead of setting each page?

    Is there a quick and easy way to the entrance of calendar days in a day / diary of the page, instead of setting each page?

    If you make a text for the day of the page master frame, you can put on a single story that contains every day across all pages of the document. If you separate the days with a paragraph return, you can set the keep Options to start each paragraph in a new frame, and they will all go one-to-a-page.

  • There must be a better way to do this (frustration of RAM Preview)

    I loaded one 01:20 second Full HD clip in sequels. I need to edit the video based on some sounds in the video and see if I match them correctly by the image previewed with the sound.

    The problem is that I'm frustrated due to After effects does not not like first. First who thought it was a good idea is not to integrate sound in sequels? Secondly, I have an i7 processor sandy bridge, and 16 GB of ram, but he always takes time to render the preview ram (with still no effect on it).

    Ram preview is my only option for sound, but the problem is every time I hit the ram preview it starts the video all the way from the beginning. It's frustrating because I want to start at a specific time. Imagine having a video more long where editing must take place at the end.

    Professional projects of people out there doing a lot more complicated, you guys how to work around this problem?

    Why can't after that effects do some basic things like first as make fast with the sound? Is it because of the Mercury engine and 64-bit?

    It is one of the best products on the market, there must be a better way of doing things?

    No need to preview RAM just to hear the sound, use the comma on the numeric keypad key to play an audio preview only.

    If you want to mark certain audio events, twirl down the properties for the audio until you see the waveform and then use it to synchronize audio and animations.

    And if you want RAM Preview from your current position, simply press the 'B' button to set your start of work area to the playhead, and then the RAM previews will begin from that point.

    Use ctrl - drag to scrub audio & video. Use ctrl-alt-drag to scrub just audio.

    AE has all the audio features of first (and), he just behaves in a different way.

  • Numbering... must be an easier way?

    I am currently a little project for a farming business producing cards numbered from potatoes that are used to differentiate the stocks of pallets.

    These maps are very basic black text with a number (previously identified using a rotary machine to number morgana, post press) the problem is with these rotary dialers numbers are small and faded, so I would like to print these numbers numerically, to keep their big and clear to read. The rest of the text on sheets is printed digitally so I was hoping just to add each card number and print in a single pass.

    So... my question... is there at - it an easier way in indesign manually type each number in the required box, I have 4500 card number, so I'm looking for the most effective way to do it.

    I'm using Adobe CS4 on an imac G5 10.6.4.

    Using the data merge you implemented page tempalte with independent text blocks, not threaded and put all the labels on the page (it will be a single record by merger of the page). Each record contains the same quantity of numbers as there are labels on the sheet. It's up to you how arrange you these numbers.

    I like to set up a spreadsheet for the numbering. For example, if you need 240 labels 8 poses, this equals 30 sheets. This means that you need a matrix on the spreadsheet of 30 rows and 8 columns. INTHE first column number down from 1 to 30, in the second of 31 to 60. and so on. Excel can autofill times columns and lines, so if you type 1, 2, 3 in the fisrt one column, Excel can fill the rest of the way to 30 just by dragging them. Do the same thing for the second column, select the two columns and drag to the right to fill the rest of the table (Excel needs of sufficient data to establish the pattern, but can then do all of the table at the same time). Add a new line at the top after filling to contain the field names for the data fusion and export to .csv. Use the file .csv as source for the merge, drag a field label in each image numbers and perform the merge. Your labels will be stacked in the order after the cut.

    The key to this method is the calculation to get the correct number of lines to manage the total number.

  • Legends and anchored objects - there must be a better way to do

    I spent a lot of time in the last six months, reconstruct PDF files in InDesign. It is part of my regular responsibilities, but I do a lot more of him for some reason any. Because I send you the text of these rebuild on documents for translation, I like that all of the text in a single story. It really helps to have the text in 'logical order', I think; When I prepare a trifold brochure, I try pretty hard to make sure that the order in which readers will read the text is reproduced in the stream of history throughout the identity document.

    So I'm rebuilding a manual as a form of 3 columns on letter paper and it is full of legends. Full of em. They are not pull quotes, either; each of these has unique text. Keeping in mind that I would like the text of those legends to stay in the same position in the text once I connected all the stories and exported a RTF for translation, which is the best way to handle them? What I do is insert a frame drawn emptly as an anchored object, size and position to sit above the text which is supposed to be shouted. When my translations come back, so they are always longer than the source document, as I crawl through the text, I resize the anchored images to match the size and position of the new extension translated the text and then move them in place with the keyboard.

    There must be a better way.

    It is better, right? I don't actually know too. If I really want to fill these frames anchored with text, I can't screw the them in the history. I suppose I could just put on the frames of the legend and assign two RTFs for translation instead of one, but then the 'logic' of my text order is thrown out the window. So, I am asking myself "what's more important? reduction of formatting time or maintenance of the flow of the story? "If there's something that miss me let me to dodge this decision, I would love to hear about it. The only thing I can think would work like this:

    (1) reproduce the text of the legend in the history with a custom sample "Invisible."

    (2) create "CalloutText" parastyle with "Invisible" swatch and apply it to the caption text

    (3) Insert the anchor for framework anchored immediately before the content of CalloutText

    (4) send it out for translation

    (5) while I'm waiting to get him back, write a script that would be (don't know if this is possible):

    (a) to scroll through the main story looking for any instance of CalloutText

    (b) copies an instance of contiguous to this style to the Clipboard

    (c) look back in history for the first preceding the instance of CalloutText anchor

    (d) fill the object anchored with the text on the Clipboard (that's where I'm really naïve)

    (e) implement a new parastyle the text of the legend

    (f) continue step by step through the story, looking for other instances of CalloutText

    If this is really the only decent solution, I'll simply go to the Scripting forum for more help with d). Any of you can make other suggestions?

    N ° there is no plugin dependencies (as long as you do not use

    APID version 1.0.46 - who had a bug that caused the warnings warning). Round-

    trigger by INX dirty not the text. If you return

    using the most recent version of the APID (version 1.0.47 pre5 and later - not)

    really yet published), plugin data should be preserved as well.

    Substances

  • Is there a quick and easy ways to precisely align text on a circular path?

    I create a model of roller coaster of drinks and I have to make sure that the text moves around the outside edge of the coaster is properly spaced, symmetrical and well aligned. Are there tools that I can use to simplify this process, because at the moment I use the very long and very imprecise method of using the SPACEBAR and counting the spaces between words and turning arc text manually. There must be an automatic method that is much more accurate?

    Thank you very much. TW

    Another method: start by placing a space between each of the sentences. Use the method justified that Peter suggested.

    Then replace the spaces between sentences with a hunting space (Type > Insert space > Flush space).

    To the passage of the alignment with the selection tool. Check that the proxy of transformation is set to centered. Use the rotation tool and turn until the text that you want at the top of the circle.

  • Is there a quick and easy way to rearrange the data off interlaced?

    I collect 5 channels of data through a FIFO DMA by interlacing, then save them in a PDM file. When I check it, it is in good condition for the most part, but there are some points where the channels get switched. For example, channel order when I open the file is 1 2 3 4 5, as expected, for the thousands of several elements. But at some point, he gets 4 5 1 2 3 and later 2 3 4 5 1. Left to right, they are always classified correctly, so it is easy to rearrange them, but very painful along with millions of elements. I have attached some examples of data. I'm looking for A) a way to prevent this or B) some kind of sorting tool or script in DIAdem or LabVIEW can sort for me. I'll work on a scenario of sorting in the meantime.

    I use 2011 LabVIEW Real-time and FPGA 2011 and the standard open and write TDMS functions. I also have access to tiara.

    Seems to me that the problem is that you do not remove the elements of the FIFO in multiples of your number of channels.  Array decimate returns always arrays of equal length.  If the size of the input array is not a multiple of the number of tables of output, it falls out of the elements, and that's where you lose data.  You must round down the number of elements to read to the nearest multiple of the number of channels - I would insert a "Quotient and remainder" function with the divisor as the number of channels and subtract the rest by the number of items.

  • How can we ignore the video when importing? I am aware that it took 4 years ago, but I don't know that there must be a better way today?

    I am currently evaluating lightroom to replace Apple's Aperture as is the end of LIFE. I am a professional filmmaker who made a few pictures on the side. Lightroom 6 emphasize the import of videos, unless I have clear them manually during import. I ABSOLUTELY NEED to divide probably photos and videos on various imports and paths to backup IMMEDIATELY when I put the card into the computer on the tray. This way of manual de-selection is stressful, slow and prone to error. It hates me lightroom - I love otherwise - on each import of the card.

    Is it really now way to tell lightroom to ignore the .mov files and stick to the photos? It is very difficult to believe for a professional software and unfortunately would be a dealbreaker for me.

    Would like to find a way to do it, then I would be able to commit to the ambient light for my photo needs.

    Best

    Gerrit Haaland

    YACHTFILM.tv

    Hi GerritH,

    If you use Lightroom 6/CC, there is no way to deselect the videos, but what you can do is to change the sort order to media type and unselect all the videos at the time of importation.

    • Press "check all".
    • Sort by "media type".
    • Select all video files (select a first + press shift + select last)
    • remove the flag on a single video file (this uncheck all selected video files)
    • Press on import.

    If you use Lightroom 5 or earlier, there is a hidden option: hold down the Alt/Option key and "check all" and "Uncheck all" buttons turns in "check videos ' and 'Videos to uncheck', respectively." From there you can asily choose to imp [tro photos or video only.]

    Concerning

    Sarika

  • integrated in windows xp help and support center does not work. can I uninstall and reinstall then or there at - it an easier way?

    I have a win xp update, but there seems to be a problem with the help and support section. whenever I have open and try to run some of the tests to keep my healthy system it stops. any ideas?

    Malcolm

    Startup of the service or re-registration a file sometimes solves it. Open a run window (Windows Logo key + R), type services.msc and press ENTER. Scroll down to help and Support, and then double-click it. Click on the Start button in the dialog box and change the type to automatic startup.

    In a run window (Windows Logo key + R), type regsvr32 hhctrl.ocx (note the space) and press ENTER.

  • (3) all my computers have the same problem with installing KB953297. Microsoft must provide an easier way to solve this problem. Obviously a lot of people is affected.

    End users should not have to be remove and reinstall anything. Get it together!

    Can you guys try the following steps:

    1 uninstall .net Framework 1.1 from Add/Remove programs
    2 run the .net Framework Cleanup Utility and remove all .net Framework 1.1 related Articles (located here: http://blogs.msdn.com/astebner/archive/2006/05/30/611355.aspx)
    3 Windows Update to download updates.
    4 reboot and redo the update of Windows

    Can you let me know if you find any success?

    Thank you! If you find my answer was what you're looking for, remember to click on the box "mark as answer" below!

  • Is there an easy way to update from CC to CC 2015 2014 without having to delete each of the elements of the CC 2014 before putting in?

    Have currently CC 2014 company loaded on University PCs. users are requesting the update to 2015 CC. We have currently remove components CC 2014 before the PC can be updated until 2015 for CC. There must be an easier way.

    Packages that are installed in the subdirectory 'Build' must be uninstalled using the same package, namely by running the msiexec command with the / uninstall switch, for example

    start/wait msiexec / uninstall/SB NomPackage.msi

    To uninstall a package CCP on OS X from the command line or a script, use the uninstaller PKG file, for example:

    sudo Installer - pkg Muse_Uninstall.pkg - target /.

Maybe you are looking for