[Bash] How to `declare` a global variable inside a function?

#!/bin/bash
# Not using declare -A, array will be treated as indexed array rather than an associative array
seta()
for ((n=0;n<$1;n++)); do
printf -v a_$n[k] %s k$n
printf -v a_$n[j] %s j$n
eval echo inside seta: a_$n[k] = \$\{a_$n\[k\]\}
done
seta 3
echo outside: a_0[k] = ${a_0[k]}
echo outside: a_0[j] = ${a_0[j]}
echo
# Use declare -A inside function, array will be undefined outside
setb()
for ((n=0;n<$1;n++)); do
declare -A b_$n # Note here
printf -v b_$n[k] %s k$n
printf -v b_$n[j] %s j$n
eval echo inside setb: b_$n[k] = \$\{b_$n\[k\]\}
done
setb 3
echo outside: b_0[k] = ${b_0[k]}
echo outside: b_0[j] = ${b_0[j]}
echo
# The bad solution, only works if we know beforehand how many c_? arrays will be assigned inside setc()
for ((n=0;n<3;n++)); do
declare -A c_$n
done
setc()
for ((n=0;n<$1;n++)); do
printf -v c_$n[k] %s k$n
printf -v c_$n[j] %s j$n
eval echo inside setc: c_$n[k] = \$\{c_$n\[k\]\}
done
setc 3
echo outside: c_0[k] = ${c_0[k]}
echo outside: c_0[j] = ${c_0[j]}
My original code does the declare -A as in setb(). I was surprised when I saw all blank output... Now the problem is illustrated clearly by the setb() example.
The setc() example works, but a bit ugly: look at the two 3's...
My ideal solution would be, something like `declare_global -A b_$n` in setb()
Any ideas?

with current bash versions, i don't think it is possible to declare global associative arrays in functions.
what you are after is the "-g" option of typeset which is available in zsh.
i think i read somewhere that something similar may be planned for bash 4.2.

