declare global variables

Hello
I'm doing what is said here: [http://www.tek-tips.com/viewthread.cfm?qid=200545 & page = 13]
And at the end of the day, it is said that "declare any global variables before running the form."
My question is where and how can I declare these variables? When I tried to run the form, in the status bar, I
FRM-40815: GLOBAL Variable. There is no such thing as a FLAG.

Please help me.
Thank you!

Hello rage.

before reading the value of a global variable, you'll first need to initialize.

to make your first form, type *: GLOBAL. Variable: = initial value; *

Kind regards

Manu.

Tags: Oracle Development

Similar Questions

  • 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

  • where and how to declare global variables

    I am creating a Flash multiple-choice quiz. I created a clip named mc_Quiz. This clip contains a layer of action and an object layer. THW action layer contains 1 keyframe with code (code of a button that moves to the next section).

    The object layer contains 11 contains keyframes 10 the KeyFrames
    a single movie clip question, (mc_Q1 through mc_Q10) and a btnNext to move to the next section. The video clips in question (e.g., mc_Q1) contains a "btnCheck" button and the code to check the answer.

    The 11th framework contains a film click that contains an input text box 'userName', a 'score' of the user's dynamic text box and a submit"" button. Not yet submit the information anywhere, I do it so that when I click on the "present" enter key 'Please enter your name' if it is empty. " And if it is not empty, it will be 'Thank you.'

    What I have to do is to have the 'btnCheck' to add 10 points for each correct answer to a variable. Then place this total in the 'rating' dynamictext box when the user moves the frame 10 to 11. I don't know where declaring the variable and how to add the variable every time the correct answer is given.

    How this is done?

    Here's something that does not work.

    First image of "mc_Quiz":

    Stop()
    var advanceNext:Number = currentFrame;
    static var; userScore:Number;
    btnNext.addEventListener (MouseEvent.CLICK, nextQuestion);

    function nextQuestion(evt:MouseEvent):void {}
    gotoAndStop(advanceNext ++);
    }



    As part of "mc_Q1".

    Stop()
    messageBox.text = ""; Clears the response area
    var correctAnswer:String = "Holy"; Good response for comparison games
    var userAnswer:String; with the value of the radio button group.
    var rbg:Object = rbA.group; Get the name of a group from the first button ragio.


    btnCheck1.addEventListener (MouseEvent.CLICK, checkAnswer1);

    function checkAnswer1(evt:MouseEvent):void {}
    userAnswer = String (rbg.selectedData);
    If (userAnswer == correctAnswer) {}
    messageBox.text = "Yes", + userAnswer + ' is CORRECT! ";
    userScore = score.value + 10;
    rbA.enabled = false;
    rbB.enabled = false;
    rbC.enabled = false;
    rbD.enabled = false;
    }
    else {}
    messageBox.text = "your answer is INCORRECT.";
    rbA.enabled = false;
    rbB.enabled = false;
    rbC.enabled = false;
    rbD.enabled = false;
    }
    }

    In fact, I have no idea where to declare the variable or how to add 10 points when I select the right answer. It seems to me that I have to some how change this variable within the function of the button.

    AS3 does not directly support global variables, like its predecessors, but there are ways around it. Without going through the overall road, to communicate from a child object to a parent the normal approach in AS3 object would (literally)...

    MovieClip (this.parent) .totalScore += 10;

    Alternatively, you can create a world class and use that. If you save the following in a file named "global.as" in your class path (or file that your project is the folder), you can use the variable in a global sense, while importing the class where it is needed:

    package
    {
    public const global: Object = new Object();
    }

    Use it in the Flash file...

    global import;

    global.totalScore = 0;

  • APEX 4.2 translate data 'function and Global Variable declaration '.

    Hello everyone,

    I use APEX 4.2.1.00.08 and I wonder if there is a way to translate "Function and Global Variable declaration" textarea. Any other script text box is available for translation, but not this one.
    I know what the code is loaded on the header, but may contain important alert messages of global functions.

    Thanks in advance.

    Hi Grandmaster,

    "Function and global variables declaration" contains the JavaScript code, that is why it is not wise to include in the standard translation process.

    In my opinion, you have several options to access your translated messages:

    -) Use Application-> Substitutions or
    -) Store your message in the form of component shared-> SMS and and assign it to an application with the APEX_LANG element. Api MESSAGE (http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_lang.htm#CHDBCEAB)

    In 'Function and Global Variable declaration' use substitution syntax to replace the value. For example:

    var myDeleteMessage = "&G_MY_DELETE_MESSAGE.";
    ...
    alert(myDeleteMessage);
    

    where G_MY_DELETE_MESSAGE would be a part of the application or the request for Substitution.

    Concerning
    Patrick
    -----------
    Member of the APEX development team
    My Blog: http://www.inside-oracle-apex.com
    APEX Plug-Ins: http://apex.oracle.com/plugins
    Twitter: http://www.twitter.com/patrickwolf

  • Declaring a global variable

    Hi all


    -I need to declare a global variable to be used by different packages.

    -The variable is not assigned a constant value, but the values returned using the function.

    example:

    CREATE or REPLACE PACKAGE xyz
    IS

    v_xyz NUMBER: = function_get_value();

    END;


    Now, I need to use it in other packages. Can is it possible to specification we have function to assign the value of a variable.

    -Please suggest?

    You must use a block of initialization package:

    SQL> CREATE OR REPLACE
      2    PACKAGE xyz
      3      IS
      4        FUNCTION function_get_value
      5          RETURN NUMBER;
      6          v_xyz NUMBER;
      7  END;
      8  / 
    
    Package created.
    
    SQL> CREATE OR REPLACE
      2    PACKAGE BODY xyz
      3      IS
      4        FUNCTION function_get_value
      5          RETURN NUMBER
      6          IS
      7          BEGIN
      8              RETURN DBMS_RANDOM.VALUE;
      9       END;
     10       BEGIN
     11           v_xyz := function_get_value;
     12  END;
     13  / 
    
    Package body created.
    

    Now keep in mind, initialization packet block is called once only to the package of instantiation, so XYZ package global variable. V_XYZ value will not change throughout the session (until the next instantiation of package in the session to be precise):

    SQL> SET SERVEROUTPUT ON
    SQL> EXEC DBMS_OUTPUT.PUT_LINE(XYZ.V_XYZ);
    .06647500321795706139255917869240018349
    
    PL/SQL procedure successfully completed.
    
    SQL> EXEC DBMS_OUTPUT.PUT_LINE(XYZ.V_XYZ);
    .06647500321795706139255917869240018349
    
    PL/SQL procedure successfully completed.
    
    SQL> EXEC DBMS_OUTPUT.PUT_LINE(XYZ.V_XYZ);
    .06647500321795706139255917869240018349
    
    PL/SQL procedure successfully completed.
    
    SQL> 
    

    SY.

  • How to declare a global variable

    Hi all

    I want to declare a variable in Graf and assign its value to the No.

    And in certain conditions in PFR() I want to change the value of this variable to YES.

    in Graf

    {

    String test = "NO";

    }

    in pfr()

    {

    If (some condition)

    {

    test = "YES";

    }

    }

    How can I do this?

    Thank you stephanie... Thank you very much...

  • DLL and global variables

    OK, here's a strange problem.  I am very new to create the dll, so I don't know that I have just an installation problem.

    But I'm trying to pass a global variable of a host program to its attached DLL.  I got this job when I was the CVI 2014. I recently upgraded to 2015 and then started getting "undefined symbols" errors.  With some struggle I managed to compile again, but broke the variable connection in the process.

    I have compiled my DLL in debug mode so that I walk in from the test project.  Right now, my global variable exists in the test project, as well as in the DLL.

    Can I export the variable and the use of DLLIMPORT/DLLEXPORT?  Confused and curiously not to find anyone quite like this on the forums.

    EDIT: this post stack overflow described pretty well from my experience.  I am linking statically.

    Well, what do you know?  I found my problem.  This draft article and example WERE vital to the solution.  This article called, "using the Export method qualifier"was also useful.  I'll cut to the Chase...

    If you use a qualifier of export on the definition and the import on the declaration, LabWindows/CVI identifier export symbol.

    This is the right key.

    So in my example, it should look like this:

    DLL fichier.c

    int DLLEXPORT varName = 0;

    Header.h DLL

    int DLLIMPORT varName;

    Project that uses DLL.c

    #include "header.h DLL.

    varName! = 1 ;  a method to change this variable for local use

    Pretty easy, huh?  But wow, it took some time to find.

  • Global variables in reports 6i

    Hello

    I use Forms 6i, where I use Global.username as a global variable to store in the database to create logs for Audit control who made the entry.

    Now, I want to use global.username in report 6i during printing. How I can use it.

    Sandy

    Dear Sandy,

    Please try the following code.

    DECLARE
      List_ID   PARAMLIST;
    BEGIN
      fgsalesplan;
      List_ID := GET_PARAMETER_LIST('TEMPDATA');
      IF NOT ID_NULL(List_ID) THEN
      DESTROY_PARAMETER_LIST(List_ID);
      END IF;
      List_ID := CREATE_PARAMETER_LIST('TEMPDATA');
      ADD_PARAMETER(List_ID, 'P_USERNAME', TEXT_PARAMETER, :Global.username);
      RUN_PRODUCT(REPORTS, 'c:\erpsystem\plan\FgSalesPlan', SYNCHRONOUS, RUNTIME, FILESYSTEM, List_ID, NULL);
    END;
    

    Manu.

  • Create the global variable

    I am new to animate. Please can you tell me how I can declare a global variable?

    I try to have a single button that plays the next 10 frames, another button that plays the next 20 images. I put the event listeners for the buttons on the first image. I'm putting the code on the timeline each 10 images that works if the game has to stop. I would like to connect with some global Boolean values. The project is the html canvas.

    It must be simple. Can you help me?

    Scope of variables in canvas mode:

    myVar = 1; variable is accessible everywhere in the current page

    this.myVar = 1; variable is accessible in all the images of the current clip

    var myVar = 1; variable is accessible in the current context only

    So yes, the creation of a global variable is simple the most.

  • 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

  • Global variable in Oracle form 6i

    Hello

    How and where to set global variable in Oracle form 6i and also I would like to know how to access.


    Thanks in advance

    Kind regards
    Sanket

    Hello

    Global variable are variable specifice forms.
    It can store up to 255 for all uses character value.
    We can initialize when we declare otherwise give error if we has not assigned a value any.
    Oracle 10g, it can take up to 4000 bytes

    GLOBAL.ur_globalvar := TO_CHAR(15);
    
    or
    
    :GLOBAL.ur_globalvar:= '15';
    
    or 
    
    Remmber numeric values are implicitly converted by oracle 2 character
    
    :GLOBAL.ur_globalvar:= 15;
    
    -- which can then subsequently be accessed using...
    
    :GLOBAL.ur_globalvar;
    
    -- To destroy a global variable and release its memory, use the ERASE built-in procedure:
    
    Erase('GLOBAL.my_var'); 
    

    Kind regards

    Abdetu...

  • Global variables and for loops

    Hello

    I am working on my project for my programming course (a game of Connect 4) and am now in gritty step to rewrite all the code to make look it somewhat professional. Was it the original... disaster: http://zephyr.pastebin.com/7kfyaMRY--Oui, I know who will probably do someone of you cringe. I try to avoid the massive chain of JPanel panelXxY = new JButton(""); using loops for. I need to keep global variables so that I can call in my actionPerformed method, but apparently you can not put a loop outside of a method or main and even if you could, apparently all variables declared in a for loop said would not exist outside this loop. So, any suggestions? Keep in mind that I only knew even what a string for all... 10 weeks, so please nothing too complicated.

    Thank you ~.

    See the following for some ideas:
    Update of textFields via a For loop

    To Connect-4, you can use a two-dimensional array.

  • Singleton vs normal/global variable

    Hi just been looking intot he singleton pattern. WHY should I use this template to contain the variables accessible to other sovereign wealth funds throughout the project when I can just keep in the film container and access as you wish.

    Is there an advantage as optimization, security, usability etc...

    I'll post a question re: how to access a varibale in a mc parent except if answered here too as it is in the same category.

    It is better to go to a varibale in the parent uses

    1 MovieClip (parent.parent) .variableTargeted

    OR

    import com.parentAsDocument;

    Then navigate to the variable

    Thanks in advance

    (btw. I've never seen this in tutorials anywhere - and I've read for years - I missing something here or is - something advanced programmers don't know because they read advanced books?)

    If I need to use global variables - I'll probably use public static properties (variables) and methods in a special class that is designed to provide the values of these variables (or the features of the static methods) for the entire application. Any object making the reference to this class will be able to read/write these values.

    You are already familiar with static properties. For example when you add event listeners you write:

    mc.addEventListener (Event.ENTER_FRAME, handler);

    ENTER_FRAME is a static variable (and also a constant) which is accessible to ANY other object in the application around the WORLD.

    On the issue of container, I think you're talking about higher-level (timeline or document class) code. If my impressions are correct - no, I would never declare static properties or methods for the use of the application to scale. As I said, I would create a class special and this feature delegation to the and then tap other classes if necessary top.

    Frankly, I would never use timeline for anything unless someone puts a gun against my head (or hands a lot of money). In fact I avoid using IDE Flash quite like a plague. I mean that for one purpose - timeline coding is treacherous (and, oddly, more complicated than the use of the class) and encourage people is not to think of OBJECT-oriented way. The main disadvantage is that developers often assume that the chronology provides a kind of guarantees and the decorum and thus developers spend hurt little time thinking about the architecture of application in a more abstract way.

    I highly suggest if you consider excel programming skills to give up the chronology of coding as soon as possible (including the use of the Flash altogether) and move toward Flash Builder or any other environment. Benefits are awsome and you will never want to go back to the timeline.

    If you want to me - I'll give you a more concrete example of how I would approach implementation of the static aspects of the classes.

  • 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.

  • What are the best practices for use of GLOBAL Variables

    Hello

    Please guide how Global Variables can be declared and how they can be initialized.


    Further please guide what are the impacts of the Variables(if any) world on the memory of the CLIENT or the SERVER, if they are not initialized or released after use.


    Thank you.

    Kind regards.

    There are 255 characters (fixed) - or a less than before, don't know if they still are that length.
    My preference is not to use and use the settings or package variables. There is no real control of globals, so you may find yourself with an applications which has a good number of them which is used only once but which persists during the user's session.

Maybe you are looking for