If not all the work instructions

So I have some if statements set up in a series. If I use combination else if anything works, but simply if only statements of them does not work. The ultimate goal is that all the results are numbers 1-9.

Here is my code:

var numTag = 30;
trace("Initial: "+numTag);

if(numTag>9){numTag-=9; }
if(numTag>18){numTag-=18; }
if(numTag>27){numTag-=27; }
trace("Result: "+numTag);



I have tested with 3 different input variables: 30, 22-15.

Here are the tracks from the output results:

Initial: 30
Result: 3
Initial: 22
Result: 13
Initial: 15
Result: 6



As you can see the first and the last pair, 30: 3, 15:6 are met however the Central pair 22:13 is not true that it takes 22:4.

That's what I'm trying to establish:

If the numTag variable is greater than a multiple of 9, then subtract multiples of nine that he is superior.  The variable which in the first case, is of 30, to the nearest multiple of 9 that 30 is superior to the East of 27, I so subtract 27 and get 3.

Even with the last of them, when I plug 15, 15 is not greater than 27 or 18 but it is greater than 9, I so subtract 9 and get 6.

But why is it when 22 (or any other number that is greater than 18 but less than 27) entered it subtracts 9 instead of 18?

It's a temporary solution, my ultimate goal is to get a system that has a variable instead of the numbers hard 9,18,27 and this variable would be multiples of nine based on the variable numTag. I played with the switch statements and for loops and I've had enough, it seems like a good solution for the variable numTag at least up to 27. I want the numbers to reset the numTag and keep it in numbers 1-9.

of course there

if((numTag % 9) == 0)
    {
        numTag = numTag /9;
    }
else
    {
        numTag = (numTag % 9)
    }

Tags: Adobe Animate

