Function to solve any formula

Hello

I have a requirement like, I have a string of the form as "A + B - C * D". I take this string as input to a function/procedure that will calculate this formula and provide an output of result. The values of the A, B, C, D are stored in a separate table. Please help me.

Kind regards
Kone

You need to write dynamic code and use bind variables. This however not a good idea, despite the use of bind variables. Many different formulas means a lot of sliders not shareable. This will be problematic - and can lead to fragmentation of memory in the Shared Pool errors and memory.

Then there's security and risk of SQL injection. And then there are architectural decisions - PL/SQL is the right place to deal with this problem of race-Dynamics-formula ?

Assuming that these questions are analyzed globally and PL/SQL is the environment to use, the basic approach is this:

SQL> create or replace package Calculator as
  2
  3          --// list of variables
  4          type TVariableList is table of number index by varchar2(30);
  5          variable        TVariableList;
  6
  7          function Calc( formula varchar2 ) return number;
  8  end;
  9  /

Package created.

SQL>
SQL> create or replace package body Calculator as
  2
  3          function Calc( formula varchar2 ) return number is
  4                  cur     integer;
  5                  res     number;
  6                  rc      integer;
  7                  varName varchar2(30);
  8          begin
  9                  --// create and parse a cursor
 10                  cur := DBMS_SQL.Open_Cursor;
 11                  DBMS_SQL.Parse(
 12                          cur,
 13                          'begin :result := '||formula||'; end;',
 14                          DBMS_SQL.native
 15                  );
 16
 17                  --// bind the variables in the cursor
 18                  varName := variable.First;
 19                  while varName is not null loop
 20                          --// if the variable occurs in the formula, bind it
 21                          if InStr( formula, varName ) > 0 then
 22                                  DBMS_SQL.Bind_Variable( cur, varName, variable(varName) );
 23                          end if;
 24                          varName := variable.Next( varName );
 25                  end loop;
 26
 27                  --// bind the output bind variable that was added
 28                  DBMS_SQL.Bind_Variable( cur, 'result', res );
 29
 30                  --// execute the cursor (dynamic PL/SQL block)
 31                  rc := DBMS_SQL.Execute( cur );
 32
 33                  --// read the output bind variable and close the cursor
 34                  DBMS_SQL.Variable_Value( cur, 'result', res );
 35                  DBMS_SQL.Close_Cursor( cur );
 36
 37                  --// return the formula result
 38                  return( res );
 39          end;
 40
 41  end;
 42  /

Package body created.

SQL>
SQL> --// setup variables used in formulas
SQL> begin
  2          Calculator.variable('A') := 10;
  3          Calculator.variable('B') := 100;
  4          Calculator.variable('C') := -1;
  5          Calculator.variable('D') := 0;
  6  end;
  7  /

PL/SQL procedure successfully completed.

SQL>
SQL> --// execute some formulas
SQL> select Calculator.Calc( ':A + :B * :C' ) as RESULT from dual;

    RESULT
----------
       -90

SQL> select Calculator.Calc( ':B / :A * :C' ) as RESULT from dual;

    RESULT
----------
       -10

SQL> select Calculator.Calc( ':D + :C' ) as RESULT from dual;

    RESULT
----------
        -1

SQL> 

Tags: Database

