Access a package Via Select Global variable

Hi all

I want to access a global variable of the overall package variable IE via a select query. Is it possible or not possible. Please share some entries on this.

Thank you

Just to clarify that you can reference the global variable if your SQL is itself in PLSQL. It will be linked to.

CREATE OR REPLACE PACKAGE p1
AS
  my_global NUMBER := 1;
  --
  FUNCTION f_get_my_global
  RETURN NUMBER;
  --
  PROCEDURE p_do_something;
  --
END;
/

CREATE OR REPLACE PACKAGE BODY p1
AS
  --
  FUNCTION f_get_my_global
  RETURN NUMBER
  AS
  BEGIN
     RETURN my_global;
  END;
  --
  PROCEDURE p_do_something
  AS
    l1 NUMBER;
  BEGIN
    SELECT /*+ find_me */
           my_global
    INTO   l1
    FROM   DUAL;
  END;
  --
END;
/

SQL>  exec p1.p_do_something;

PL/SQL procedure successfully completed.

SQL> select sql_text from v$sql where sql_text like '%find_me%';

SQL_TEXT
--------------------------------------------------------------------------------
SELECT /*+ find_me */ :B1 FROM DUAL

SQL>

Tags: Database

Similar Questions

  • Impossible to go from baseline of connection via functional Global Variable

    Hello

    I'm working on a project of producer/consumer based, which some parties have access to a MySQL database. After the connection to the database, I want to store the reference to the connection inside of a functional global variable. Then other parts of the project that need to use it can only read in the functional global variable.

    For some reason, the reference of the connection is not valid once it has been read functional global variable. It works fine if I have the reference directly from the connection to the request for enforcement VI wiring.

    I have attached a few screws that show the problem, but you will not be able to run them unless you have a database to connect to and hack you the query a little so he selects in your tables.

    SQL_whole_thing works very well. It connects to the database, returns information he requested by the query, and then disconnects. No problem.

    But if I run DB_Connect.vi (which stores the reference to 'DatabaseID_FGV' FGV), follow-up of SQL_Query.vi (which reads to the FGV reference), then I get an error saying that the reference is not valid.

    Anyone has an idea why this happens?

    Thank you

    Christian.

    PS: You'll need DBID_FGVActions.ctl and database_connectioninfo.ctl, also attached

    Your referance on the SR's "outdated" when implementing this way.  Essentially, this means that data in memory to this referance has changed because the referance was stored.  Just because you have changed the data at this location.  This prevents you from spend a refeance for the "old data" and crashing the calling application since the referance Rassi contains assumptions that are more adequate data.

    Consider upgrading this FGV powered Action.  This would be encapulate all the Actions you want to do to the database (connect, disconnect, fecth, writing etc.) and maintain the current referance on the AEs shift register.  Ben establishes a great deal for just this type of functional encapsulation in his famous nugget.  A must read for every programmer

  • How to create a Global Variable through the Project Explorer

    Hello world!

    I know how to create a global variable (in a vi through the range of functions...).

    but I'm missing a way to create one via the Project Explorer.

    It's a missing feature or just this documentation (and the intuition of myself) are missing?

    It would be very convenient.

    THX for your time and hope that answers.

    jwscs

    Right click on my computer > new > new... > select Global Variable.

    EDIT: although I agree with Gerd (he probably wondering why you need so we can recommend a better way ), I rarely use them in easy to write once - read many applications such as security levels overall program at initialization (VER) to read later, but NOT modified.  I know it would be better to make a good class, functional Global Variable (FGV) or a motor Action (AE) but globals ARE practical and safe IF used wisely.

  • How to access a global variable that is common between the different baskets project library

    My project consist of several libraries, after generation the library project packed for each library, I find it cannot share data in a global variable between different packaged project library file. For example: packed project library #1 contains VI variables global wirte 'position' and give it a value '400 '. Library #2 present another VI project try to read this global variable, but he gave reading of is NULL not "400". Why has this happened? Is it possible to solve, welcome any help, I wll appreciate for this!

    If you understand what is happening here...

    When you build a PPL, it takes in the .lvlib and also all the dependencies of the .lvlib.

    In your case, when you generate the Test Task.lvlib in a .lvlibp, she also pulls on a copy of the DataProcess.lvlib:GlobalsVariable.vi because it's addictive to read GlobalVar.vi.

    When your application runs, you end up with two copies of GlobalsVariable.vi in memory:

    DataProcess.lvlibp:GlobalsVariable.vi

    AND

    Test Task.lvlibp:: GlobalsVariable.vi (I don't know how PPLs namespace dependencies... If there is still the DataProcess.lvlibp)

    Because they are different screws (i.e. in a different namespace), they have their own memory and that's why you can't access the data.

    Your Test Task.lvlibp calls the version of GlobalsVariable.vi, he pulled the dependencies.

    To solve this problem - you must ensure that Task.lvlibp of Test calls the version of GlobalsVariable.vi of the DataProcess.lvlibp - you'll need to replace all instances with the version of the PPL. Of course, if you run DataProcess in the development environment, then it will always be bad namespaced, hence the suggestion to put your global variable VI in is own PPL that you then use in the process of data and Test tasks.

  • Package global Variable - Collection - Associative Aray

    All,

    What we are doing is...
    (1) fill us tab_emp_sal_comm with big collect and browse in a loop.
    (2) check if the deptno success is available in the tab_emp_sal_comm collection.
    (3) if it is available to fill a collection called tab_emp_sal_comm_1 and push corresponding only files inside.
    (4) of the corresponding collection, we want to fill at the table of global collection of package which is again of the same type.
    (5) by default for each new call old values are replaced, but I want to add the global variable at each call and finally do a big update to the corresponding tables.
    (6) l_deptno will be a parameter and values will change at each call of this procedure in the code in real-time.

    For the sake of ease, given an example simulated the EMP table. Goal is to add the global table in the package. Because each call, the previously loaded values are replaced. I want them to be available and additional calls should only add the values in the next set of lines instead of over writing.

    How to achieve it, please discuss.
    CREATE OR REPLACE PACKAGE employees_pkg
    IS
      type rec_sal_comm is record(esal emp.sal%type, ecomm emp.comm%type,edeptno emp.deptno%type);
      type at_emp_sal_comm is table of rec_sal_comm index by pls_integer;
      pkg_tab_emp  at_emp_sal_comm;
      pkg_tab_emp_1 at_emp_sal_comm;
    END;
    /
    -- Block Starts 
     declare
      -- Local variables here
      type emp_sal_comm is record(
        esal    emp.sal%type,
        ecomm   emp.comm%type,
        edeptno emp.deptno%type);
      type at_emp_sal_comm is table of emp_sal_comm index by pls_integer;
      tab_emp_sal_comm  at_emp_sal_comm;
      tab_emp_sal_comm1 at_emp_sal_comm;
      l_deptno          dept.deptno%type := 30;
      l_comm            number(7, 2) := 0;
      M_CNTR            NUMBER(7, 2) := 0;
    begin
    
      select sal, comm, deptno bulk collect into tab_emp_sal_comm from emp;
      for indx in 1 .. tab_emp_sal_comm.count loop
        if tab_emp_sal_comm(indx).edeptno = l_deptno then
          tab_emp_sal_comm1(indx).ecomm := tab_emp_sal_comm(indx).ecomm * 0.5;
          tab_emp_sal_comm1(indx).esal  := tab_emp_sal_comm(indx).esal * 0.75;
        end if;
      end loop;
      dbms_output.put_line(tab_emp_sal_comm1.count);
      dbms_output.put_line('**');
    
      m_cntr := tab_emp_sal_comm1.FIRST;
      loop
        exit when M_CNTR is null;
    --    dbms_output.put_line(M_CNTR || ' ** ' ||nvl(tab_emp_sal_comm1(M_CNTR).ecomm, 0));
        employees_pkg.pkg_tab_emp(m_cntr).ecomm := tab_emp_sal_comm1(M_CNTR)
                                                        .ecomm;
        employees_pkg.pkg_tab_emp(m_cntr).edeptno := tab_emp_sal_comm1(M_CNTR)
                                                          .edeptno;
        employees_pkg.pkg_tab_emp(m_cntr).esal := tab_emp_sal_comm1(M_CNTR).esal;
        m_cntr := tab_emp_sal_comm1.next(m_cntr);
    ---  other computations and calculations made based on the matched records
      end loop;
    
      employees_pkg.pkg_tab_emp_1 := employees_pkg.pkg_tab_emp;
     -- dbms_output.put_line('**');
    --  dbms_output.put_line(employees_pkg.pkg_tab_emp_1.count);
    end;
    -- Code will work in a Scott Schema with Emp Table.

    Hi Ramarun,

    (1) operator MULTISET, AFAIK, is to always give a dense nested table. To create a sparse nested table, the only way is to delete some items with the DELETE method.

    (2) using the 1... NesTableVar.count is valid only when the collection is dense. With the release of MULTISET UNION you won't have a problem. But if you have a loop in a rare collection, you must use another method.
    Below is an example:

    declare
      type  t_set is table of number;
      set1  t_set := t_set(1,2,3,4,5,6,7,8,9,10);
      idx   integer; 
    
    begin
      -- make collection sparse
      set1.delete(3);
      set1.delete(7);
    
      idx := set1.first;
      while idx is not null
      loop
         dbms_output.put_line('Set('||idx||'): '||set1(idx));
         idx := set1.next(idx);
      end loop;
    end;
    / 
    
    Output:
    Set(1): 1
    Set(2): 2
    Set(4): 4
    Set(5): 5
    Set(6): 6
    Set(8): 8
    Set(9): 9
    Set(10): 10
    

    (3) you can use FORALL update/insert/Delete with the help of a nested table. It is dense, you can use 1... NesTableVar.count, if it is rare, then you must use another method as explained here.

    Kind regards.
    Al

    Published by: Alberto Faenza on 2 December 2012 13:35

  • Database trigger can not see the package global variable after assign in my form

    Hello

    I faced the problem with the trigger and the package variable global using the form designer

    first of all, I get the local IP address machine using WEBUTIL in triggering of the PREFORM and initialize my global package variable by ' Client_Info_Pkg.Set_IP_Address (WEBUTIL_CLIENTINFO.» GET_IP_ADDRESS); ", then I tried to make the DML operation in my form and at the same time I trigger database also uses the package global variable of" Client_Info_Pkg.Gand_IP_Address; "to read in the package, and then insert it into the audit table


    The question this database trigger may not feel the initialization "Client_Info_Pkg.Set_IP_Address (WEBUTIL_CLIENTINFO. GET_IP_ADDRESS)' I did in triggering of the PREFORM and I used to wonder if oracle create new session to run this trigger so he can't see my boot or what?!. .

    the package

    CREATE OR REPLACE PACKAGE Client_Info_Pkg

    Global_IP_Address VARCHAR2 (100);

    FUNCTION Get_IP_Address RETURN VARCHAR2;

    PROCEDURE Set_IP_Address (p_Machine_Name IN VARCHAR2);

    END Client_Info_Pkg;

    /

    CREATE OR REPLACE PACKAGE BODY Client_Info_Pkg

    FUNCTION Get_IP_Address RETURN VARCHAR2 IS

    BEGIN

    RETURN Global_IP_Address;

    END;

    PROCEDURE Set_IP_Address (p_IP_Address IN VARCHAR2) IS

    BEGIN

    Global_IP_Address: = p_IP_Address;

    END;

    END Client_Info_Pk

    relaxation

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

    CREATE OR REPLACE TRIGGER RUNERP.FO_DOC_TYPES_L_T

    BEFORE INSERT OR UPDATE OR DELETE ON FO_DOC_TYPES

    REFERRING AGAIN AS NINE OLD AND OLD

    FOR EACH LINE

    BEGIN

    IF THE INSERTION

    RUN IMMEDIATELY ' INSERT INTO FO_DOC_TYPES_LOG

    VALUES ("I",: DOC_TYPE_ID,: DOC_TYPE_VALUE,: DOC_TYPE_NAME,: Vip_Address' HELP: NEW.) DOC_TYPE_ID,: NEW. DOC_TYPE_VALUE,: NEW. DOC_TYPE_NAME, Client_Info_Pkg.Get_IP_Address;

    END IF;

    IF THE UPDATE CAN

    RUN IMMEDIATELY ' INSERT INTO FO_DOC_TYPES_LOG

    VALUES ("U",: DOC_TYPE_ID,: DOC_TYPE_VALUE,: DOC_TYPE_NAME,: Vip_Address) "USING: NEW." DOC_TYPE_ID,: NEW. DOC_TYPE_VALUE,: NEW. DOC_TYPE_NAME, Client_Info_Pkg.Get_IP_Address;

    END IF;

    IF REMOVE THEN

    RUN IMMEDIATELY ' INSERT INTO FO_DOC_TYPES_LOG

    VALUES ("D",: DOC_TYPE_ID,: DOC_TYPE_VALUE,: DOC_TYPE_NAME,: Vip_Address) "USING: NEW." DOC_TYPE_ID,: NEW. DOC_TYPE_VALUE,: NEW. DOC_TYPE_NAME, Client_Info_Pkg.Get_IP_Address;

    END IF;

    END;

    /

    Thanks in advance

    I solved my problem by using the CONTEXT object, Michael thank you for your interest.

  • Global variables packed... rather than packaged procedure parameters...

    Hello
    There is only one version of procedures packed with parameters that are called in the following diagram.
    Package test
      function A(p1)
        as
         begin
           return x;
         end;
        
      procedure test1(x1 ..... ,
                             x2 tab%rowtype)
         as
           local_1 .....;

           begin
               ....
              local_:=A(p=>....);  /*the function is called*/
              test2(x3=>x1,    
                       x2=>x4);      /*the below procedure is called*/ 
           end;

      procedure test2(x3 .....,
                              x4 tab%rowtype)
       as
         begin
             .....                 /*before the commit another procedure
                                     is called (which is also declared in this package
                                     but is not written here....)*/
             insert into .....
             commit;
         end;
    Instead of passing parameters of the procedure for the procedure to be used in the last procedure, namely in test2, I consider to change the schema above and declare a packaged global variable which are available to all procedures in the package...
    Something like...
    package test
    as
        x1 ......;
       x2  tab%rowtype;
       <other variables>
      function A;
      procedure test1;
      procedure test2;
      ......
    Is there another way...?

    Note: I use DB 10.2.0.4
    Thank you
    SIM

    the only danger is almost simultaneously in the same session
    two executions of the packaged procedures/functions are running

    But that can never happen.

    A session is single-threaded (I don't know if it's the correct term).

    You cannot run two... things... at the same time.

  • Access via IP Global DMZ host

    Don't know if this is possible, but we have a host on a PIX 515e DMZ with local address 192.168.2.2 & a global address defined through static type (dmz, outside) statement. External hosts can access the server through the global address - no problem. Although we have full access to the host from the inside through the address 192, it is possible to access the host through its global address from inside - some of our applications are hard-coded to use the global IP address! This allows to work with our old firewall.

    Any help much appreciated.

    Thank you

    alias can help you:

    (inside) alias dmz_global_ip_address dmz_local_ip_address 255.255.255.255

    For more information:

    http://www.Cisco.com/en/us/products/HW/vpndevc/ps2030/products_tech_note09186a0080094aee.shtml#Topic1

  • To access the Global Variables in the functions/methods

    Which of the following statements is better in terms of performance and efficiency?

    public var a: int = 0;


    public void add (): void {}

    a += 5;

    }

    Addition();

    OR

    public var a: int = 0;

    public void Addition(b:int):int {}
    b += 5;
    Back to b;
    }

    a = (a) Addition;

    I saw a lot of guides discourages the use of global variables in the functions/methods, but I just don't understand why anyone would create a copy of the variable, modify this copy and to grant this value to another variable and throw.

    You must create an instance to pass to your function.  the parameter (for example, mov) does not create a separate instance and creates only a temporary pointer to the passed object.

    If an instance is prepared for gc, having spent this instance to any number of methods (as a parameter) delay / will not interfere with ca.

    and Yes.

    MOV ['x'] = mov.x,

    MOV ["rotation"] = MOV.rotation,

    MOV [anypropertystring] = MC.anyproperty

    Flash uses array notation to solve strings into objects:

    var var1:ClassType = new ClassType();

    This ['var1'] = this.var1

  • Table as a global variable

    It left me speechless.

    I have looked through examples and the forum, but could not find a solution to my problem.

    I am writing a program that has a table of values on the screen before and various under vi that update the values in the table.  I have to be able to read the values of the cells in the table, but I understand that this cannot be done.  So I try to use tables to keep the values that I want to read and just write to the table when I have to.

    In any case, I need to create a table that can be accessed by all the sie.  I added a table to the gobal.vi control but when I select a sub vi I get a node of Blackboard, and if I have anything wiring him get a cut wire.

    I have attached the screws overall and initializatio

    You have added an empty array to the Global Variable. Just add a numeric control to the table in the GV, and you will get a table of numerical values, which you will be able to use.

    Thank you

    AREV

    CTO | RAFA solutions

  • Global Variables are preferable to the Globals functional - so there! :-)

    I feel a little controversial today so forgive the brutal title of this post

    I've never used global variables because I was under the misconception that they are somehow 'bad '. That's all I've heard since I started learning the LabVIEW. Review the code in the nets upconvert and downconvert. The ugliest code uses globals and some of the most beautiful code does not work. This means that bad programmers use global variables and globals are so bad programming practice. This is not true. Globals are just easy to use for newbies to use them. ' Not initialized what? I can't find those on the pallette? »

    I think I always wondered unconsciously that globals are bad. They are not bad, it is their use that may be bad. This is true for anything in life.

    The first and the most obvious problem with global variables is racing conditions. But this is not strictly the overall causing the race condition. This is the data stream is not defined.

    But the same is true if functional a global being misused. In the example below there is nothing to enforce data streams.

    You must run the data flow with a thread of error for example.

    Globals do not have a thread of error but not fear - the man of the sequence is here!

    You only need the sequence if the global is directly on your drawing. These two structures of single image sequence could be replaced by a NumericWrite.vi and a NumericRead.vi containing nothing but overall, a command or the indicator respectively and the terminals of the error. Put it online and it is good as gold. Or you might have a Subvi containing nothing but a frame two cases selected by an enumeration containing the elements 'Get' and 'Set '. Now, it looks like a duck and quacks like a duck. Don't you worry by the overhead of the structure of the case either. If the enum is a constant, it will be unfolded.

    Another problem with globals, it's that they are, well, global. Is not different from a functional overall, so it isn't really a problem anyway. Globals and globals functional it is easily taken by placing them in a library and define the scope of the access. Not to mention that libraries give you namespaces and "namespaces are one honking great idea - do several of these!" *

    The real reason to use a global rather than a functional overall is that they are about twice as fast.

    Until this morning I would have recommended to use a more functional global overall. But I changed my mind. Someone can it change back?

    * The Zen of Python


  • global variables shared between several targets of RT

    Hello

    I'm looking for some information about variables shared between RT communication network.

    Scenario: a PXI 'master' and several 'slave' PXIs running that screw RT. data is available in the form of a cluster of definied type on each slave PXIs (inside a non deterministic while loop). I guess I create global variables of network shared for each PXI slaves. A variable for each slave. I only write data in these variables in one place (above mentioned, while loops), on the PXIs slave. I need to read that data in a way with loss (I just need that value the most recent, as tags) from the master PXI.

    Question: can I simply use "network shared variable" settings by default? I mean, I do not enable the option RT FIFO (single element), because I think that for a cluster that is a no go in the case of RT (variable length)?

    What do you think? Or would you have better idea how to share data between slaves and masters RT targets (I do not have deterministic/losless transmissions, only these last values)?

    I think that the way to proceed is to use the shared Variable Aliasing/binding - they allow you to 'link' shared variables in any of the multiple targets. https://forums.ni.com/t5/LabVIEW/Bind-Alias-shared-variable-to-scan-engine-variable/td-p/3290043.

    You can also use shared variables of programming access to access running on another target: http://zone.ni.com/reference/en-XX/help/371361G-01/lvconcepts/usingdynvarapi/

    With regard to the other methods - you could always disseminate data via UDP multicast (or with a TCP/IP connection manager).

  • Global Variable length problem

    Hi all

    I'm moving a group of a pll key values.
    I'm holding all the key values in a text field that can contain up to 10000 bytes and I'm assigning the text field values to a global variable.
    This value of the global variable is read by pll and fetch the records using these key values.

    But I'm getting ORA-06502 error. This is a question about the length of the variable.
    Form builders help I got to know that this global variable can hold only up to 5000 bytes.

    Suppose that
    New_id is a text field that has more than 7000 bytes values separated by comma

    New_id is that a text field of type char length is 10000,

    +: global .new_cust_id: = Block.new_id +;

    On this line, I get ORA-06502 error, because this value is used by other packages.

    Can someone help how do I fix this

    Use forms [32 bit] Version 11.1.1.4.0 (Production) and Oracle database 11 g R2

    Thank you
    malandain

    Citing the Globals online documentation:

    A global variable is a variable of Oracle Forms whose value is available for the triggers and the subprogrammes in any module that is active in the current session. In previous versions of Oracle Forms, a global variable stores a string of length, for all uses up to 255 bytes. In Oracle 10g form, global variables are now limited to 4000 bytes when they are set or referenced using PL/SQL bind variable notation. for other uses, no limit is imposed.

    This means: If you access the global variable like this:

    :global.variable := value;
    

    You can store up to 4000 bytes in length. If you use the copy and name_in built ins you should be able to store up to 32767 bytes in a global variable.

    see you soon

  • How to declare global variables with the help of another global variable in ODI

    I declare a variable gloabal using another global variable.
    Suppose for example that:

    I have a global variable empid.
    I'm decalaring an another global variable empname refreshing the global variables tab and select statement is

    Select empname emp where empno = #GLOBAL .empid - if I write like this I get the error message like character not valid.

    Select empname emp where empno = ' #GLOBAL.empid '-if I write like this I get the error message in the number not valid.

    I kept the datatype as digital and non-persistent action

    Help, please

    Thank you in advance.

    Hello

    You must perform this operation from a package.

    V1 (COOLING MODE) - OK---> V2 (REFRESH MODE)

    Thank you
    Fati

  • How to set global variables for use by all THE #subform [0] items of form1. ?

    Hi all

    I don't know how to code javascript but am new to Adobe LiveCycle.  When I open the script editor, I have the following code (the code is in United Nations in bold):

    -form1. #subform [0]: initialize :-(FormCalc, client).

    //////////////////////////////
    TO START: SET GLOBAL PRICES.
    //////////////////////////////

    var Cityscope_Sydney_CostUser1 = 60,39;
    var Cityscope_Sydney_CostUsers2to5 = 3.02;
    var Cityscope_Sydney_CostUsers6to20 = 1.21;
    var Cityscope_Sydney_CostHardCopyWithOnline = 14.59;
    var Cityscope_Sydney_CostHardCopyWithoutOnline = 54,67;
    var Cityscope_Sydney_CostHardCopyAdditional = 14.59;

    var Cityscope_NorthSydney_CostUser1 = 48,40;
    var Cityscope_NorthSydney_CostUsers2to5 = 2.42;
    var Cityscope_NorthSydney_CostUsers6to20 = 0.97;
    var Cityscope_NorthSydney_CostHardCopyWithOnline = 14.59;
    var Cityscope_NorthSydney_CostHardCopyWithoutOnline = 43,54;
    var Cityscope_NorthSydney_CostHardCopyAdditional = 14.59;


    ////////////////////////////
    END: SET GLOBAL PRICES.
    ////////////////////////////

    -form1. #subform [0]: enter :-(FormCalc, client).

    -form1. #subform [0]: output :-(FormCalc, client).

    -form1. #subform [0]: calculate :-(FormCalc, client).

    -form1. #subform [0]: validate :-(FormCalc, client).

    -form1. #subform [0]: preSave - (FormCalc, client).

    < < = etc etc etc = > >

    -form1. #subform [0]. Item1Cost::initialize :-(JavaScript, client).

    -form1. #subform [0]. Item1Cost::enter :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::exit :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::calculate :-(JavaScript, client).

    Store the values of the form of friendly names.
    var AreaSelected = Item1Area.rawValue;
    var NumberOfUsersSelected = Item1Users.rawValue;

    Declare other variables.
    var Users1Calculation;
    var Users2to5Calculation;
    var Users6to20Calculation;


    Calculate the cost to the "components" user will depend on the number of users selected for the region.
    Switch (true)
    {
    If (NumberOfUsersSelected < 2):
    Users1Calculation = NumberOfUsersSelected * Cityscope_Sydney_CostUser1;
    Users2to5Calculation = 0.00;
    Users6to20Calculation = 0.00;
    break;
    If (NumberOfUsersSelected > 1 & & NumberOfUsersSelected < 6):
    Users1Calculation = Cityscope_Sydney_CostUser1;
    Users2to5Calculation = (NumberOfUsersSelected - 1) * Cityscope_Sydney_CostUsers2to5;
    Users6to20Calculation = 0.00;
    break;
    If (NumberOfUsersSelected > 5):
    Users1Calculation = Cityscope_Sydney_CostUser1;
    Users2to5Calculation = 4 * Cityscope_Sydney_CostUsers2to5;
    Users6to20Calculation = (NumberOfUsersSelected - 5) * Cityscope_Sydney_CostUsers6to20;
    break;
    by default:
    Alert ("BROKEN: calculate the individual components of cost of use will depend on the number of users selected for the region.");

    }

    apply the total cost for this article
    Item1Cost.RawValue = Users1Calculation + Users2to5Calculation + Users6to20Calculation;

    -form1. #subform [0]. Item1Cost::validate :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::MouseEnter :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::mouseExit :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::change :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::full :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::MouseUp :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::MouseDown :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::click :-(FormCalc, client).

    -form1. #subform [0]. Item1Cost::preSave - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::postSave - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::prePrint - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::postPrint - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::preSubmit:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Cost::docReady - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::docClose - (FormCalc, client).

    -form1. #subform [0]. Item1Cost::ready:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Cost::ready:layout - (FormCalc, client)-

    -form1. #subform [0]. Item1Users::initialize :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::enter :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::exit :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::calculate :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::validate :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::MouseEnter :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::mouseExit :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::change :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::full :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::MouseUp :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::MouseDown :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::click :-(FormCalc, client).

    -form1. #subform [0]. Item1Users::preSave - (FormCalc, client).

    -form1. #subform [0]. Item1Users::postSave - (FormCalc, client).

    -form1. #subform [0]. Item1Users::prePrint - (FormCalc, client).

    -form1. #subform [0]. Item1Users::postPrint - (FormCalc, client).

    -form1. #subform [0]. Item1Users::preSubmit:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Users::docReady - (FormCalc, client).

    -form1. #subform [0]. Item1Users::docClose - (FormCalc, client).

    -form1. #subform [0]. Item1Users::ready:form - (FormCalc, client)-

    -form1. #subform [0]. Item1Users::ready:layout - (FormCalc, client)-

    .. and so on and so forth...

    In short, I want the code in:

    -form1. #subform [0]. Item1Cost::calculate :-(JavaScript, client).

    .. .to be able to access the variables I created in:

    -form1. #subform [0]: initialize :-(FormCalc, client).


    (I guess that's where I store global variables)

    At this point, global variables are not accessible with the above configuration.  Was the only one I can get this working is to cut and paste the Globals in each item of form1. #subform [0], which of course defeats the purpose of global variables!  I intend to have a lot more items so wouldn't duplicate global variables for each of them!

    Can someone show me how to do this?

    Any help is very appreciated!

    Thank you

    Stanbridge

    Post edited by: stanbridgej - colors and fonts or not will not save.  Are bolded my question make (non-fat) code easier to read (I hope).

    I haven't used Formccalc, but I thought it would be the same regardless. Insert a script object to the top of the hierarchy and call it, for example "sco." Paste the Globals. Then refer to variables of the extent that sco. Cityscope_Sydney_CostUser1, etc. Make one

    App.Alert (sco. Cityscope_Sydney_CostUser1);

    one of the fields. If the debugger is activated, it will tell you if it cannot resolve the reference as "sco. In this case, you may need to use the som expression to reference the script object, for example

    var scoScript = xfa.resolveNode ("topOfHierarchy.sco");

    scoScript.Cityscope_Sydney_CostUser1

    But if as close as possible to the top of the hierarchy above should work.

Maybe you are looking for

  • How can I update with a version without losing any data?

    I have a ZTE open regularly update with custom versions. Whenever I do this, I lose all my data on the phone, like contacts, applications installed in the store of market parameters (including wireless and send the parameters). All these data and rec

  • won't start does not after a recovery

    My G61-320US... LAPTOP CLOSED JUST BY ITSELF AND I USED IT... WHEN I PUT IT, BUT I HAD AN OPTION OF RECOVERY AND HAS DONE FOR MORE THAN 3 DAYS NOW IT DID NOT START UP AND WHEN I PRESS THE POWER BUTTON IT JUST BLINKS OUNCES AND SHE

  • Executable version is not possible

    Hi all I get the error message (displayed below) during the generation of executable file, a few days back it was all good, but then I updated my labview code and now I get this error Error 6a held at AB_Destination.lvclass:Create_Destination.vi-> AB

  • P6 - 2182l: is it possible to update card on Hp desktop computer

    Mobo is p6 - 2182l and the old graphics card is disabled. so I bought a new today ASUS GT 740 2 GB of DDR3 memoryI put in the card and try to start the pcthen he stuck to the hp startup splash screen can not bootIf I try to clear cmos and bios update

  • I purchased Office: mac 2008 Home and Student edition. Can I use it for my Windows XP computer? __

    Ideas: You have problems with programs Error messages What you have already tried to solve the problem Remember - this is a public forum so never post private information such as numbers of mail or telephone!