Shorten if / if not string

I wonder if there is anyway I can integrate the information to an If / Else statement in a central location instead of having to write all that. My form takes a gross weight of the trailer and subtract the weight of the trailer unladen. What I have works, but is bulky and takes a lot of memory. Here is a partial example (add 35 trailers more and 13 entered form):

Else if (this.getField("QTrailerF").value == "1R793")

{

If (heelf > 0) event.value = heelf-13360.

}

Else if (this.getField("QTrailerF").value == "1r793")

{

If (heelf > 0) event.value = heelf-13360.

}

Else if (this.getField("QTrailerF").value == '8058')

{

If (heelf > 0) event.value = heelf-22480;

}

Else if (this.getField("QTrailerF").value == "1R504")

{

If (heelf > 0) event.value = heelf-13200;

}

Else if (this.getField("QTrailerF").value == "1r504")

{

If (heelf > 0) event.value = heelf-13200;

}

Else if (this.getField("QTrailerF").value == "1R553")

{

If (heelf > 0) event.value = heelf-13300.

}

Else if (this.getField("QTrailerF").value == "1r553")

{

If (heelf > 0) event.value = heelf-13300.

}

Else if (this.getField("QTrailerF").value == '4180')

{

If (heelf > 0) event.value = heelf-13090;

}

Another thing to do to make the shorter code is to compare case-insensitive like this (instead of the two conditions above):

if (heelf>0) {
    if (this.getField("QTrailerF").value.toUpperCase() == '1R793') { // this covers both 1R793 and 1r793
      event.value = heelf-13360;
    } // etc.
} else {
    // ???
}

Tags: Acrobat