Similar Messages

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

  • How can I access global variables in a loaded Applescript?

    How can I access global variables in a loaded script, in Xcode, ApplescriptObjC? Basically, I have a global variable defined in my parent script using "property", and I need to modify objects connected to those variables inside of a loaded script.
    Example:
    Parent script:
    script AppDelegate
    property myTextField : missing value
    //linked to a text field object
    tell myScript to myAwesomeHandler_()
    end script
    Loaded script:
    on myAwesomeHandler_()
    myTextField's setStringValue_("The new Xcode is so glitchy ugh")
    //changes value of linked text field of parent script
    end myAwesomeHandler_
    The problem is, the variable is undefined in the Loaded script, and I need it to have the same value as the parent script, and I don't want to pass the variable through the Handler. Any ideas?

    I think want you are looking to do will need to be done in two steps. Because myTextField needs to be a property for the ObjectiveC part of the code you cannot turn it into a global.
    However if you make a temporary variable global assign the string to it in the handler then set myTextField off of it.
    global myTextFieldGlobal
    script AppDelegate 
    property myTextField : missing value 
    //linked to a text field object 
    tell myScript to myAwesomeHandler_() 
    myTextField's setStringValue_(myTextFieldGlobal)
    end script 
    on myAwesomeHandler_() 
    set myTextFieldGlobal to "The new Xcode is so glitchy ugh"
    //changes value of linked text field of parent script 
    end myAwesomeHandler_ 
    I know you stated you did not want the handler to return a value but I have to ask why? Global's, imo, are not a good idea and really should be used as a last resort.
    One other possibility is to pass a reference to the property to the handler. Not sure if that works in AS of if that would satisfy our requirement of not passing the variable through the handler
    <edit>
    Another though have you tried to define the property outside the script?  That is
    property myTextField : missing value
    script AppDelegate
    Not sure if that will work.
    You might also want to have a look at Scope of Properties and Variables Declared in a Script Object

  • How to use a global variable for reading a query resultset in JDBC lookup?

    Hi Friends,
    Using JDBC lookup, I am trying to read from a table Emp1 using a user defined function. In PI 7.0, this function returns values of a single column only even if you fire a " Select * " query. I am planning to use a global variable(array) that stores individual column values of the records returned by a "select *" query. Need pointers on as to how a global variable can be declared and used to acheive the above scenario. Kindly explain with an example. Any help would be appreciated.
    Thanks,
    Amit.

    Hi Amit,
    Sounds like a good idea but then you would need an external db and update the table in a thread safe way !.
    Regarding your question as to how to work with global variable please refer https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/1352. [original link is broken] [original link is broken] [original link is broken]
    Rgds
    joel

  • How to create a global variable in forms 6i

    How to create a global variable in forms 6i

    :GLOBAL.my_var := 15; Well, this statement is not correct! Global variables
    stores a character string of up to 255 characters in
    length. Thus, valid statement for Khurram example
    is:
    :GLOBAL.my_var := TO_CHAR(15);
    or
    :GLOBAL.my_var := '15';
    But numeric values are implicitly converted by oracle so there's nothing in fact wrong with the statement...
    :GLOBAL.my_var := 15;
    ;)

  • How can I define global variable in user exit whic I can use anywhere.

    Hi all,
    How can I define global variable( Table ) which I can use when it come back to same user exit where I defined and stored some data.
    What I mean is I want to define 1 global table.
    In user exit when it comes I store some information. and again when it will come I will have that stored information so I can use it.
    Thanks a lot in advance.

    You can use EXPORT  TO MEMORY ID and IMPORT FROM MEMORY ID Statement for this.
    EXPORT T_ITAB FROM T_ITAB TO MEMORY ID 'ABC'.
    IMPORT T_ITAB TO T_ITAB FROM MEMORY ID 'ABC.'

  • How to declare a bind variable with 'date' data type in command prompt?

    how to declare a bind variable with 'date' data type in command prompt?
    sql>variable q date;
    when i execute it show list of datatypes

    Hi,
    As Lokanath said, there are no DATE bind variables.
    You can use a VARCHAR2 bind variable, and convert it to a DATE in your SQL statment.
    If you're using SQL*Plus, consider a substitution variable. It won't be as efficient as a bind variable, but it will be as convenient.
    For example:
    DEFINE  first_entrry_date = "DATE '2010-06-20''
    SELECT   ...
    WHERE   entry_date >= &first_entry_date
    {code}                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • 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 can I transfer a variable to regexp_replace function

    Hi,
    In addition to my question from yesterday, I went up one (little) level for the next question.
    How can I transfer a variable to regexp_replace function?
    I am getting the value of the variables from from APEX Items.
    The value of item :P105_OLD_NAME should be replaced with the value from :P105_NAME APEX item.
    The projects in PROJECT_NAME field are separated by “:”
    select * from infoux_proj;
    HOSTNAME PROJECT_NAME
    host1 proj2:proj1
    host3 proj1
    host4 proj12:proj1
    host5 proj3
    host2 proj1:proj3:sunproj1
    this is my code:
    declare
    v_old_proj_list varchar(100);
    v_new_proj_list varchar(100);
    begin
    for host in (select a.hostname, project_name
    from infoux_proj a,
    (select hostname
    from PROJECT_NAMES_WITH_HOSTNAMES
    where name = :P105_OLD_NAME ) b
    where a.HOSTNAME=b.hostname)
    loop
    select project_name ,
    regexp_replace(project_name,'(^|:)(:P105_OLD_NAME)(:|$)','\1:P105_NAME \3') new_project
    into v_old_proj_list, v_new_proj_list
    from infoux_proj
    where hostname=host.hostname;
    update infoux_proj
    set project_name=v_new_proj_list
    where hostname=host.hostname;
    end loop;
    end;
    Thanks,
    Sheli

    Hi, Sheli
    Inside quotes, :p105_old_name will not be taken as a variable name. If you want to use the value of :p105_old_name in a string which its otherwise a literal, then you can concatenate the variable to the literal parts, using the || operator.
    You can do soemthing like this:
    REGEXP_REPLACE ( project_name
                , '(^|:)(' || :P105_OLD_NAME
                             || ')(:|$)'
                , '\1'       || :P105_NAME
                             || ' \3'
                )               AS new_projectI'll bet there's a much simpler way to do what you want. Instead of having two SELECTs, a cursor FOR loop and an UPDATE, you can probably do what you need to with just a single UPDATE or MERGE. It would be more efficient, too. If you'd like help, post CREATE TABLE and INSERT statements for all relevant tables and columns azs the exist before this code is run, a couple of sets of values for the bind variables, and the results you'd like to see (that is, the contents of the changed table) for each set, given the same sample data.
    Always say which version of Oracle you're using.

  • How to declare a global/public variable in Oracle Forms

    Hi All,
    I have to get the value of a variable which is declared in the event 'When_Button_Pressed', in an another trigger with in the form.
    My variable & type
    l_db_handle EXEC_SQL.ConnType;
    This variable used to get the handle of a new database connection.
    (Here I am trying to make connection to two different databases from Form. That is working fine.)
    I have tried with Global variable to transfer this variable value to other triggers. But it is not working. It shows 'Wrong type error'
    Could you please let me know, how can I declare which DB handle variable as public in form(I mean i have to use this variable all the triggers with in the form)
    Thanking You,
    Manu

    Put the code in a package within the form, have the triggers call functions/procedures within the package. All variables which need to be referenced in more than one procedure can be created as package variables.

  • How to Set multiple Global Variables without using Controls or Indicators

    I have to set many Global Variables (i.e. declare and initialize them) in a subVI in order to pass them to various other subVI's. The only way I know how to do it in LabView is to create a Globals.vi on which you create a control or indicator for EACH Global Variable. That's fine if you have only a few variables. But I have close to a hundred Global Variables (which come from a configuration file for a large program) and clearly it is impractical and cumbersome to create a control for each global variable. In Agilent Vee, there is a simple function called "Set Variable" that sets the data value of a global variable. Then in other module, you simply use the "Get Variable" function to get back the v
    ariable and its value.
    In LabView you can use the "Invoke Node / Set Control Value" and "Get Control Value" properties to achieve the same thing. But as mentioned above, you need to create a control for each global variable and that is a big pain in my case, with many global variables. Furthermore, the global variables are read from a Configuration Text File to this VI. Is there a way to do it without using the control? Thank you in advance for any help.

    Actually you could create the same sort of facility in LV. All you have to do is create a LV2-style global that behaves as follows:
    To write a value to it, you supply a value name and the value. These pieces of data are save internally in seperate arrays.
    To read a value, you supply a value name. The VI looks up this name in the value name array to return an index into the value array. Output the value you find.
    Frankly though, it sounds like what you really need is not hundreds of globals, but a good way to manage configuration data.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • How do I set global variables for use by ALL form1.#subform[0] items?

    Hi All,
    I know how to code javascript but am new to Adobe LiveCycle.  When I open script editor, I have the following code (all code is in un-bolded):
    ----- form1.#subform[0]::initialize: - (FormCalc, client) ------------------------------------------
    // BEGIN: 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]::exit: - (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 form values in user-friendly names.
    var AreaSelected = Item1Area.rawValue;
    var NumberOfUsersSelected = Item1Users.rawValue;
    //Declare other vars.
    var Users1Calculation;
    var Users2to5Calculation;
    var Users6to20Calculation;
    //Calculate individual User Cost "components" based on number of users selected for the area.
    switch(true)
    case (NumberOfUsersSelected < 2):
      Users1Calculation = NumberOfUsersSelected * Cityscope_Sydney_CostUser1;
      Users2to5Calculation = 0.00;
      Users6to20Calculation = 0.00;
      break;
    case (NumberOfUsersSelected > 1 && NumberOfUsersSelected < 6):
      Users1Calculation = Cityscope_Sydney_CostUser1;
      Users2to5Calculation = (NumberOfUsersSelected - 1) * Cityscope_Sydney_CostUsers2to5;
      Users6to20Calculation = 0.00;
      break;
    case (NumberOfUsersSelected > 5):
      Users1Calculation = Cityscope_Sydney_CostUser1;
      Users2to5Calculation = 4 * Cityscope_Sydney_CostUsers2to5;
      Users6to20Calculation = (NumberOfUsersSelected - 5) * Cityscope_Sydney_CostUsers6to20;
      break;
    default:
      alert("BROKEN: Calculate individual User Cost components based on number of users selected for the area.");
    //apply total cost for this item
    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 within:
    ----- form1.#subform[0].Item1Cost::calculate: - (JavaScript, client) -------------------------------
    ...to be able to access the variables I have created in:
    ----- form1.#subform[0]::initialize: - (FormCalc, client) ------------------------------------------
    (I have assumed that this is where I would store Global variables)
    At this stage, the global variables cannot be accessed with the configuration above.  The only was I can get this to work is to cut and paste the global vairables into each form1.#subform[0] item, which of course defeats the purpose of global variables!  I plan to have many more items so would not want to duplicate the global variables for all of them!
    Can somebody show me how to do this?
    Any help is very much appreciated!
    Thanks
    Stanbridge
    Message was edited by: stanbridgej - colors and or fonts won't save.  Have bolded my question to make code (non-bolded) easier to read (I hope).

    Hi MorisTM,
    Thanks for the reply!
    Yes, I saw that option (I should have mentioned I already knew about it), but was wondering if there is a way I can do this via code.
    There are two reason I want to be able to do it via code (only one of which may be valid):
    1) I can automatically generate my pricing code form another inhouse app.
    2) I am hoping that later on once I get this working I will be able take it a step further and get the data directly from a MySQL database!
    Cheers though!
    Any other suggestions?
    Regards,
    Stanbridge

  • How do you override global variable values when calling oraxsl or xsl.exe?

    I am a newbie to oracle xslt.
    I have down loaded the latest version of xdk (10.1.0.2...). (Jan 2, 2009).
    In the past I haveI used micorsoft's "msxsl.exe" to perform my transformations.
    I am looking for a more up-to-date transformation tool.
    I found Oracle's version, and thought I would try it out.
    I have run the "bin/xsl.exe -hh" command.
    I read its help data. It states that variables are
    passed by coding a pramater "-V <var> <value>".
    I have also examined the oraxls.bat file.
    I found the documentation on "oracle.xml.parser.v2.oraxsl" class.
    It states that parameters are passed after the "-p" switch.
    It says the value of the -p parameter is "a list of paramemters".
    I don't find this sufficient information to be useful.
    I can spend days guessing, and I might get lucky.
    I thought it my be better to ask for help.
    I need to pass in (override) values for 3 global variables.
    I saw the method
    "setParam(namespace, variable, value)",
    near the documentation for the "oraxsl" class.
    How do you format the options string to communicate more than one param statement?
    (in either xsl.exe and/or oraxsl class).
    Suppose I have an xslt stylesheet as follows:
    ==================================================
    <?xml version="1.0" ?>
    <xsl:stylesheet version="1.1" xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
    <xsl:param name='a' select='"default_a"' />
    <xsl:param name='b' select='"default_b"' />
    <xsl:param name='c' select="'default_c"' />
    <xsl:template match='/'>
    this is value for a: <xsl:value-of select='$a' />
    this is value for b: <xsl:value-of select='$b' />
    this is value for c: <xsl:value-of select=$c' />
    <xsl:apply-templates />
    </xsl:template>
    </xsl:stylesheet>
    ========================================================
    Now as part of the calling of the XSL processor I want to change the value of these
    three global parameters.
    I want:
    a="current_a",
    b="current_b",
    and c="current_c"
    How do I express this using xsl.exe and its paramter string (-V ????).
    and/or how do I express it to the oraxsl class ( -p (xsl, a,"current_a"), (....) )???
    The syntax for specifying this information is not very clear in either situation.
    Of course I am making the "assumption" that by "param" they are
    refering to "global parameters" (as in my stylesheet), rather than some other global parameters of XLST.
    As an aside inquiry:
    I had hopped that the Oracle's xsl Verion 2 routine could handle xslt 2.0 commands
    such as "xsl:for-each-group", since it handled multiple xsl:outputs.
    From reading some of the documentation it seems it only handles xslt 1.0 syntax/commands.
    Is this true? (or is the documentation not up-to-date?).
    Any help on passing param values to xsl.exe and/or "oraxsl" class is appreciated.
    Thanks.

    Here is the line from one of my testing .bat files that passed in one parameter. I can't recall if I've passed in two, but this will give you a starting point for passing in multiple
    java -cp %CPath% oracle.xml.parser.v2.oraxsl -p show_image='yes' %ValXML% %ValXSLT% As for XSLT 2.0 support, it appears it does per {thread:id=503445}

  • How to creat a global variable?

    I want to creat a start button of global variable to control different programs in the sequence structure. But I do not know how to creat it. Thanks for answering.
    Solved!
    Go to Solution.

    Perry Liu wrote:
    Thanks for answering. I attached the code below.
    What I want to do is to combine Get Voc/Isc and GO buttons (shown in the front panal) to one button, and also combine Setup Linear Stair Sweep and start sweep together. I do now find a good way to do that. Thanks so much for your kind help.
    There is no "Get Voc/Isc" or "GO" button anywhere on the front panel, and I have no idea what you mean by "Setup Linear Stair Sweep" and "start sweep". Are you sure you uploaded the correct code?
    Other VI comments:
    You are abusing/misusing global variables. 
    You already have a state machine, so you can actually code this using just the state machine without actually needing the separate event structure loop. Even if you do keep it, that still does not require you to use global variables.
    Why do you have a loop around the Write to Spreadsheet File? This serves no purpose and actually stops your code in that loop until the Stop global is set. This doesn't make much sense.
    Since you do not have a path wired to the Write to Spreadheet File VI, you will be asked for a path each time the loop iterates. Use a shift register to hold the value of the path from iteration to iteration.
    Get rid of the Build XY Graph Express VI and those Convert to Dynamic Data functions. Replace with a single Bundle function.

  • How to build labview global variable into dll?And how to use it in vc++ program?

    Hi!
       I want to build labview application into dll and use vc++ to call it.The labview program is a little complex,for it has many interface to vc++ and has while loop in it.When I use vc++ to call it,I must use vc++ to do other things.That is to say,vc++ creates a new thread to provide for the labview dll to run.the vc main thread goes on to other things.But the vc++ main thread must communicate with the labview dll by setting its inputs' parameters and get the results of running labview dll.Can you advise me how to realize it?
       I think global variable of labview could be useful when realizing the communication betweeb vc thread and labview dll.So I want to ask whether the labview global variable could also be built into dll and use it.Could you please tell me how to realize my idea?
       Thank you!

    [email protected] wrote:
    Hi!
    I want to build labview application into dll and use vc++ to call
    it.The labview program is a little complex,for it has many interface to
    vc++ and has while loop in it.When I use vc++ to call it,I must use
    vc++ to do other things.That is to say,vc++ creates a new thread to
    provide for the labview dll to run.the vc main thread goes on to other
    things.But the vc++ main thread must communicate with the labview dll
    by setting its inputs' parameters and get the results of running
    labview dll.Can you advise me how to realize it?
       I
    think global variable of labview could be useful when realizing the
    communication betweeb vc thread and labview dll.So I want to ask
    whether the labview global variable could also be built into dll and
    use it.Could you please tell me how to realize my idea?
       Thank you!
    You
    can't access LabVIEW globals directly from a caller to the LabVIEW DLL.
    However there is no problem in providing specific accessor VI functions
    to that global and export them as additional functions from the DLL.
    Rolf Kalbermatter
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