Similar Questions

  • ArraytoChannels error 'cannot be added because the channels of the target are not all the same length.

    Hello!

    After the end of my second day of test error, I put this question on the table:

    I use ArraytoChannels function to store ADO recordsets as strings. What is strange, is that for the first Recordset, it works; but for the next time through the loop, it always fails with the error message 'cannot be added because the channels of the target are not all the same length.

    I confirmed that:

    the RowData sizes and the ChannelNames are equal,

    both spend the isarray = true test,

    I change the order of the ChannelNames,.

    I have reconnected/disconnected from the oConnexion every time, nothing has changed.

    Apparently I'm missing something - but crazy to know what! -If anyone can share his opinion I'll so much appriciate. Here is my code:

    oTables = Array ("WellStates", "ChokeData", "WellParameters", "FlowData", "PumpData", "SensorsData", "ModelCalculatedData")

    Call OpenSQLConnection
    Set oRecordset = CreateObject ("ADODB. Recordset')
    Call SelectWell
    Call GetWellStateIDs

    Data.Root.Clear
    for j = 0 to ubound(oTables,1)

    sSQLSting = "select * []" & oTables (j) & "] where [WellStateID] between" & WellStateIDFirst & "and" & WellStateIDLast ".
    oRecordset.Open sSQLSting, oConnexion
    Protected oFieldNames: table: ReDim oFieldNames (orecordset. Fields.Count - 1).
    for i = 0 to orecordset. Fields.Count - 1
    oFieldNames (i) = orecordset. Fields.Item (i) .name
    next
    oArray = oRecordset.GetRows (-1, 0, oFieldNames)
    Set oGroup = Data .root .ChannelGroups .Add (oTables (j))

    oArray, oFieldNames arraytochannels
    oRecordset.close
    oConnection.Close
    next

    Sub GetWellStateIDs
    sSQLSting = "select * from [WellStates] where [wellid] =" & WellID
    oRecordset.Open sSQLSting, oConnexion
    oArray = oRecordset.GetRows)
    WellStateIDFirst = oArray (0,0)
    WellStateIDLast = oArray (0, ubound(oArray,2))
    oRecordset.close
    EndSub

    Sub OpenSQLConnection
    Set WshNetwork = CreateObject
    oComputerName = WshNetwork.ComputerName
    oDB = "MX2. Player.DB ".
    Set oConnexion = CreateObject ("ADODB. Connection")
    oProvider = "Provider = SQLOLEDB.1; Integrated Security = SSPI; PeoExecuteist Security Info = True; Data Source ='
    oProvider = oProvider & oComputerName & "\MX; Use procedure for prepare = 1; Machine translation = True; The packet size = 4096; Workstation ID ="
    oProvider = oProvider & oComputerName & " Use encryption for data = False; Tag with column collation when possible = False; Initial Catalog ='
    oProvider = oProvider & oDB
    oConnection.ConnectionString = oProvider
    oConnection.Open
    EndSub

    Another clue. If you check using DIAdem

    Microsoft Windows Script Debugger

    you are able to install the debugger in DIAdem.

    It would potentially have shown that the command does not work as expected.

    Sorry for the inconveniance

    Andreas

  • Could not create the work file. Check the temp environment

    After I did my Vista SP2 update, the only thing I could do was to reformat the HD. After all, including Office 2007 reloading, Outlook and work has worked well. Again, I went through the updates, Vista and Office SP 2 and now in Outlook and Word I get this error message Outlook (Word) could not create the work file. Check the temp environment

    variable. I am alos having other problems in Word. Help, I can't find all the answers!

    Follow the steps below at our own risk.  Set a restore point before doing this. Make a mistake in the registry can have bad results

    In your registry HKEY_CURRENT_USER\Software\Microsoft\Windows\Current Version\Explorer\User Shell Folders\Cache Database Cache data value must be %USERPROFILE%\Local Settings\Temporary Internet Files

    Close all programs. Then in the registry editor, once you get in the folder above, right click on "Cache", make a left-click on "Change", paste in "%USERPROFILE%\Local Settings\Temporary Internet Files" (without the quotes), on the left, click 'Ok' close the editor of the register. Restart the PC.

    This should solve your problem.

    - Http://blogs.msdn.com/powlo/archive/2007/01/01/fix-for-error-outlook-could-not-create-the-work-file.aspx

    a. start-> Run-> enter "regedit" and press "Enter" to run the program to change registry variables.

    b. navigate to the folder-> "HKEY_CURRENT_USER\Software\Microsoft\Windows\Current Version\Explorer\User Shell Folders\Cache"

    c. check the values of variables [for everything in the "User Shell Folders" folder] - all the variable should have values from '% USERPROFILE%\ '. ». Any variable that is not of this starting point is probably damaged. In my case, all variables corrupt has been a correspondent of "Backup_VariableName". Example: my variable "cache" was damaged when there is a variable called 'backup_cache' with the correct values

    d. change the value of variables corrupt to correct the values. Example of change variable value "cache" in "%USERPROFILE%\Local Settings\Temporary Internet Files" and so on.

    e. close all of Ms Office programs, and turn. The problem should be solved now.

    I added the text in square brackets [] above.

    Microsoft partner - "gentlemen, you can't fight in here! This is the war room. »

  • Why my internet stops now and then not all the time trying to upload links to pdf files

    I wonder if there is a problem with my computer or if I need to install a program? My internet stops now and then not all the time trying to upload links to pdf files.

    Hello

    1. what browser do you use?

    2. have you done any hardware changes or software on your computer before this problem?

    3. you receive an error message when internet no longer works?

    4. what exactly you mean by pdf files download links?

    If you use Internet Explorer, you can follow this link:

    Tips for solving problems when Internet Explorer hangs or stops working

    Reference: Cannot display PDFS on the web

    Display PDF files in Internet Explorer, AOL | Acrobat 3D, Acrobat Reader 7 7

    Hope the helps of information.

  • I can not all the sounds from my computer

    I can not all the sounds from my computer. I hae tried to click place volume icon in the taskbar, but it won't let me and she also come with 'there is no active mixer device. To install mixer devices, go to control panel, click Printers and other hardware, and then click hardware, but it's not it will fade. Please can someone help me.

    The sndvol32.exe file is possibly corrupt.

    To replace, there are two methods:

    (1) open the Windows Explorer > tools > Options > view > make sure that show hidden files and folders is NOT checked. Access the c:\windows\system32\dllcache and locate sndvol32.exe > copy it into the following folder c:\windows\system32, overwrite the existing file. > Re-boot, you should now have access to your sound mixer and be able to place the icon on the taskbar. If for any reason any you do not find the dllcache folder:

    (2) put your XP CD in a driver, don't let it start. Then: Start > run > type in msconfig > enter or OK > extract a file > 1st enter in sndvol32.exe > in the second point of the box to your CD player > 3rd enter in c:\windows\system32 > extract file > run over if necessary, close everything and restart.

    If the above does not work, re - install you 'audio drivers, although I would only do it as a last ditch measure.

    See you soon,.

    Jerry

  • I can not all the sounds of my Asus A 6000 after installing Windows 7.

    * Original title: sound on asus has 6000

    can someone help me?  I can not all the sounds of my Asus A 6000 after installation of windows 7.

    where can I find the right drivers?

    Thanks John

    There is no native driver Windows 7, but you can download the latest driver available to install in compatibility mode.

    http://www.ASUS.com/support/download/3/41/0/6/17/

    To learn more:

    You can find more information on compatibility modes in the articles below:

    http://Windows.Microsoft.com/en-us/Windows7/what-is-program-compatibility

    http://Windows.Microsoft.com/en-us/Windows7/make-older-programs-run-in-this-version-of-Windows

    http://Windows.Microsoft.com/en-us/Windows7/Program-Compatibility-Assistant-frequently-asked-question

    also check:

    http://Windows.Microsoft.com/en-us/Windows7/tips-for-fixing-common-driver-problems

    http://Windows.Microsoft.com/en-us/Windows7/update-a-driver-for-hardware-that-isn ' t-work correctly

  • The Inbox in the mail application does not all the messages that I can see through the Web browser

    I have a similar problem with the Mail application on Surface 2. Inbox does not all the messages that I can see through the Web browser. I chose E-mail download of any time in the account settings. But when it sync randomly takes messages in the Inbox to display. I uninstalled the app, restarted the Surface and again installed in the Windows store. But the problem remains. It's frustrating. I think the app is not fully developed.

    His works now. I did the sync and other things with no results. Then I noticed that my missing messages are somehow appearing in the file of the Newsletter. Then, I moved all the messages in the Newsletter folder in Inbox and unchecked it parameters. It's working now. There are apparently some bugs in the software that allows for the Newsletter to divert messages. In any case thanks for checking.

  • Could not submit the working ' PSP: create Distribution lines.

    Hello

    I am new to the distribution of work and when I try to send the job ' PSP: create Distribution lines ", I can't pass any value for the parameter"Source Type"- there not all valid values (it's a valid table valueset).

    Before attempting to run this job, I ran the ' PSP: import pay Transactions of MFC.

    Could someone please guide me if I am away no matter what stage between the two?

    Please advice.

    Thank you
    Sagar

    Thread double (please post only once).

    Could not submit the working ' PSP: create Distribution lines.
    Re: Can not submit the working ' PSP: create Distribution lines.

    Thank you
    Hussein

  • Why are they not all the photos on my phone on icloud?

    Why are they not all the photos on my phone visible on icloud?

    You have settings > iCloud > iCloud library turned on in the phone? Since how long you turn on this setting? Have you been connected to wi - fi? How many photos is on iCloud and how much is missing?

  • Playlists imported, but not all the songs won't matter

    I exported my playlists my macpro mnt lion and when I used my thumbdrive to import on my macbook pro (mavericks) some, but not all the songs from the imported selections. It just says: the files can be found--just before this that I imported the entire library, so I know that my whole library is on the macbook pro.

    Some files are mpegs and some are AAFC, but there is no correlation with what files are transferred correctly as its both.

    MacPro (mnt lion)--> macbook pro (mavericks)

    You must transfer your complete (in one piece) iTunes folder, which should include all your media files and your iTunes library database (where are stored the data supporting such as playlists, ratings, play count, date added, etc.).  Then iTunes on the new Mac looks like iTunes on the old Mac, with all your songs and playlists, because you use the SAME library. you do not add your media files to a new library.

    If you want more information on how to do it, instead of your playlist Exim problem troubleshooting, please post back.

  • Error message Microsoft Word "Word could not create the work file. Check the amount of disk space on your startup disk. »

    I have a MacBook Pro, retina 13inch OS X el Capitan Version 10.11.1 with 16 GB of memory. It's brand new and I have recently installed Microsoft Word/Powerpoint etc. a disc that I bought a few years to my previous MacBook. It seems to work very well, but whenever I want to open a word document a message comes up saying "Word could not create the work file. Check the amount of disk space on your startup disk '. However, once I click 'OK' this message disappears and my word file opens without a problem. I have 16 GB of memory on this laptop and it's new I have not reached anywhere near the maximum amount of storage so I'm puzzled as to what this message means. How can I avoid that this message popping up everytime I open Microsoft Word? Any help would be appreciated!

    This has nothing to do with memory - it's the SSD. Word tries to create a temporary file to use as a backup if the program crashes while you are working. First, run the Microsoft Update program to see if there are updates you have missed. Second, Microsoft currently supports only versions 2011 and 2016, so if yours is older, you should consider the upgrade. Thirdly, I suspect that the temporary file is not get created so that you have fewer cancellations (maybe any) and that if the program crashes you have to restore.

  • Not all the images in camera roll synch with my photo stream

    Sometimes, not all the photos taken on a certain day through synch Camera Roll (iPhone 6s) until my photo stream.  My understanding is that, once under WiFi coverage, all photos taken by the phone's camera will synchronize with photo stream, assuming there is enough storage.  Any ideas why this might happen?  Thank you.

    My photo FAQ - Apple Support stream

    Get help using my photo stream - Apple Support

  • I just put a graphics card and I can not all the sounds of my hdmi on the back of the Badr

    Radeon hd5450

    I just put a graphics card and I can not all the sounds of my hdmi on the back of the Badr

    Hi Edrey Davila,

    1. what operating system is installed on the computer?
    2. are you sound the computer?

    If you connect your computer to the TV using a HDMI cable, try the steps from the following link:

    Connect your computer to a TV
    http://Windows.Microsoft.com/en-us/Windows7/connect-your-computer-to-a-TV

    HDTV: Frequently asked questions
    http://Windows.Microsoft.com/en-us/Windows7/HDTV-frequently-asked-questions

  • Cannot install Silverlight, get error 1503, CPU does not support the SSE instruction set that Silverlight requires to run

    Original title: silverlight

    I tried to install Silverlight on my computer running Windows XP 32-bit with service pack 3. My question is, it downloads and then when I try to install, it appears that my CPU will not Silverlight support. I get the Message 1503, CPU does not support the SSE instruction set that Silverlight requires to operate.

    So here's my question... How can I fix it? And what is the problem? Any help would be appreciated... Is it a I need a new operating system problem or just a cranky computer problem?
    Thank you
    Lynn

    I tried to install Silverlight on my computer running Windows XP 32-bit with service pack 3. My question is, it downloads and then when I try to install, it appears that my CPU will not Silverlight support. I get the Message 1503, CPU does not support the SSE instruction set that Silverlight requires to operate.

    So here's my question... How can I fix it? And what is the problem? Any help would be appreciated... Is it a I need a new operating system problem or just a cranky computer problem?
    Thank you
    Lynn

    ========================================
    This means that your material is not up to the task.

    If you search the Forums Silverlight 1503
    you will find that you are not alone.

    Silverlight .NET forums
    http://forums.Silverlight.NET/search

    The following article explains what is a CPU.

    Central processing unit
    http://en.Wikipedia.org/wiki/Central_processing_unit

  • I'm not all the sounds from the speakers. The volume is up

    I'm not all the sounds from the speakers.  The volume is up

    The following links may be worth a visit:

    No sound in Windows
    http://Windows.Microsoft.com/en-us/Windows/help/no-sound-in-Windows
    (Win XP / Vista / 7)

    (307918) how to troubleshoot sound problems in Windows XP
    http://support.Microsoft.com/kb/307918/en-GB

Maybe you are looking for

  • Can I remove an application?

    Is it possible to remove an application from the appstrore? How can I do?

  • Windows Server R2 2012 domain server has problem of tombstone

    8614 directory service cannot replicate with this server because the time since the last replication with this server has exceeded the tombstone lifecycle. I have a primary domain server and five additional domain controller (all servers running wind

  • Parental account block

    Summary of the issueOther Windows Live Messenger questions Have you received an error code or message? NO. Please enter the code of the error or message you received 38 Please provide your address affected: E-mail address is removed from the privacy

  • vseamps.exe application error

    Whenever I turn on my computer, I get this error message that reads as follows: "vseamps.exe application error.  The instruction at "0x7c91b219" referenced memory at "0x000000" memory could not be "written".

  • RV042/RV042 file sharing

    Cannot access shares on the remote computer. Mapping remote West works digitized NAS. Ping works. Print shops. JuUST impossible access shares via: \\10.10.197.2\sharename RV042 Firmware Version: 1.3.12.19 - tm of advice?