Similar Questions

  • Need help solving any internet connection. This happened to me several months ago and the supplier

    Need help solving any internet connection. This just started today, but it's happened to me several months ago and at that time the provider thought it was software related and suggested that I have to contact HP. I have a HP 2006 m7674n, Windows XP. For several days, I worked with HardBeatZ on a different issue that has been resolved today. However, for several days, I had been working msconfig to track down the cause of the problem; This resulted in several reboots the computer - this would have something to do with it? Also, I just started getting a RUNAS box popping up. HardBeatZ has provided a link to a possible solution to this, but since I can't do internet connection I can't get the fix. Right now I'm on a laptop with Wi - Fi for the same service internet/modem as my PC. I changed nothing onmy PC in the last days of several for the internet connection or services.  I always use eithernet connection from the router to the computer. I tried Wi - Fi today with my PC but not connect. I tried to unplug the router and reconnect but it does not solve the problem. I did a Network Diagnostic and printed the report; Here are the warnings and error messages in this report:

    1. under the terms of the bridge diagnosis; Warning: "www.microsoft.comcould hostname not be resolved (0x2afc error code). Could be the gateway or DNS problem.

    2. under diagnosis of layer IP; Corrupted IP routing table. Default route, road closures, route host itinerary local subnet and local are all valid; Invalid entries in the ARP cache. ACTION: the ARP cache has been emptied. »

    3. UNDER HTTP, HTTPS, FTP Diagnostic; all three had this warning: ' 12007 connection error at www.microsoft.com: the server name or address cannot be resolved. " and the error was unable to establish a connection.

    Still under network adapter diagnosis; It shows the connection status of network as "connected."

    Also, I have an older computer that I connected with eithernet and was able to connect to the internet but has been disconnected because the version of Windows is too old to support the connection. But I could briefly connecting on HP website before you log out. The point being I think it's a computer problem and not an internet router or provider problem.

    I read a few entries on this site and it seemed that the recovery of the system was the only solution. I hope that there are other things to try before I resort to that.

    I would appreciate any advice on the steps to diagnose the problem and insight as to what may have caused this to happen. Thank you. dt2012

    Sorry... still with you... OK, we know that your network card is good and we know that your first post;

    1. under the terms of the bridge diagnosis; Warning: 'host www.microsoft.com name could not be resolved (0x2afc error code). Could be the gateway or DNS problem.

    2. under diagnosis of layer IP; Corrupted IP routing table. Default route, road closures, route host itinerary local subnet and local are all valid; Invalid entries in the ARP cache. ACTION: the ARP cache has been emptied. »

    3. UNDER HTTP, HTTPS, FTP Diagnostic; all three had this warning: "error 12007 connecting to www.microsoft.com: the server name or address cannot be resolved." and the error was unable to establish a connection.

    4. still under network adapter diagnosis; It shows the connection status of network as "connected."

    For me, it seems that Internet Explorer is corrupted or damaged. Your computer is shipped with Microsoft Windows XP Service Pack 2 Media Center Edition 2005 but since you can have updated to XP SP3 or upgraded to a newer version of Internet Explorer. Please try the options listed in this document to Microsoft titled "how to reinstall or repair Internet Explorer" , since there are several options depending on your system configuration, please post if you need help to solve your problem.

  • PC support - Scam or company authorized to solve any problems?

    Is the company PC Support allowed by Windows to call users to fix their computers?  Someone called two consecutive days, I have his name and number.

    N ° it is a scam. Unless you call them, Microsoft will not call you. They are their "authorized" (which is not) or support businesses call you.

    http://www.Microsoft.com/security/online-privacy/avoid-phone-scams.aspx
  • xsl: include not solve any HOW to load the xslt

    I can't get * < xsl: include > * to work with XMLTRANSFORM in an environment of Oracle's PL/SQL 11.2.0.3. I work exclusively within the database.

    I have a basic XSLT which includes another XSLT using xsl: include. I want to load the base as an XMLTYPE XSLT and do transform another XML document, as if the entire XSLT was a large document.

    I loaded the base (base.xslt), the extension (include_with_base.xslt) and the combination of the two (entire_thing.xslt) in the XDB catalogue. base.xslt has this statement inside the node, xsl: stylesheet, attempting to include the other xslt:
    ' * < xsl: include href="/public/include_with_base.xslt" / >. *

    I have the files stored in XDB XSLT. It verifies that they are intact:
    1. the base xslt which has the xsl: include the statement loads very well.
    Select xdburitype('/public/base.xslt').getXML (double);

    2. the extension which is the target of the reference to include it in the basic xslt support very well.
    Select xdburitype('/public/include_with_base.xslt').getXML (double);

    3. the combination of the two, where I copy - paste all the children of include_with_base.xslt xslt:stylesheet in the xslt:stylesheet of base.xslt load node also very well.
    Select xdburitype('/public/entire_thing.xslt').getXML (double);

    However, when I try to run a transformation of some xml test using base.xslt, it fails:
    Select XMLTRANSFORM(xdburitype('/public/xml_input.xml').getXML (), xdburitype('/public/base.xslt').getXML ()) FROM dual;

    When I try to run the same transformation of the same test xml using entire_thing.xslt, it works:
    Select XMLTRANSFORM(xdburitype('/public/xml_input.xml').getXML (), xdburitype('/public/entire_thing.xslt').getXML ()) FROM dual;

    When I run both XSLT transformations and transformation using altovaxml is in the same directory of drive (and I use a relative reference with no path information and not an absolute reference, as I show in the above examples), the transformation works very well.

    What can I do to run a XSLT which is essential the XMLTRANSFORM < xsl: include... / > reference in there?

    Published by: user11359697 on April 15, 2013 13:49

    Ok thank you. Now I can reproduce the problem:

    SQL> select xmltransform(
      2           xdburitype('/public/PEOPLE.xml').getXML()
      3         , xdburitype('/public/BASE.xslt').getXML()
      4         )
      5  from dual;
    ERROR:
    ORA-31011: XML parsing failed
    ORA-19202: Error occurred in XML processing
    LPX-00602: Invalid child element '#text' of element 'binary'.
    
    no rows selected
    

    The error is related to the way in which the resources are stored in the XML DB repository and are accessible from XSLT.
    Apparently, when the resource is interpreted as a binary stream, the language of xsl: include directive fails. I would be considered a bug.

    By default, there is no mapping predefined MIME for the 'xslt' extension so the resource ' / public/TITLES "is stored using the default" application/octet-stream"MIME type
    You can check that by questioning RESOURCE_VIEW:

    SQL> set long 50000
    SQL> set longc 50000
    SQL> set lines 200
    SQL> set pages 100
    SQL> select xmlserialize(document res)
      2  from resource_view
      3  where equals_path(res, '/public/TITLES.xslt') = 1;
    
    XMLSERIALIZE(DOCUMENTRES)
    --------------------------------------------------------------------------------------------------------------------------------------------
    
    

    To work around the problem, you need to reference resources stored with a text-based MIME type, such as the "xsl" extension (predefined in xdbconfig):

    select *
    from xmltable(
           xmlnamespaces(default 'http://xmlns.oracle.com/xdb/xdbconfig.xsd')
         , '//extension-mappings/mime-mappings/mime-mapping'
           passing dbms_xdb.cfg_get()
           columns "extension", "mime-type"
         ) ;
    

    or if you want to keep the "xslt" extension, it maps to the mimetype "text/xml".
    You can do it like this:

    SQL> exec dbms_xdb.ADDMIMEMAPPING('xslt','text/xml');
    
    PL/SQL procedure successfully completed.
    
    SQL> commit;
    
    Commit complete.
    

    Drop and reload the resource ' / public/TITLES.xslt ' in the repository and it should be OK:

    SQL> select xmltransform(
      2           xdburitype('/public/PEOPLE.xml').getXML()
      3         , xdburitype('/public/BASE.xslt').getXML()
      4         )
      5  from dual;
    
    XMLTRANSFORM(XDBURITYPE('/PUBLIC/PEOPLE.XML').GETXML(),XDBUR
    ------------------------------------------------------------
    
    
      Hello, Mrs.AliceAble
      Hello, Mr.BobBungler
    
    
  • Solve a Boolean formula

    Hello!

    Is there any tool similar like Eval - Multi Variable Scalar.vi to solve Boolean formulas?

    See if the truth table of Darin node helps.

    Ben

  • How can we find formula function in the formula of the payroll

    Guys,

    Concern about the functionality of oracle is very extensive, especially in the payroll process, for most functions are integrated to avoid the user to create a custom code, but it is not fully covered business requirement. That's why we need to create our custom function for our coverage/validate business needs and for that, we record this function in the formula function, which is the best way to add any condition in the form of payroll by calling it. Now my requirement is that, to find the formula name where this function has been used.

    We will assume that any user is created 'X' formula with this feature and referred to in the way of the pay formula we find the name formula everywhere where this function has been called.


    Please suggestion

    That is a good question. The quick formula text is stored as a data type LONG, which is now a kind of stale data. You can write a utility function from PL/SQL to convert the text to a VARCHAR2 and is seeking, but has two problems:

    (1) it assumes that you are allowed to create a function that is not something that you'll probably on a production database
    (2) it'll barf for any formula superior to 32760 bytes

    You can also use the to_lob function to copy the contents of ff_formulas_f into a new table (with a CLOB data type) and then create an Oracle text index to quickly find the CLOB. But once again, which means that you have write access.

    If you are patient you can also run this awful piece of SQL:

    SELECT ff.formula_name
    ft.formula_type_name
    src.text source_plsql
    OF ff_formulas_f ff
    ff_formula_types ft
    ff_functions fff
    all_source CBC
    WHERE ff.business_group_id IS NOT NULL
    AND ff.formula_type_id = ft.formula_type_id
    AND src.name = 'FFP ' | TO_CHAR (FF.formula_id) | '_' || TO_CHAR (ff.effective_start_date, 'DDMMYYYY')
    AND src.type = 'PACKAGE BODY'
    AND lower (text) like '% "| Lower (FFF. Definition) | '%'
    AND trunc (sysdate) BETWEEN
    FF.effective_start_date AND ff.effective_end_date
    AND higher (nvl (fff.alias_name, fff.name)) = upper ('XXC_MY_FFFUNC');

    (replace "XXC_MY_FFFUNC" with the name of the function Fast formula you want to find). Do not expect to be fast. That it does not search the PLSQL generated rather than the text of the source formula. This search only defined by the client Fast formula (those whose value business_group_id).

  • HP Officejet Pro 6830: HP Officjet Pro 6830 - functions disabled by "Administrator".

    Copy (and others) functions disabled with message "function disabled by any personal orthe who has set up the computer.  I did the reset from the software several times.  have done the "hard reset" (unplug, turn... etc).  Still have the problem.  Read the manual... No help.   This who should I try next.  Frustrated. .. .thanks

    Hello @pvc56, greetings!

    Thank you for visiting the Forums from the HP Support! I will do my best to help you with this problem.

    We will perform a factory reset on your printer to try to resolve the problem.

    I send you a private message with the steps to reset the printer. Please check the icon of the mailbox at the top right of this screen.

    Let me know how it goes. Good luck!

    See you soon

    Please click on 'acceptable' on the post that solves your problem to help others to find the solution. To show gratitude for my help, please click the 'Thumbs Up icon' below!

  • distance along an arc of an ellipse (nD of the nonlinear system (VI) .vi Solver)

    I'm hoping to get help solve a problem, I came up against. I understand that what I'm asking requires little of your time, so I tried hard to do my due diligence before posting here. I appreciate you really any help I can get. I use LabVIEW 2014 Professional on Windows 7.

    I removed all the details of the specific request, I'm working on that and tried to isolate the problem that is causing me problems.

    I asked the problem below and I have attached a few instruction code (sorry, there is not bad) which represents my current solution (with the matter).

    Problem: Given an ellipse (with a large and a small axe and a frame of reference), one distance and any point of the ellipse, calculate the end point on the ellipse, where the length of an elliptical arc between two points is equal to the distance to travel.

    I'll rephrase the problem, but with physical values. Account required of an ellipse, centered on the origin, with axes of 10 mm and 8 mm, and a point of departure (5 mm, 0 mm); What is the point of endpoints on the ellipse after traveling 1 mm along the ellipse?

    It seemed initially as a simple calculation (and that's a circle), but for an ellipse, the calculation is proving to be a bit more complicated and requires numerical computation.

    Question: I was given a few python code that solves this problem and embarked on a solution of LabVIEW. Python code uses the scipy library optimize.fsolve function to solve one of the aspects of the problem. I'm not too familiar with LabVIEW screws available to do the equivalent, but settled on "LabVIEW 2014\vi.lib\gmath\zero.llb\nD non linear system Solver (VI) .vi" (my code still has some options disabled in the code). When I use this Solver VI, I don't always get the same response from this VI. Sometimes, he finds a root diskette and sometimes two. For points separated by less than half the circumference of the ellipse, it always 2 roots (in the sense and meter needles). Any ideas why the Solver does not always return 2 roots?

    Current solution: my VI investigation takes two points on an ellipse (defined by a start angle and end angle) and calculates the distance between them along the ellipse. Then I take the starting point and the distance and try to calculate the end angle (that I can use to find endpoint). Run once, we usually find the right answer, but run 100 times it is often the answer 19. I should mention that I'm not 100% positive, there is no problems with the code used to support this calculation and I am open to any suggested changes or improvements, but currently problems is the inconsistent operation of the Solver VI.

    Yet once again, I appreciate, is long and thank you for reading this well; I hope you find it as fun a problem as I do!

    Chris

    As promised, here's a working version of the code that I posted earlier. This code is always the right answer, where previously it sometimes not found the right answer. See my post above for details on what has changed.

    Also, I was wondering at the start of what the LabVIEW equivalent to the python code that uses the function optimize.fsolve of the scipy library. I think the answer is

    ND Single .vi Solution (VI) non-linear system

    as its inputs match more closely and seems to perform similiarly. This is where I would start in the future and works well for the moment.

    Thank you

    Chris

  • NodeIsLeaf() function problem

    Hello

    I created a derived property that uses the Boolean function NodeIsLeaf().
    The formula is:

    If (NodeIsLeaf (), S, X)

    The formula evaluates well and gives a correct result when you change the formula.
    When I save it and go to the hierarchy and checking the value of the property at the level of the node, it shows just a white.

    I noticed one thing was after a backup below is the error in the "evaluation results": message box

    ' DRM-25606: Invalid Boolean value: D..

    When I check the formula I do nto see invalid return or something else, I've included.
    Can someone tell me what can be the problem here?

    Thanks in advance,
    Mounira Dutta

    What version of DRM are you running?

    Also, since NodeIsLeaf() returns a value chain, better programming practices would be:

    If (StrToBool (NodeIsLeaf ()), S, X)

    I do not say that it will certainly solve your problem, but you might be surprised to know how many issues I have seen with access violations after upgrades and applications of a stamp that were resolved by encapsulating literals string with StrToBool(), even when they are returned by the functions of the system.

  • Write a custom time entry rule based on a custom formula

    We currently use Oracle time and labor to manage the time and then using an external payroll application. Export us data from OTL in our list of payroll at a given date.
    We had problems where the people came after the payroll data was extracted.

    I want to do is have a time entry that calls a pl/sql function (using formulas that I guess). It would go in as a parameter a date that is would be the end date of the score or for each individual date card.
    Our function would then search our table to measure to determine if the payroll is already checked out. If it has then an error (or a warning) would have shown according to normal time entry rules.

    I'm completely stuck with where to start though - I tried to set up a rule of entry of time however I got an error that has been found no compiled version. Also, I'm completely stuck on how to pass the date the score or card each day as a parameter to the rule.

    Any help on this would be very much appreciated.

    Thank you

    PS. We use 11.5.10.2

    You will need create a pl/sql function that does all the stuff above and save the pl/sql function based on the formula.

    The logic of the pl/sql function must be something like below.

    1. call the hxc_self_service_time_deposit.get_building_blocks function and store the values in the pl/sql table.

    2. for each building block to get the date.

    3. change the Date of your custom function that detects if the payments are for the date.

    4. If payments are made then return 'Y '.

    5. After iterating over all the building blocks, if payments are not made for the days back 'n'.

    In the formula, call the function in the formula above. If the function returns "Y" then return the value of 'E' against rule_status another return "S".

  • Event-based proration formula group

    follwing text is mentioned in the user's guide for formula OracleFast:

    Write formulas of proration
    When the payroll running encounters an event (such as a change of category) that you have
    _defined as an event apportionment to the element being processed, it creates two execution results_
    for the element - one for the period of pay until the day before the event and the other of
    the date of the event for the end of the period. You define a formula to handle this
    proration for part of treatment


    Can someone tell why do two execution results? I don't need only one result!

    Thanks in advance,

    Hi user597685

    I was just referring to GET_ASSIGNMENT_STATUS formula you to create a custom function mentioning. So instead of using the seeded GET_ASSIGNMENT_STATUS formula function, create a custom formula similar to the above but referring to a different pl/sql function that must be something like below.

    function xx_get_Assignment_Status
    (p_assignment_id number
    p_effective_date IN Date) number IS back

    CURSOR csr_get_asg_status (p_assignment_id p_effective_date DATE NUMBER) IS
    SELECT decode(past.per_system_status,'ACTIVE_ASSIGN',1,'SUSP_ASSIGN',2,'TERM_ASSIGN',3,4)
    BY the ADP per_all_assignments_f.
    last per_assignment_status_types
    WHERE paaf.assignment_id = p_assignment_id
    AND p_effective_date BETWEEN paaf.effective_start_date AND paaf.effective_end_date
    AND paaf.assignment_status_type_id = past.assignment_status_type_id;

    number of l_return;
    BEGIN
    OPEN csr_get_asg_status (p_assignment_id, p_effective_date);
    SEEK csr_get_asg_status INTO l_status;
    CLOSE Csr_get_asg_status;

    RETURN l_status;
    END;

    This function returns 1 for the active state of the assignment, 2 suspended, completed 3 and 4 for the other. Amend accordingly the logical formula. This should solve your problem.

    Kind regards
    Sharath

  • How to move cells containing formulas without absolute references and maintain cell references

    I know about the selection of the absolute references, etc., but sometimes I'd like to be able to copy a group of cells with formulas and paste elsewhere all retaining the original cell references. For example, several cells with a formula referring to 'A1' continue referring to 'A1' even when I copy the cells elsewhere.

    Is there a change of copy and paste (for example, command + option + C or something?) so that I can copy the same that in Excel, that does not change the cell references when you copy a formula elsewhere?

    Thank you!

    Hi jivejive,

    I am not in anyway you want with a group of cells. I did it with individual cells by copying the function since the Inspector formula and then paste in the Inspector in the new location.

    Quinn

  • Help formula: count the number of whites in a column "up to the...» »

    name string metric
    Matthew 5
    brand 1
    brand optimusPrime
    brand
    Luke 2
    Matthew jamesLikesSteak
    John 3
    Luke lukingGood
    Matthew
    Luke
    John johnnyPop
    John

    Hey guys - so I do business with a bit of a problem in number. I have a number table - the table above is a simplified representation of the corresponding parts of the table. The left column 'name' is a series of 12 names repeated and 0 missing values. The "string" middle column is a column that has a lot of missing values by a formula based on another column that is not relevant to this problem. Who is not missing is all strings. The problem I have is in the 'metric ': right column

    I am trying to create a dynamic formula which will result in the numbers and blanks, exactly as above. My goal is to create a formula that, for each line, account the number of whites in the column 'chain' until we reach an empty 'string' which occurs next to "namesake" as in the line of housing the formula - and if there is no such a situation, so that it is empty. For example, if the second row (including header row) bears the name of "Matthew". The next time that a white 'string' occurs next to the name "matthew" is tenth. The number of whites that occur between the second row, and the ninth is 5 (lines 2, 3, 5, 6 and 8). I manually coded a small part of the table to use something like this (which would be installed in cell C2 in this example):

    = IF (B2 = "", COUNTBLANK(B2:B9), "")

    This formula produces the correct number for the first row of data (5), but it does not dynamically fulfill what I'm trying to do this since I am currently having the formula to find the next blank 'chain' that occur next to "name" in the formula line.

    I hope that someone has encountered anything like this before. I tried to go through all the functions and numbers from formulas, but so far I have not found much success.

    Hi BaronDe,

    I need to ask, "why you try to do this? So what you want is possible it will be a complex solution. It may be much easier to get your information in a different way. Indicate these blanks?

    You should know that COUNTBLANK() will not count a cell with a formula, even if this formula resolves to «»

    Quinn

  • My Mac Mini is extremely slow and any video will start but soon stops and intermittently starts and stop immediately. What is the reason?

    My Mac Mini (end 2012) 2.5 ghz memory 8 GB Yosemite 10.10.5 is extremely slow. I read a few articles on communities, but unable to solve the problem. I plan to upgrade memory soon. In addition, a video game doesn't quite work. It starts and stops in 5 seconds and restarts it for a few seconds and stops completely. An advisor to fix the problem will be appreciated.

    When you see a beachball cursor or the slowness is particularly bad, note the exact time: hour, minute, second.

    These must be run as administrator. If you have only one user account, you are the administrator.

    Run the Console application in one of the following ways:

    ☞ Enter the first letters of his name in a Spotlight search. Select from the results (it should be at the top).

    ☞ In the Finder, select go utilities ▹ of menu bar or press the combination of keys shift-command-U. The application is in the folder that opens.

    ☞ Open LaunchPad and start typing the name.

    The title of the Console window should be all Messages. If it isn't, select

    SYSTEM LOG QUERIES ▹ all Messages

    in the list of logs on the left. If you don't see this list, select

    List of newspapers seen ▹ display

    in the menu at the top of the screen bar.

    Each message in the journal begins with the date and time when it was entered. Highlight date back to the time you noted above.

    Select the messages entered since then until the end of the episode, or until they begin to repeat, whichever comes first.

    Copy messages to the Clipboard by pressing Control-C key combination. Paste into a reply to this message by pressing command + V.

    The journal contains a large amount of information, almost all this is useless to solve any particular problem. When you post a journal excerpt, be selective. A few dozen lines are almost always more than enough.

    Please don't dump blindly thousands of lines in the journal in this discussion.

    Please do not post screenshots of log messages - text poster.

    Some private information, such as your name, may appear in the log. Anonymize before posting.

    When you post the journal excerpt, an error message may appear on the web page: "you include content in your post that is not allowed", or "the message contains invalid characters." It's a bug in the forum software. Thanks for posting the text on Pastebin, then post here a link to the page you created.

    If you have an account on Pastebin, please do not select private in exposure menu to paste on the page, because no one else that you will be able to see it.

  • Get the error: DROPDOWN list is not a function - works in IE9

    I'm trying to remove the default selected value in a drop-down list.

    The call to the function is the following:
    OnChange = "JavaScript:Remove_Default_Value (this); »

    Here's the function:

    function Remove_Default_Value(DROPDOWN) {
     var i = DROPDOWN.options.length - 1;
     for ( i; i >= 0; i--)
     {
      DROPDOWN(i).defaultSelected = false;
     }
    } 

    The error I get is "drop-DOWN list is not a function".

    Any ideas is greatly appreciated.

    It is not a function, but a table and you also use getElementsByTagName()

    function Remove_Default_Value(DROPDOWN) {
     var i = DROPDOWN.getElementsByTagName("option").length - 1;
     for ( i; i >= 0; i-- )
     {
      DROPDOWN.getElementsByTagName("option")[i].defaultSelected = false;
     }
    } 

    A good place to ask for advice on web development is to the 'Web Standards Development/evangelism' MozillaZine forum.

    Aid to this forum are better informed on issues related to web development.

    You must register on MozillaZine forum site to post in this forum.

Maybe you are looking for