Similar Questions

  • BlackBerry Smartphones shortened speaker keyboard not working not

    When I select the speaker key (w / a sign $), I come with a search box and a sign $. Speaker is not access. I can't assign a hotkey for dorrect? tried to hold the Alt and shift keys as well. Always comes back with 'Web sugggestions Bing '. How can I get the speakphone to work with a simple key? Thank you

    You must be in a call for the speaker to work key

  • Shortened CS5 does not save

    I tried to create some custom keyboard shortcuts sets to spread until a task force of 25. The shortcut sets are created to be able to easily get dictionary preferences and another to access dynamic spelling. Shortcuts sets work very well a couple of times and then disappear shortcut keys, that I put in place. I then have to recreate them. To the best of my knowledge I'm creating everything correctly.

    There was a post from August 12, 2011, on this problem but it was for a Windows operating system, so it is difficult for me to say what is the solution for this problem.

    I'm on Mac OS X 10.6.6 InDesign CS5 version 7.0.3. If there is no more specific information, someone needs it please let me know.

    If anyone has had this problem, and if so, how we solved. All suggestions will be welcome.

    It's a good idea to restart InDesign after you create new shortcuts or preferences. Sometimes, the settings are not saved until you quit, so if InDesign closes abnormally (accidents, or you do a Force Quit), newly changed settings may be lost.

    You do not have Force Quit InDesign, do you think?

    I'd like to update 7.0.4. worry about these problems, but anyway, before you restart InDesign after setting a new shortcut and make sure it works [always].

  • Tree with itemRenderer can have variable line heights (not string data)?

    Is it possible to create a tree that use itemRenderer for the variable row height?

    In my itemRenderer, I create a HBox for each line.

    For some lines, I want to show VBox with several objects like ComboBoxes as his children.

    The VBox overlaps the next line.

    You need to change the Measure [] method to accurately measure your component.

    Alex Harui

    Flex SDK Developer

    Adobe Systems Inc..

    Blog: http://blogs.adobe.com/aharui

  • game-vmguestnetwork interface will not take string for dns-


    I'm tryign to form a script that will respond to differences in the number of ip of the dns and wins.  I can't pass a string to the dns - for setting the ip address.  I say $dns1, dns2 $ and it works but if I create a channel and send it there is an invalid dns error.

    Basically im import values and the wantign to check $dns1 and $dns2 and always send the $dns variable like it that my csv might have 2 dns for some servers and 1 victories for an another vs 2 both as a difficult standard.  I noticed that the cmdlet does not like spend you a varialbe $null.  any ideas, my goal is to not have a CSV with two dns and wins and let me build the logic to generate the string to the question of whether they have a value associated with them for a particular server-based dns and wins.

    $vmServers = import-csv $Import | Select name of the server, name, ip, subnet, gateway, dns1, dns2, wins1, wins2


    ($server in $vmServers){

    $computer = $server. ServerName

    $name = $Server. name

    $ip = $server. ip

    $subnet = $server. subnet

    $gateway = $server. entry gate

    $dns1 = [string]$server. DNS1

    $dns2 = [string]$server. DNS2

    $wins1 = [string]$server. WINS1

    $wins2 = [string]$server. Wins2


    #DNS to analyze how many DNS entries is required Max is two, but PowerShell will not accept a null value



    if ($dns1 -ne ""){

    $dns = $dns + $dns1

    if ($dns2 -ne ""){

    $dns = $dns1 + "," + $dns2

    Here's what im everything to get. I can't pass the $dns value if it is only one variable then it works.  Soon, as I have ip, ip and try to pass as $dns it fails.  The cmdlet says it requires a chain, but it is of course no exception.  If I type in manually from the intellectual property that it works very well the question is only forming a chain above with the dns for a particular server and if there is more than one IP so fails, even though my format is exactly the same as if I typed manually in DNS.

    game-vmguestnetworkinterface

    -GuestUser $AccountForOSAuth -GuestPassword $PasswordForOsAuth -vmguestnetworkinterface $nic -ippolicy static ip $ip -netmask $subnet -Gateway $gateway -dnspolicy static dns $dns -winspolicy static -wins $wins


    Hello, Foker-

    As this DNS setting - takes an array of one or more strings, you can append these DNS not null strings in a table and then use this table for the value of the parameter.  Thus, for the part of DNS-determination, something like:

    ## make empty array$arrDNSStrings = @()## for each potential DNS string, if not null or empty, add its value to the array of DNS strings$dns1, $dns2 | ForEach-Object {if (-not [String]::IsNullOrEmpty($_)) {$arrDNSStrings += $_}}
    
    ## then, call Set-VMGuestNetworkInterfaceSet-VMGuestNetworkInterface -GuestUser $AccountForOSAuth -GuestPassword $PasswordForOsAuth -VmGuestNetworkInterface $nic -IPPolicy Static -Ip $ip -Netmask $subnet -Gateway $gateway -DnsPolicy static -Dns $arrDNSStrings -WinsPolicy Static -Wins $wins
    

    Which means that at least one of the $dns1 and $dns2 has the value (not null).  If you say that both can be void/null, but you use another entry for everything (as indicated by the original $dns variable in your code), you could add that, "for all" DNS value in the table $arrDNSStrings to start - just add after the initialization of the $arrDNSStrings empty table.

    How does do for you?

  • [LAVA Cross Post] CTRL + SHIFT + Alpha shortcuts do not work in LabVIEW

    Cross-post from the LAVA: http://lavag.org/topic/15619-ctrlshift-shortcuts-sometimes-not-working-in-labview/

    Bug Synopsis: CTRL + SHIFT + Alpha shortcuts do not work in LabVIEW. In particular, CTRL + SHIFT + Z, CTRL + SHIFT + E and CTRL + SHIFT + S

    Test installation: 32-bit LV2012 with the patch of f1 running on Win7 64-bit inside a Parallels VM in OS X 10.8.1 8

    To sum up the tests, I tried:

    • Several different combinations LabVIEW, guest OS and host OS all fail, including:
      • LV2012f1 32 and 64-bit and 32-bit LV2009
      • Win7 32 and 64-bit and Windows XP x 64
      • Parallels and Parallels 7 8
      • OS X 10.7 and 10.8
    • Capturing the keyboard to the virtual machine
    • Turn each keyboard setting possible on Parallels, guest and host
    • Reinstall the keyboard drivers
    • Connect a checked keyboard that works on a native Windows machine
    • LabVIEW.ini deleting and letting it regenerate
    • Remapping the shortcuts, for example, CTRL + SHIFT + E to CTRL + E - in this case, 'Show project' works, so this may indicate that it is a problem registering the shortened press, do not invoke the action itself.
    • Sending via the keystrokes on-screen keyboards of guest and host
    • Sending the sequence of keys via SendInput by user32.dll WinAPI
    • Test every imaginable combo of SHIFT, ALT/OPTION, FN, COMMAND/CMD, CONTROL
    • Reinstall the virtual machines from scratch and relocation of LV
    • Here's a kicker: CTRL + SHIFT + Alpha shortcuts work very well on other windows programs (I tried 4 different programs, including Chrome, Notepad ++, Paint.NET), but it does NOT work for VIPM with CTRL + SHIFT + C. This means that only two programs where there are CTRL + MAJ + Alpha bugs are both related to LabVIEW.
    • Here's a better: it is only CTRL + SHIFT + Alpha shortcuts with the prob - CTRL + SHIFT + 3 properly active / deactivates grid alignment and the "tools > Options > Menu shortcuts" will record any shortcut CTRL + MAJ + Non-alpha; He was not only meets the shortcuts CTRL + SHIFT + Alpha.

    New idea of troubleshooting is highly appreciated; Please feel free to jump in here or on the LAVA.

    X. says:

    Still well and alive in Parallels 9 and LabVIEW 2013 SP1. Of course I could upgrade the latest versions to see if things have become more.

    Any news on that?

    @mellroth has found the solution :-)

  • String.Contains)

    Hello!

    Im trying to do a search, RIM SDK is not String.contains ().

    I need to do something like this:

    I have a list with several names like Jonh Man, sesame Road, Mary Jane...

    The user input: ROAD = userInput

    I return all words with the road, such as:

    Sesame road myWord [0]

    Long road myWord [1]

    Road test...

    St. road...

    How do I compare with my words of vector user input?

    If I contains, I'd do something like that...

    {if (userInput.Contains (myworld [i]))}

    output...

    }

    THX...

    Use string.indexOf ("word", 0)... If it returns 0 > then you can add vector myWord otherwise not...

  • String class

    Why print the String object in class displays the content of this variable and do not String@H=hashCode (). ?

    wbecause, if you print an object reference, and then uses toString() to print message internally, which is originally written in object class with ' getClass () .getName () + ' @' + Integer.toHexString (hashCode ()) "logic." but in the class String ToString is overridden to print the contents of the string.

  • java.lang.String cannot be cast as a java.util.Date when using validateDateRange

    I use Jdev 11.1.2.0.0

    I have a StartDate and EndDate attributes that are used to get the date range

    My requirement is to show an error if the conditon EndDate > = StartDate is not satisfied

    For this I made use of validateDateRange

    < af:inputDate value = "#{bindings." StartDate.inputValue}.

    label = "#{hcmmexicoreportsuiBundle.start_date} '"

    required = "#{bindings." StartDate.hints.mandatory}.

    columns = "#{bindings." StartDate.hints.displayWidth}.

    shortDesc = "#{bindings." StartDate.hints.tooltip}"id ="id2 ".

    partialTriggers = "sbr1 id3.

    Disabled = "#{HcmWeeklyInquiryBean.disableDates} '"

    autoSubmit = "true" >

    < f: validator binding = "#{bindings." StartDate.validator} "/ >"

    < af:convertDateTime pattern = "#{bindings." StartDate.format} "/ >"

    < / af:inputDate >

    < af:inputDate value = "#{bindings." EndDate.inputValue}.

    label = "#{hcmmexicoreportsuiBundle.END_DATE} '"

    required = "#{bindings." EndDate.hints.mandatory}.

    columns = "#{bindings." EndDate.hints.displayWidth}.

    shortDesc = "#{bindings." EndDate.hints.tooltip}"id ="id3 ".

    partialTriggers = "sbr1 id2.

    Disabled = "#{HcmWeeklyInquiryBean.disableDates} '"

    autoSubmit = "true" >

    < f: validator binding = "#{bindings." EndDate.validator} "/ >"

    < af:convertDateTime pattern = "#{bindings." EndDate.format} "/ >"

    < minimum af:validateDateTimeRange = ' #{bindings. " StartDate.inputValue}.

    messageDetailMinimum = "#{hcmmexicoreportsuiBundle.END_DATE_SHOULD_BE_ON_OR_AFTER}" / >

    In the View object:

    < ViewAttribute

    Name = "StartDate".

    IsSelected = "false".

    IsPersistent = "false".

    PrecisionRule = 'true '.

    Type = "Oracle.jbo.domain.date"

    ColumnType = "DATE".

    AliasName = 'VIEW_ATTR. '

    SQLType = 'DATE' >

    Properties of <>

    < SchemaBasedProperties >

    < FMT_FORMATTER

    ResId="hl.hcm.rpt.model.view.HcmWeeklyInquiryCriteriaVO.StartDate_FMT_FORMATTER"/ >

    < FMT_FORMAT

    ResId="hl.hcm.rpt.model.view.HcmWeeklyInquiryCriteriaVO.StartDate_FMT_FORMAT"/ >

    < CONTROLTYPE

    Value = "date" / >

    < / SchemaBasedProperties >

    < / properties >

    < / ViewAttribute >

    < ViewAttribute

    Name = "EndDate".

    IsSelected = "false".

    IsPersistent = "false".

    PrecisionRule = 'true '.

    Type = "Oracle.jbo.domain.date"

    ColumnType = "DATE".

    AliasName = 'VIEW_ATTR. '

    SQLType = 'DATE' >

    Properties of <>

    < SchemaBasedProperties >

    < FMT_FORMATTER

    ResId="hl.hcm.rpt.model.view.HcmWeeklyInquiryCriteriaVO.EndDate_FMT_FORMATTER"/ >

    < FMT_FORMAT

    ResId="hl.hcm.rpt.model.view.HcmWeeklyInquiryCriteriaVO.EndDate_FMT_FORMAT"/ >

    < CONTROLTYPE

    Value = "date" / >

    < / SchemaBasedProperties >

    < / properties >

    < / ViewAttribute >

    I don't know why this error occurs because the type is not string and Date

    Thank you

    ASHA

    Can u try this?

    Thank you

    Alisson

  • How can I switch the PROPERTY_FALSE as string

    Hello

    How can I switch the PROPERTY_FALSE & the PROPERTY_TRUE as string to
    Set_Item_Property('MY_BLOCK.) MY_ITEM', ENABLED, PROPERTY_FALSE);

    My requirement is to write a procedure as enable_fields(P_PROERTY_VALUE..) to enable or disable many items according to the value that I spend.

    Set_Item_Property('MY_BLOCK.) MY_ITEM', ENABLED, P_PROERTY_VALUE);


    Thanks in advance.

    Infact, property_false and property_true are not strings, they are consistent with the values 5 and 4 respectively.

    So wherever you want to have property_false, spend 5
    and property_true, pass 4

    But usually we do not follow this method, as the value of the constants may vary from one version to the other.

    So in your procedure to say, go for turn 1 and 2 to disable

    procedure (................, p_property number) is 
    
    m_set_enable number ;
    Begin
    If p_property = 1 then
       m_Set_enable := property_true;
    else
    
       m_Set_enable := property_false;
    end if;
    ....
    ..
    set_item_property('item1',enabled,m_set_enable);
    ...
    End;
    

    Published by: Dora on December 29, 2009 14:36

  • The image does not

    Everything works - relations exist-, but not to load images.

    Problem solved. And in the case of any other newbies are reading, if you link a picture make sure it is not nested. If you drag and drop your image in the files Panel, you will receive something like that,and you don't want that - it will be nested when you open then 'Get the schema' and you will not be able to capture the image. Trust me.

    If you want to continue to drag-and - drop, then delete and just keep the filename, for example images/picture.png. They mention in all the XML tutorials, make sure that each character is perfect; Otherwise, once again, the problems.

    Then, when you create your XML data set in your main file, make sure that you give your image the designation "link to image", not "string".

  • Search for string in SQL Developer

    Hello

    I am trying to run a search function in SQL Developer, which locates a string in database objects. I can't find out how to do it-if it is possible. I just saw that I can search for objects not strings in their breast. How to find all the procedures/functions which includes a specific string?

    Concerning
    Marika

    Reports | All reports | DataDictionary reports | PL/SQL | Search the Source Code

  • How to make my mouse behave

    Is it possible to desensitize this undisciplined mouse? Put a Governor on it? The SHIFT key in the LOW speed?

    Will go back in my inbox at Mac tools and (hopefully) get one of the old mouse to use instead of this rat mini bouncing things around the screen that makes me sick at heart. Come on Apple too in this neuromuscular rodent for us with some difficulties. My fingers/hands tremble sometimes uncontrollable and things fly around on the screen. Go to the point on something and I'm "Chase" it as moves slightly off screen. I can grasp like a gorilla, but the keyboard and mouse are not strings, wheel or pick and shovel (no problem!). Tired of this mischievous mouse. The trackpad yuck!  Please try your hand think he's on the keyboard of a piano! No sympathy needed here. Always walk on the green side of the grass to 71 and love every day!

    Have you tried the speed of tracking for your mouse in system preferences?

    Go to the Apple Menu > System Preferences > mouse and move the slider to speed track toward slow and see if that helps.

  • C# activeX

    I have a project that must translate into the joint of c# code in LabVIEW GUI (CSharp_EventLog.pdf), doing some basic code shown as EventLog.PNG, but seems not working do not. I send events server side, but this piece of code only gets no answer. I'm not familiar with ActiveX controls, and c#, need some suggestions on:

    1 at - it hurt with my LabVIEW code, why there is no response from the event? Read c# code, it seems class cast and/or Automation refnum mount? don't know how to code in LabVIEW.

    2. in call back vi, the event data are the variant, I expect string.

    Thanks in advance.

    Jason

    It seems that you do not receive the event data, but the reference to the event object. You need to convert ActiveX object, not string. Then you can work with the activex object: get properties (property node should show Date field similar c# is evt.) Date) and call methods (GetEventKey (evt)).

    You can't write something in c# like ToString (evt). Maybe you can, but you will get the same hexadecimal number 64 bit, not the event data. You write ToString (evt. (Date) - get evt first Date field, and then display it as string.

    To convert, you need constant class specifier. Copy TCEVENTLogger... control point vi, convert it to a constant and select class ActiveX correct (something like the TCEVENTLOGGERLib event).

  • Count the number of zero terms between non zero terms

    Hello.  I have a table of data of zero and nonzero (example: {1 2 56 2 3 0 0 0 0 0 2 3 5 2 3 5 2 0 0 0 0 32 43}) I need to count the number of zeros of each string of zeros and mark that number against the first zero no term following the string of zeros (NOTE (: string is used here as a description of a series of zeros, not a string variable).  So the plot which coordinates since my example would be (5.2) and (4.32).

    I'm clear on the way to the path, but I am unable to store only each final count of consecutive zeros without having unnecessary data in my plot.

    Thanks in advance to all those who have advice!

    -Mike

    Do something like that?

    EDIT: Minor Correction because of the additional function of decrement.

Maybe you are looking for

  • Question on the working time of the ASP in Africa is Uganda?

    Hi, I bought all new laptop m70-340 from Dubai two months ago. a display driver factory default. Taken to ASP in Africa is Uganda. It's been four weeks. Other Toshiba dealers and sellers give back 1 year warranty of basic, but FSA not Givin not a cle

  • Question about manufacturers of Satellite P200 touchpad

    Hello All Satellite P200 PSPBGE models come with a Synaptics Touchpad. Thank youMachanic

  • Get updates

    How can I get updates manually.  My automatic update does not once AGAIN, and I would like to just work around it and install my updates of the old fashioned way.  Whenever I go to the Windows update site it returns me to the update with no other aut

  • external table

    HelloI try to get data by using the external table as follows create table nfs_acq (   Participant_ID                            char( 3         ),   Transaction_Type                          char( 2         ),   From_Account_Type                    

  • Ends on the responsibilities of the user

    If you finish date a responsibility on a user id, the end date is the current date.  This allows the user to have control over them until midnight.  It works well with the controls of the RCMP, because we need for the responsibilitiy of show not avai