Change global variable from symbol

Hi Everyone,
I need help making changes to a global variable.  I set a variable up on the creationComplete using the code: sym.setVariable("information", 1);
Later in the project I want to call up that variable and then increase the value on a button click. In the button symbol (onClick) I can call up the variable by using: var paragraph = sym.getComposition().getStage().getVariable("information");
When I use an alert(paragraph), the proper value shows up.  But, on the click, I need to change the value of the stageComplete variable "information" to 2.
Can anyone give me some guidance on what I'm not doing right?
Thanks
Randy

Hi,
It seems you want to increment using sym.setVariable() and sym.getVariable().
First step: sym.setVariable("counter",1); // it means: counter = 1;
Second step (another panel): sym.setVariable("counter", sym.getVariable("counter") + 1); // it means: counter = counter +1; or counter += 1
Demo: https://app.box.com/s/dqml4wtbcimtjvlkf2ol

Similar Messages

  • How to change Global variable in the query

    Hi,
    I have 6 reports which is using 0PDT as a global variable and has single option as a property. Now I want to change this property and have multiple selection but I am not able to change its property.
    I am able to see all the filter variables from the query property and from there I am getting edit option to change but the "single selection" option is grey/disable which is preventing me to make change in this variable. Is there any way that I delete this variable and create a local variable which has date range option.
    This is affecting all my reports and all the report needs date ranges instead of single select option.
    Thanks,
    Shivani

    Shivani,
        You can change the restrictions with new variable(right click on required infoobject and choose restrict -->> choose variables -->> move existing variable from right to left and move  new variable. Then you can see only one variable.
    You can not delete any variable if is using in some queries.
    how to restrict:
    Srini<a href="http://help.sap.com/saphelp_nw04/helpdata/en/f1/0a563fe09411d2acb90000e829fbfe/content.htm">Restricting Characteristics</a>

  • How do i create and pass a global variable from one vi to several sub-vi's?

    Hi Guys,
    I am trying to create a program that opens several front panels (sub-VI's) in sequence. in each front panel, the user would open a file that the name is obtained from the previous sub-VI. I would like to know how i could pass the filename and refnum of the file thorough from one sub-vi to another. A global variable would do it in VB, but how do we do global vars in LABWIEW. thanks
    Papish

    I put together a sample VI and Sub VI that illustrates how to pass a Refnum and access a data file while in a Sub VI.
    For multiple VIs just repeat the sub VI process.
    You probably don't wanna use a Global Variable if not needed (can add to the mess down the road haha).
    Let me know if it helps you out! Or if I can clarify anything else!
    Chances are if you have seen VI in the forest it hasn't fallen.
    Attachments:
    Passing Refnum.zip ‏21 KB

  • How to get value for a global variable from an exel file?

    Hallo all,
    I am a beginner in LabVIEW and I have  a problem in reading datas from an exel file . I would like to import a group of data with timestamps from exel file to a global variable. for ex. speed, acceleration and position of 4 different sensors to each of its global variable.
    It will be very nice if anyone can give me some ideas.
    Thanking you in advance

    ...continued here

  • Call function in LabView from a DLL, then access global variable from DLL

    I have created a DLL in LabWindows with a function and a structure.  I want to call the function from within LabView and then access the global structure.  I am able to call the function from the DLL with a "Call Library Function Node" and can access the return value, but I cannot figure out how to access the global structure.  The structure is declared in the DLL header file with __declspec(dllimport) struct parameters.
    Is there any way of accessing this structure without using the Network Variable Library?
    Solved!
    Go to Solution.

    dblok wrote:
    When you say "access to" or "the address of" the global variable, do you mean to pass the variable as an argument to the function call in the DLL?  If so, then I was not really sure how to pass a cluster from LabView by using the "Call Library Function Node".
    Yes, that's exactly right.  I would include a pair of helper functions in the DLL to read and write the global variable.  Alternatively you might write separate helper functions for each field inside the global structure, depending on the number of fields and whether you want to do any validation on the values.
    You can pass a cluster by reference to a function that expects a struct by setting the parameter to Adapt to Type, so long as the cluster does not contain any variable-length elements (strings or arrays).  The cluster needs to match the struct exactly, and sometimes that involves adding extra padding bytes to make the alignment work.  Variable-length elements in LabVIEW need to be converted to clusters containing the same number of elements as the struct definition (for example, if your struct contains char name[12], you would create a cluster of 8 U8 values, and you could use String to Array of Bytes followed by Array to Cluster to convert a LabVIEW string into that format).  If the struct contains pointers it gets more complicated, and it may be easier to write functions in the DLL to access those specific elements individually.
    If you can't get this working or need help, post your code and an explanation of the error or problem you're seeing.
    EDIT: it is also possible to include a single function in the DLL that returns the address of the global variable, which LabVIEW can then use to access and modify the data, but that's more complicated and likely to lead to crashes if you don't get the memory addressing exactly right.

  • How to declare a global variable from a PL/SQL package

    Hi All,
    Using a global variable is a bad practise for all language. However, in my case, I have a PL/SQL package defines all constants, and I want to use them directly via SQL statement, for instance,
    PACKAGE my_const
    IS
         DEFAULT_ZIP_CODE CONSTANT VARCHAR2(5) := '00000';
    END;And I cannot referrence this variable from my select statement as
    SELECT my_const.DEFAULT_ZIP_CODE from dual;I have to create a function via my package, as,
    FUNCTION get_default_zip_code RETURN VARCHAR2
    IS
    BEGIN
         RETURN DEFAULT_ZIP_CODE;
    END;and
    SELECT my_const.get_default_zip_code from dual;I don't want to create functions to referrence the default varaibles. Does anyone have any clues?
    thanks
    Edited by: user4184769 on Jul 19, 2010 8:36 AM

    riedelme wrote:
    thanks for the info. Your scope explanation makes sense even though it is not intuitive to me. I think the usage of package variables should be supported by SQL (they're just values to be copied) Maybe look at it from another language's perspective. You want to use a global PL package variable in Java/C#/Delphi/VB/etc. How would you do it?
    None of these languages can crack open the data segment of a PL code unit, inspect the variables in it, and extract a value from it. Instead, it needs to be done as follows:
    Using sqlplus as the client illustrates how all these languages will need to do it:
    SQL> var value varchar2(20);
    SQL> begin
      2>     :value := SomePackage.someVar;
      3> end;
      4> /So why should SQL behave differently? It is not the same as the PL language. It is not a subset of the PL language. Yeah, PL/SQL blurs the line between these 2 languages making it very simple for us to mix their source code. But PL/SQL is SQL integrated with PL - not PL integrated with SQL. PL has tight hooks into SQL, creating cursors for you, defining bind variables, binding variables and doing the whole Oracle Call Interface bit for you.
    But SQL has no need for PL code, just as it has no need for Java code, or Delphi code or VB code. Yes, it is possible for it to call Java stored procs. As it is possible for it to call PL procs. But these are via the formal call interface of those languages - not via tight integration hooks that blur the languages and make SQL and Java, or SQL and PL, look like a single integrated source code unit.
    Thus SQL has the pretty much the same constraints in calling the PL language as other languages do. What SQL can do is use the PL engine's call interface and tell it "+execute this function and return the result of the function+".

  • Reading a global variable from tomcat with JNDI. Example not working

    Hi you can help me to make this example work?
    Context initCtx = new InitialContext();
    Context envCtx = (Context)initCtx.lookup("java:comp/env");
    Object o = envCtx.lookup("testvariable");
    <GlobalNamingResources>
    <Environment name="testvariable" type="java.lang.Boolean" value="false"/>
    Nice greetings Christian

    I found out that in addition to having the JNDI lookup code, you have to
    - have the environment variable declared in the app server configuration
    - have a resource-env-ref entry in your webapp module
    - have the application container bind your named variable with the global variable
    I am using tomcat 5.5, and have done the following. with success.
    the following example uses the default sample environment variable in the tomcat server.xml
    in tomcat server.xml:
    <GlobalNamingResources>
    <Environment
    name="simpleValue"
    type="java.lang.Integer"
    value="30"/>
    </GlobalNamingResources>
    in my application's web.xml:
    <resource-env-ref>
    <description>Test read resource environment variable</description>
    <resource-env-ref-name>simpleValue</resource-env-ref-name>
    <resource-env-ref-type>java.lang.Integer</resource-env-ref-type>
    </resource-env-ref>
    in my META-INF/context.xml (or otherwise, in tomcat's context deployment configuration)
    <ResourceLink name="simpleValue" global="simpleValue"
    type="java.lang.Integer"/>
    Note: in theory, the named resource by your web app could be different from the global environment variable, but here they are the same 'simpleValue'
    This is the really important step, that with out it, nothing works.,
    the context.xml is known to work with tomcat when it exists in META-INF/context.xml inside the .war file (i use war files to deploy, but you should be able to create META-INF/context in an unpacked webapp directory too, and tomcat will find it.,
    I can not say what it is like for other app servers, but this mapping step is the critical point that i discovered after A LOT of hair pulling.
    then, make use of it, i created a jndiTest.jsp:
    <%@ page import="javax.naming.Context" %>
    <%@ page import="javax.naming.InitialContext" %>
    <%@ page import="javax.naming.NamingException" %>
    <%
    try {
    Context initCtx = new InitialContext();
    Context ctx = (Context) initCtx.lookup("java:/comp/env");
    Object o = ctx.lookup("simpleValue");
    %>
    <%=o%><br>
    <%
    catch (NamingException ex) {
    System.err.println(ex);
    %>
    since my server.xml defines the value for 'simpleValue' to be 30, this page displays 30

  • Changed the variable from used in condition to changed gives error

    Hi,
         How to decide on which fields to be used in charecteristcs and which in used in condition. ?
    I have a code in fox which works for some tets data and fails for ceration other test data. wheni changed one field from used in condition to changed field the code is working. however now when i transport the same to quality it gives the error as   :
    " Variable Material Must Have a Type of a Field to be Changed.
    Kindly Help on this. From where should i changed the type of material ? currently i have just changed the tick of the check box from  " used in condition "  to " changed "
    Thanks And Regards,
    Vijay

    Hi Vijay,
    Please replace the code with the following one.. I think it will work now.. Apparently there is no problem with field to change option. However, please note that you are checking the help option (below fox editor) while providing the sequence for material and Plant. It might happen that system is looking for plant and material option and you are providing as material and plant option.
    Please check the code below:
    DATA CALMONTH TYPE 0FISCPER.
    DATA LO_CURR TYPE 0LOC_CURRCY.
    DATA LO_0CALQUAT TYPE 0CALQUARTER.
    DATA MATERIAL TYPE GPUMATL.
    DATA VENDOR TYPE 0VENDOR.
    DATA LO_VENDOR TYPE 0VENDOR.
    DATA PLANT TYPE GPUPLANT.
    DATA L_SPLIT TYPE F.
    DATA L_VOL TYPE F.
    DATA TOT_VOL TYPE F.
    DATA L_VOLUME TYPE F.
    DATA L_FISCQUAT TYPE GPUFSCQRT.
    BREAK-POINT.
    TOT_VOL = 0.
    *CALCULATE TOTAL VOLUME
    FOREACH MATERIAL, PLANT,VENDOR, LO_CURR,LO_0CALQUAT,L_FISCQUAT .
    L_VOL = {Z9APSHIP,LO_0CALQUAT,LO_CURR,VENDOR,L_FISCQUAT ,MATERIAL,PLANT}.
    TOT_VOL = TOT_VOL + L_VOL .
    *CALCULATE SPLIT % BASED ON TOTAL VOLUME
    L_SPLIT = {GPU_VSPER,LO_0CALQUAT,LO_CURR,VENDOR,L_FISCQUAT ,MATERIAL,PLANT}.
    L_VOLUME = PERP(TOT_VOL,L_SPLIT).
    {Z9APSHIP,LO_0CALQUAT,LO_CURR,VENDOR,L_FISCQUAT ,MATERIAL,PLANT} = L_VOLUME .
    ENDFOR.

  • Change global variable multithreaded

    Hi,
    I've encounterd an issue which I'm trying to end a thread from another thread
    I have one main thread that calls two different threads (Thread1 & Thread2) as so:
    Thread1()
       while (g_ThLoop)
              ...Do stuff...
       ...Cleanning memory etc....
    Thread2()
       g_ThLoop  = 0;
    MainThread()
        g_ThLoop = 1;
       CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, Thread1, 0, &hFid1);
       ....Do Stuff...
       CmtScheduleThreadPoolFunction (DEFAULT_THREAD_POOL_HANDLE, Thread2, 0, &hFid2);
    CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, hFid1, 0);
    CmtWaitForThreadPoolFunctionCompletion (DEFAULT_THREAD_POOL_HANDLE, hFid2, 0);
    CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, hFid1);
    CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, hFid2);
    I've tried to debug in debug and release configuration but the change of g_ThLoop from Thread2 doesn't make Thread1 to exit
    also tried to use CmtLock, Local Variable and Safe Variable but...with no success
    Uriya

    How is your g_ThLoop variable defined?
    In Monitoring and Controlling Secondary Threads help topic the following note can be found:
    Note  If you use the volatile keyword, this code will function properly in an optimizing compiler such as Microsoft Visual C++. An optimizing compiler determines that nothing inside the while loop can change the value of the quit variable. Therefore, as an optimization, the compiler might use only the initial value of the quit variable in the whileloop condition. Use the volatile keyword to notify the compiler that another thread might change the value of the quit variable. As a result, the compiler uses the updated value of the quit variable each time the loop executes.
    Multitthreading is indeed a powerful technique but requires a non trivial knowledge of its inner aspects. I suggest you to carefully read Creating Multithreaded Applications topic in the CVI help: it gives the basics of multithreading and a lot of advanced features you should know to master this technique.
    Proud to use LW/CVI from 3.1 on.
    My contributions to the Developer Zone Community
    If I have helped you, why not giving me a kudos?

  • How can I handle global variables from different DLLs created based on VIs that access those variables

    My goal is to break apart an entirely LabView created application so I can still use parts of it (builded as Shared DLLs upon on some VIs) in my new .Net application. My problem is that some others VIs (that I am not intending using) are changing those global variables (in the natural data flow of the application).  I could , of course, send the values of those global variables as parameters, but I don't know how should I pass those data types (and their size)... There are some clusters there...
    Any help is well appreciated

    vulpe wrote:
    My goal is to break apart an
    entirely LabView created application so I can still use parts of it
    (builded as Shared DLLs upon on some VIs) in my new .Net application.
    My problem is that some others VIs (that I am not intending using) are
    changing those global variables (in the natural data flow of the
    application).  I could , of course, send the values of those
    global variables as parameters, but I don't know how should I pass
    those data types (and their size)... There are some clusters there...
    Any help is well appreciated
    Your
    problem is of course the use of globals. That is almost always a bad
    idea and asking for troubles once your application gets bigger.
    Avoiding race conditions and undesired influences between different
    parts of your application will take up more and more of your
    development time as your project grows.
    You should look into Functional Globals (LV2 style globals) and shift
    registers for data storage and queues for passing information between
    different parts of your applciation. Using these techniques
    consequently, will require you to spend some more time initially but
    will allow you to grow your application without increasing the
    complexity of managing such things exponentially.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • UCCX changing time variables from AM to PM and vice-versa

    Hi all.
    I have an extremely irritating issue that I'm hoping someone can shed some light on.
    I'm currently making improvements to one of our contact centre scripts. We require to activate redirection on the fly quite often, and in the past I used a modified script with different time of day tests.Going forward I wanted to provide the ability for this to be activated and times set through the GUI.
    So I made some variables as parameters, of note these are RedirectOperation (boolean), RedirectFrom (Time) and RedirectUntil(Time).
    The flow is that if RedirectOperation is true, a time test is performed to dictate when we redirect - this is in the form of:
    (T[now] >= RedirectFrom) && (T[now] <= RedirectUntil)
    Now I know I can use T[now].before(xxx) etc but the operation itself isn't the issue, it does work perfectly fine this way, but the times change from AM <<>> PM under certain conditions.
    To explain:
    I set the default (on the script itself) RedirectFrom to "T[6:00:00 PM]" and RedirectUntil to "T[11:59:59 PM]".
    When debugging the script, I can see that the system changes the times from PM to AM (under the variable list on CCX editor during a reactive debug) ! That's if I've not selected these parameters on the GUI. If however, I do select the parameters and still use the default values, when debugging, they stay as PM!!
    This is surely a bug??
    To try something else, I changed my time format to 24 hour clock - so 18:00:00 and 23:59:59 respectively. I can set these on the script itself, and if the parameters are unchecked and left at default, it works fine. However when I select the parameter and try to change the times to (for example) 19:00:00 and 22:59:59, the GUI spits an error saying:"* Please enter a valid date for the Date configurable variable." I can only assume there is a mismatch between what you're allowed to put into the script and what the GUI thinks you're allowed to.
    But certainly the script surely should not be changing between AM and PM when a variable is left to default??
    Any ideas would be greatly appreciated!
    Thanks in advance.
    Scotty

    After choosing your start time you should be able to click to the right to change from AM to PM or vice versa by using the up/down button.  I just did it.
    If your DVR is not cooperating, try rebooting it.

  • Changing Global variables inside function

    Hello all,
    Trying to set a global variable in a function that had already been set before the function. For example:
    $VariablesAreSame = $false
    function CheckIfDifferent ($variable1, $variable2){
    If($variable1 -eq $variable2){
    $VariablesAreSame = $true
    write-host $VariablesAreSame
    for($i=1;$i -le 5;$i++){
    CheckIfDifferent $i 2
    When this is run, $VariablesAreSame is never permanently set within the function, which I would like it to be. Any ideas?

    You need to set $VariablesAreSame as a global variable in the function.
    $VariablesAreSame = $false
    function CheckIfDifferent ($variable1, $variable2){
    If($variable1 -eq $variable2){
    $global:VariablesAreSame = $true
    write-host $VariablesAreSame
    for($i=1;$i -le 5;$i++){
    CheckIfDifferent $i 2

  • How to change SSIS variables from DM Dynamic Script

    All,
    I'm using BPC 5.1 SP8 on top of SQL 2005. I have some SSIS variables defined in my SSIS transformation that I would like to change using Data Manager Dynamic Script.
    How can this be accomplished?
    Thanks
    Paulo

    The most flexible way I know, is to set up your MODIFYSCRIPT parameter similar to the following. The prompts allow the user to key in anything they want (not necessarily base-member IDs) which you can then pass to the variables in the
    PROMPT(RADIOBUTTON,%MODE%,"Select mode of operation:",,{"Door number one","Door number two"},{"DOOR_ONE","DOOR_TWO"})
    PROMPT(TEXT,%Entity%,"Select an entity",,"")
    PROMPT(TEXT,%Color%,"Select a color",,"")
    GLOBAL(DB_NAME,%APPSET%)
    GLOBAL(DB_SERVER,%SQLSERVER%)
    GLOBAL(COLOR,%Color%)
    GLOBAL(USERID,%TRIMMEDUSER%)
    GLOBAL(TRANSTYPE,%MODE%)
    GLOBAL(COMPANYCODE,%Entity%)
    Then in the DTSX package there are variables for DB_NAME, DB_SERVER, COLOR, etc. Note that these names must be ALLCAPS or things don't work. Pass them on to your connection manager (to ease the transport from one environment to another), or wherever else you need them in the package.
    I believe there's also a way to pass through the filtered, validated list of member IDs, but I don't have an example of that.

  • Get names of global variables from report (like Tab "Globals" in debugger)

    Hello,
    is it possible to get a list from all available variables in a report at runtime like the tab "Globals" in the new debugger?
    The problem is that i don't know the names of the variables. So i could not do a dirty assign with field-symbols.
    best regards
    Marcel Gäbe

    Try RS_PROGRAM_INDEX
    table compo returns. filter with type = D
    Will you please check GET_GLOBAL_SYMBOLS & RS_PROGRAM_INDEX _SOURCE

  • How can I pass Global Variable from Page1 to Page2

    I have the following senario.
    Pag1 - report is based on following PL\SQL
    declare
    g1 varchar2(100);
    begin
    g1 = select * from emp where dept = 10;
    return g1;
    end;
    Now I have Page2 - based on following PL\SQL
    declare
    g2 varchar2(100);
    begin
    g2 := g1; -- here i want to use variable g1???
    return g2;
    end;
    My question is - How can I use variable g1 from P1 in my new page P2.
    Thanks,
    Deepak

    Hi Andy,
    Thanks for the clarification.
    I did exactly the same, created a new Region with HTML (PL\SQL) and got the output. it was fine.
    Now when I am using exactly the same code in a Report (PL/SQL function returning a SQL Query), I am getting the following error.
    DECLARE
    g VARCHAR2(100);
    BEGIN
    g := 'This is a test string';
    APEX_UTIL.SET_SESSION_STATE('G_SQL_STRING', g);
    htp.p(v('G_SQL_STRING'));
    END;
    ERR-1002 Unable to find item ID for item "FLOW_SECURITY_GROUP_ID" in application "4000".
    ERR-1002 Unable to find item ID for item "G_SQL_STRING" in application "4000".
    I am doing the same thing, nothing changed....only difference is in 1st case I am using HTML (PL\SQL) Region and in 2nd case using the REPORT Region (PL/SQL function returning a SQL Query)
    thanks,
    deepak

Maybe you are looking for

  • Arabic characters are not getting displayed in oracle pdf output

    Hi, I am trying to print arabic characters in report output but junk characters are getting displayed in output. Using 10g report builder, added the arabic labels in report layout. Followed below steps: 1. Set NLS_LANG=ARABIC_United Arab Emirates.AR8

  • Changing multiple keychain items to the same password

    I work in a corporate environment that uses a Windows server with Active Directory to manage the company network.  Macs are integrated to the network, but Open Directory is not being used. The login for the Macs is the same as the network name and pa

  • Free Goods requirement

    I just need a small favour from your side to Map one specific requirement in Business one.   Clients are having a Business process where they provide 2 quantity free with every 10 quantity of Sales.   which will be proportionate to sales quantity. fo

  • Help needed regarding change of system CLASSPATH

    Hi All, I need to change the system CLASSPATH using my java programe. I tried the following code but its not working though it returns the correct CLASSPATH, but unable to do the modification. All I need is to append a new jar file in the existing CL

  • Vendor missing in Shopping Cart

    Hi all, Now, in SRM Shopping Cart, I have a issue that when screen returns to Shopping Cart from External Vendor Catalog, and when I click on Item Details (click on Magnifier icon in 'Action' column), it brings me to Item Details page, where I can se