Can one assign a numerical value to a variable?

Hi All,
Good afternoon,
I am currently working on a form that has strings as values in 2 different listboxes, and depending on what is selected a message pops up. Here is the script I wrote, but it does not seem to work right
var a=aKlaclistbox.raWvalue=="SSK";
var b=bZlaslistbox.raWvalue=="SGT";
a.value=1;
b.value=2;
if(a > b){
    xfa.host.messagebox("You cannot select a lower officer as the rating officer");
It does not work, and I am just wondering if there is any way I can get around it so that I can compare the values. I need help from anyone on this forum.
Thanks
v/r
Tammy

There's probably a better way of doing this, as, depending on how many ranks you have, it could get cumbersome. Like using an array or something like that but not sure how to accomplish that.
If there are a lot of ranks to compare I think I'd suggest reworking things so that you can use the numeric value of the list box, it will be much easier in the long run.
As I mentioned above, I don't think the following is valid code:
var a=aKlaclistbox.raWvalue=="SSK";
Nor is (unless dealing with global variables):
a.value=1;
I think you need to do something like the following (hopefully someone else around here might have a better idea!):
var a;
var b;
if (aKlaclistbox.rawValue == "SSK") {
     a = 1;
if (bZlaslistbox.rawValue == "SGT") {
     b = 2;
//You would need a series of else/if with the above to map the different rank values.
if (a > b) {
   xfa.host.messagebox("You cannot select a lower officer as the rating officer");

Similar Messages

  • Assigning a numerical value to the answers of a multiple choice text field

    I have searched and searched thru a million articles but there does not seem to be a simple way to do this, and I hope like heck that I am just overthinking it.  I tend to fall back on years of coding and completely miss a simple answer when doing this
    kind of thing so I hope someone can help.
    I'm developing a scorecard.  I have a list that has a form on it that asks a series of questions on it.  Some are yes/no.
    I want to assign the numerical value of "1" to "yes", and "0" to "No".
    This is so that when I create the actual scorecard, I can add up all the answers and generate a calculated score.
    Example:
    Was this incident properly classified?
    [Dropdown]
    Yes
    No
    Do I need an extra column assigning the values?  Can I assign the values within the column itself? Any assistance will be really helpful. 

    there are several options:
    - calculated column with something along the lines of =IF([dropdowncolumn] = "YES", 1, 0)
    - separate lookup list with values
    - if you're using infopath, your column could be numeric, and just use a DropDown as the visualization, and populate the DDL with key/values of "Yes"/1 and "No"/0 (though in this case, when viewing the list as a native grid, the column
    would only show 1/0, not "yes / no"
    - depending on how you're creating the scorecard, use a yes/no (boolean) column and just convert during the calculation
    lots of options come to mind.
    Scott Brickey
    MCTS, MCPD, MCITP
    www.sbrickey.com
    Strategic Data Systems - for all your SharePoint needs

  • Assigning a Numeric Value in a Cell Based on Text in Another Cell

    In advance, thanks for your assistance. I'm trying, in vain, to assign a numeric value in a cell based on text (from a dropdown menu) in another cell. For example, in cell A5 I have a dropdown list that includes the options "blue", "red", "white", and "gold." I want cell C15 to be 2 if A5="blue"; I want C15 to be 0 if A5="red"; I want C15 to be 2 if A5="white"; and, I want C15 to be 1 if A5="gold."

    Tippet,
    This is a job for LOOKUP.
    The expression for the Result cell is: =LOOKUP(A2, Lookup :: A1:A4, Lookup :: B1:B4)
    The aux. table contains the matches that you assign for the colors.
    Regards,
    Jerry

  • How to Assign a Field value to a Variable??

    Dear All,
    Kindly let me know, if <b>"HOW TO ASSIGN A FIELD VALUE TO A VARIABLE????"</b>
    Situation is, we have a Field (OBJK-TASER) in which 2 tables (SER01 & SER03) are stored. And we want to access names of the Tables which are there in the field(TASER) in  (OBJK) table  to a variable and then passing that variable to the sql query as a table name to get data accessed dynamicaly.

    try this
    select TASER from OBJK into table it_table.
    loop at it_table.
    select field1 field2 from (it_table-table) into table it_fields.
    endloop

  • Can't assign a string value to a member of type TEXT in Calculation Manager

    I can assign a string value to that member of type TEXT using a run-time prompt of type StringToNumber.
    Example: "My Text Member" = {string_rtp};
    However, I need to accompllish the same function without using a run-time prompts.
    I have a planning application and I know that text along with all other non-numeric
    values are stored on the relational side in the planning application schema.
    It seems reasonable to assume that if this can can accomplish
    with a run-time prompt that I could do also do it without a run-time prompt.
    What appears to be lacking is a function like:
    "My Text Member" = @StringToNumber(<String Literal>);
    Clearly, this is already being done "under the covers" for run-time prompts. If
    would appear to be a minor enhancement to expose such a function to developers.
    NOTE: I suppose you would also need to add new syntax/function to identify a string
    literal from say a member name. I'm wondering if this is the more difficult challenge
    from a product perspective????

    When executing a Calculation Manager rule in Planning, the run-time prompt (RTP) is populated by looking up the outline information present in the relational Planning application database. If the RTP is of type TEXT, the strings displayed in the member select are from the from the relational Planning application database too. Subsequently when executing the Rule, the RTP's value is in fact the record ID (a number) which is then saved into the appropriate intersection in Essbase.
    You need to bear in mind, the Rule is executed in Essbase. If Essbase needs to "write" a text, it would then need to connect to the Planning relational database to create a new record. The newly created record ID then needs to be feed back to Essbase, in order to store it in the appropriate intersection.
    What you are suggesting, comes with a big overhead causing Essbase and the rule to slow. Thus, the disadvantages outweighs the advantages.

  • Assigning a numerical value

    I am new to Acrobat and still have not figured out a few things. I am trying to make a very simple form for my boss. Basically an inventory sheet with calculations. He is basically looking for an excel spreadsheet in Acrobat. Is this possible? I need to assign a dollar value to a field. One that the client can not change and one that apprears always. The basic formula would be A(field1)*B(field 2) = sum (field 3)
    I dont even know if I am explaining this right. ARG. All help appreciated! Cheers

    Hi again!
    Thank you again for all the help. I have completed my form but am having 1 more problem. I hope I explain this properly:::  My form works almost perfectly. ie:: enter quantity of item. $ amount gets tallied at the end based on quantity. Sub-total amount is correct BUT when sub-total gets HST multiplied to it I am consistently out by $39. I have no idea where this number is coming from.
    My formula for my total is (subtotal*HST)
    My formula for my HST $ amount is default value: 0.12 Format:Percentage
    My formula for Total is (subtotal+HST)
    Also when I am entering quantity the total will not calculate the HST until you enter a 2nd quantity amount. Which it is still under by $39, although if you enter a "0" quantity amount after this it will calculate the formula perfectly.  Same goes with clearing the sheet:: you can clear all the numbers off and it still will have $39 left on the "bill" but if you enter a "0" and then erase it, it clears the sheet perfectly. Is this a glitch or am I not doing something? Thank you for your help in advance.

  • How do I assign a numerical value to text cells in cartesian products?

    Hi, this is more of a two part question.
    Question 1
    I need to be able to assign numerical values (Table Value £ of set up) to text cells (Set Up).
    1. The table "Combinations" then uses the formula
    IF($A3≤Information::$B$8, MOD(INT((ROW(cell)−3)÷PRODUCT(C$1:$G$1)), B$1), "")
    to take info from the "Information" table and create all possible permutations of "Set Up"
    2."List" is the printed list of "Combinations"
    3."Output of list" concatenates the data from "List".
    Question 2
    4. How do I print out the total numerical value of the concatenated string of "Output of List" into Output (£) of List"?

    >
    When posting code or code snippets. HTML/XML or input/output, please use the code tags. The code tags help retain the indentation and formatting of the sample. To use the code tags, select the sample and click the CODE button.
    Here is how the first code snippet would have appeared in code tags.
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    float num1, num2, num3, result;
    num1 = Float.valueOf(jRadioButton1.getMnemonic());
    num2 = Float.valueOf(jRadioButton2.getMnemonic());
    num3 = Float.valueOf(jRadioButton3.getMnemonic());
    result = num1+num2+num3;
    jTextField1.setText(String.valueOf(result));And while I'm on the subject of retaining the indentation of the original sample, please use one of the two common conventions for indenting code blocks. E.G.
    Convention 1:
    class TheClass {
        TheClass() {
    }Convention 2:
    class TheClass
        TheClass()
    }

  • Can I assign a default value to a parameter like C++ ?

    My question is whether I can assign a default value to a parameter in Java? Let's say : public void myMethod(int p1, int p2=3){...} Is this syntax acceptable ?
    Regards,
    WenBin

    I don't think so (the easiest way to find out is to try), but if you want something like that, most people do it like so:
    private static final int DEFAULT_P2 = 3;
    public void myMethod(int p1)
        myMethod(p1, DEFAULT_P2);
    public void myMethod(int p1, int p2){...}Hope this helps,
    Radish21

  • Assign numeric value to a variable from an item

    Someone please help me. I am attempting to assign a variable a numerical value from a text field. For example,
    my text field item is :P202_AMOUNT. How do I assign the number that is entered into this item to a PLS_INTEGER variable? I have attempted to uss this line of code but it hasn't worked:
    v_amount PLS_INTEGER := :P202_AMOUNT;
    Please help.
    -Stefano

    Stefano,
    The code you showed will work in the declaration section of a PL/SQL block that is part of your application's metadata (region, process, computation, etc.). Perhaps you are attempting to compile such a block externally using the bind variable. If that is the case, try v('P202_AMOUNT') instead. Or maybe your question is about format masks... How about giving us a bit more to go on?
    Scott

  • Assigning javascript varibel value to java variable

    Hi all
    I want to find screen resolution in one jsp page.That can be done in javascript.
    (though 'screen.width and screen.height')
    But is there any way to assign that value to java variable.
    Any body has the idea?
    Help me.

    No, why ? becuase jsp is SERVER side
    There are workarounds, You can store your javascript values in hidden fields and submit your page with them to your JSP and then use them like that

  • Assigning javascript varible value to java variable

    Hi all
    I want to find screen resolution in one jsp page.That can be done in javascript.
    (though 'screen.width and screen.height')
    But is there any way to assign that value to java variable.
    Any body has the idea?
    Help me.

    No, why ? becuase jsp is SERVER side
    There are workarounds, You can store your javascript values in hidden fields and submit your page with them to your JSP and then use them like that

  • Assigning a hex value to a variable and getting binary value of a variable.

    I try to develop java programs and I need to do a conversion unicode to EBCDIC and vice versa.
    How can I assign hex values to variables to build UTF-EBCDIC and EBCDIC-UTF table and get hex or binary value of data to compare it to value of in the table?
    I did a conversion like this with PL/1 before. I do not know how can I do it with Java. Because I am new to Java.
    Thank you in advance.

    I will run java code in mainframe and java uses
    unicode for data in default and mainframe environment
    is EBCDIC. So I have to translate the data from
    unicode to ebcdic.I said I think String supports EBCDIC encoding...
    String ebcdic = new String(ebcdicBytes, "Cp500");
    http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html

  • How can i implement the default value for this variable?

    In one of our Stored procs,we have a variable RECS_TO_DELETE, which determines the number of records to delete from various DELETEs that happen within this proc.
    The value for RECS_TO_DELETE variable should be obtained from a configuration table sys_config
    select
    rec_num into RECS_TO_DELETE
    from sys_config
    where
    sys_code=55;
    But if something goes wrong with sys_config table or the above SELECT INTO, our client wants to makes sure that RECS_TO_DELETE should have a default value of 1000.
    In the code, how will i implement having this default value of 1000 for RECS_TO_DELETE variable  in case the above SELECT INTO fails for some reason.

    Hi,
    You have to assign a value before the execution...
    DECLARE
        RECS_TO_DELETE NUMBER(9) := 1000;
    BEGIN
        SELECT rec_num
        INTO   RECS_TO_DELETE
        FROM   sys_config
        WHERE  sys_code = 55;
        DBMS_OUTPUT.put_line(RECS_TO_DELETE);
    EXCEPTION
        WHEN NO_DATA_FOUND THEN
           DBMS_OUTPUT.put_line(RECS_TO_DELETE);
    END;
    /Regards,

  • Assigning long text values to ODI variable

    Hi all,
    I want to store the error message of the previous step in a variable: _<%=odiRef.getPrevStepLog("MESSAGE")%>_ (using ODI 10.1.3.5 on Oracle 9i).
    If I refresh the variable using a statement like Select '<%=odiRef.getPrevStepLog("MESSAGE")%>' From dual , it errors out if the message has more than 4K characters.
    I tried to use _<%=odiRef.getPrevStepLog("MESSAGE").substring(0,3999)%>_ , but this creates an indexoutofbounds exception if the message has less than 4K characters.
    I tried to use assign instead of refresh, but it only prints the jython code instead of retrieving the variable. How can I assign the message to a variable?
    Thanks,
    Matt

    Cezar,
    Here's the operator information. Oracle DB version is 10g EE, Rel. 10.2.0.4.0 - 64bit
    Operator - Description
    select substr('org.apache.bsf.BSFException: exception from Jython:
    Traceback (innermost last):
    File "<string>", line 23, in ?
    com.hyperion.odi.essbase.ODIEssbaseException: Cannot build dimension. Analytic Server Error(1090004): Unable To Open File [hypxx/product/essbase/AnalyticServices/app/xxx_PL/xxx_PL/ActCalce.rul]
         at com.hyperion.odi.essbase.ODIEssbaseMetaWriter.loadData(Unknown Source)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:585)
         at org.python.core.PyReflectedFunction.__call__(PyReflectedFunction.java)
         at org.python.core.PyMethod.__call__(PyMethod.java)
         at org.python.core.PyObject.__call__(PyObject.java)
         at org.python.core.PyInstance.invoke(PyInstance.java)
         at org.python.pycode._pyx9.f$0(<string>:23)
         at org.python.pycode._pyx9.call_function(<string>)
         at org.python.core.PyTableCode.call(PyTableCode.java)
         at org.python.core.PyCode.call(PyCode.java)
         at org.python.core.Py.runCode(Py.java)
         at org.python.core.Py.exec(Py.java)
         at org.python.util.PythonInterpreter.exec(PythonInterpreter.java)
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:144)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    Caused by: com.essbase.api.base.EssException: Cannot build dimension. Analytic Server Error(1090004): Unable To Open File [hypxx/product/essbase/AnalyticServices/app/xxx_PL/xxx_PL/ActCalce.rul]
         at com.essbase.server.framework.EssOrbPluginDirect.ex_olap(Unknown Source)
         at com.essbase.server.framework.EssOrbPluginDirect.essMainBuildDimension(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin._invokeMainMethod(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin._invokeMethod2(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin._invokeMethod(Unknown Source)
         at com.essbase.server.framework.EssOrbPluginDirect._invokeProtected(Unknown Source)
         at com.essbase.api.session.EssOrbPluginEmbedded.invokeMethod(Unknown Source)
         at com.essbase.api.session.EssOrbPluginEmbedded.invokeMethod(Unknown Source)
         at com.essbase.api.session.EssOrbPlugin.essMainBuildDimension(Unknown Source)
         at com.essbase.api.datasource.EssCube.buildDimension(Unknown Source)
         at com.hyperion.odi.essbase.wrapper.EssbaseApplication.buildDimension(Unknown Source)
         ... 32 more
    com.hyperion.odi.essbase.ODIEssbaseException: com.hyperion.odi.essbase.ODIEssbaseException: Cannot build dimension. Analytic Server Error(1090004): Unable To Open File [hypxx/product/essbase/AnalyticServices/app/xxx_PL/xxx_PL/ActCalce.rul]
         at org.apache.bsf.engines.jython.JythonEngine.exec(JythonEngine.java:146)
         at com.sunopsis.dwg.codeinterpretor.k.a(k.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.scripting(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execScriptingOrders(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)
    ', 1, 4000) from dual
    Operator - Execution:
    1704 : 42000 : java.sql.SQLException: ORA-01704: string literal too long
    java.sql.SQLException: ORA-01704: string literal too long
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
         at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
         at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
         at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_for_describe(T4CPreparedStatement.java:503)
         at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:965)
         at oracle.jdbc.driver.T4CPreparedStatement.execute_maybe_describe(T4CPreparedStatement.java:535)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1051)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3026)
         at com.sunopsis.sql.SnpsQuery.executeQuery(SnpsQuery.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.execStdOrders(SnpSessTaskSqlV.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.treatTaskTrt(SnpSessTaskSqlV.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
         at com.sunopsis.dwg.dbobj.SnpSessTaskSqlV.treatTask(SnpSessTaskSqlV.java)
         at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
         at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
         at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
         at com.sunopsis.dwg.cmd.e.i(e.java)
         at com.sunopsis.dwg.cmd.g.y(g.java)
         at com.sunopsis.dwg.cmd.e.run(e.java)
         at java.lang.Thread.run(Thread.java:595)

  • One Movieclip Instance as value for several variables.

    Hello, my problem is the following:
    It seems that my code is problematic, because I assign one instance of a MovieClip to several variables, type MovieClip. The behaviour of others of my codes makes me think, that ActionScript does not make copies of the instance, but references all variables to this single instance. This behaviour now causes trouble.
    The solution I consider now, is to create copies of the MovieClip and assign them to my variables. Is there any code to copy a MovieClip?

    Although there are some solutions, a need to duplicate MovieClip is most definitely a result of bad application architecture decisions in principal. I strongly suggest you rethink how you deal with it and why this functionality is needed at all. Perhaps if you elaborate what causes you go this route a better solution will be suggested.
    With that said, read this: http://www.kirupa.com/forum/showthread.php?p=1939827

Maybe you are looking for

  • HT1338 Upgrade Retina Macbook Pro to OS X Mountain Lion

    Were do I go to upgrade my new Retina Macbook Pro without having to pay the upgrade fee?

  • Help on - ALV Heading

    Hi friends, I want the heading of an ALV report in the format given as below ..... Is that possible ??? In the 1st line :- 123 ( Left corner ) ..... ABC (Center).... date (right corner) In the second line also :- something like the first line ..... I

  • Serial number generation

    Hi friends, I have a question regarding the serial number generation. 1. In serial number generation  do we have option of generating either when creating and releasing the production order or when doing the GR for the production order. If yes, pleas

  • Scheduling Crystal Report with Subreport in BOE 12.0.0.683

    I have scheduled a crystal report in BOE that contains a subreport. The report successfully completes, but the data for the subreport is blank. I know there are records for the subreport because they are there when I run the subreport manually in cry

  • Allowfullscreen &  wmode="transparent" doesn't work together

    allowfullscreen & wmode="transparent" doesn't work together with IE 6.0, fullscreen doesn't work anyone know why??