Maybe you are looking for

  • Screen Resolution in Mavericks

    I have a 27 inch imac , when i installed Mavericks the icons and text have become absurdly small , and very difficult for anyone to read. When changing resolution the screen looks terrible and icons etc are fuzzy. I have played withn all finder and a

  • Computer crashed after Lightroom 4 Installation

    I purchased the Lightroom 4 upgrade online from Adobe a couple of days ago and installed it on my laptop.  The software seemed to be working at first, but a few hours later, my computer crashed.  Upon reboot, my computer would crash again shortly the

  • E71 Doesnt Boot Up Properly

    Hi Everyone, My brand new E71 doesn't boot up anymore. I'm guess it is because of "PowerBoot" applications or whatever apps it is loading. After I've installed a couple of applications today it was all fine, until I did a reboot. Now when I boot it u

  • E-mail through SAP

    Hi, I have used FM SO_NEW_DOCUMENT_ATT_SEND_API1 to mail document.  However, this gets stuck in the Outbox. Doesnt reach the destination. Executing the TX - 'SCOT' also doesnt help. Please help. Regards, Ravi

  • Javascript Set Value

    Hallo, i have a Script: if ($('table.apexir_WORKSHEET_DATA tr').size() ==2 ) $s('P1_VARIANTE_', $v('P1_VARIANTE')) when the IR Report Shows one result, the value of "P1_variante_" is become the value from "P1_variante" Without Submit the Page the Val