Global or Passed vars?

I have a situation where I am going to process a series of "Packages" which contain an arbitrary series of "Tasks" and I need to then write that info to the registry in a "Package" Key and "Task" Values. The actual
Package and Task processing happens with For Each loops.
I can see two ways of doing this.
1: A global variable $CurrentPackage, and the end of Process-Task writes to .../$CurrentPackage/$Task
2: No global variable, $Package is passed as a string to Process-Task along with $Task.
I have some other similar situations, so I am curious if there are any general best practices on use of Global vars vs passing more info to Functions. Also, when using global variables, is it best practice to name them so that scope is obvious? In VBScript
I used G_strName or the like to make scope obvious. But PowerShell seems to dispense with most nomenclature beyond overall use of the variable. 
Thanks!
Gordon

The simplest way to handle that is to have your logging module export a variable in addition to its functions. When you do that, the variable exists in the Global scope where callers can modify it, but when they do change it, they're actually setting it
in the module's Script scope (so all of its functions can read it without any issues.)
I use a different approach for logging in my own scripts. I've got this module posted on the Gallery:
http://gallery.technet.microsoft.com/Enhanced-Script-Logging-27615f85 , which automatically intercepts any text that was going to be displayed at the console (regardless of
how it got there; no need to funnel things through a specific command like Write-Log.  Also covers Verbose, Error, Warning and Debug output.)  To turn logging on, I just add this command to the beginning of a script:
$logFile = Add-LogFile -Path '<Path to my log file>'
After that, the script doesn't even have to be aware that it's producing a log file.  The code is just the same as if you were displaying everything at the console.
Regarding the $LogFile "preference" variable topic, when your module exports a variable it automatically becomes accessible to both the caller and the module, but the built-in Preference variables ($ErrorActionPreference, etc) do not.  That's a little
quirk of how Script Modules work; they have their own SessionStates and their own variable scope stack.  I recently figured out how to work around this, and have posted the Get-CallerPreference function on the gallery as well: 
http://gallery.technet.microsoft.com/Inherit-Preference-82343b9d
Now, I just add this command as the first statement in any exported script module function:
Get-CallerPreference -Cmdlet $PSCmdlet -SessionState $ExecutionContext.SessionState
It checks whether any of the default preference variables are set in the caller's scope, and if they are, it sets them locally.  At that point, you're good to go; any helper functions in the module will automatically inherit those variables from your exported
function's scope.  This only works for Advanced Functions with the CmdletBinding() attribute (or at least one Parameter() attribute) set, but basically all functions should be using that these days anyway.

Similar Messages

  • How to pass var P decimasl 4 to var P decimals 2 without round ?

    Hi all,
    How to pass var P decimasl 4 to var P decimals 2 without round ?
    Example;
    DATA: num  TYPE p DECIMALS 2,
              num2 TYPE p DECIMALS 4.
          num2 = '23.3367'.
          num = num2.
    'num' would be 23.34, but I do not want round it, I want that it be 2,33.
    is it possible ?
    Thanks.

    Hi,
    You cannot avoid the rounding here.
    If you want to do so increase the decimal place of num to 4.
    Cheers,
    Hakim

  • Declare objects globally or pass as parameter in Package

    Hi All,
    Need a technical suggestion, in a package i am having several functions,
    say Fn_A calling Fn_B and Fn_B calling Fn_C and Fn_C calling Fn_D
    and i need a collection of Nested Table Objects to be processed at Fn_D,
    and it has to reach from Fn_A, in-between say Fn_C if required, can also process
    the Nested Table Object.
    Also for each Function need to pass 3 parameters of collection object and 3 to 4 Number/Varchar2.
    My question is, would it be better to declare the Nested Table Object globally inside the package,
    or Pass it as an IN OUT NO COPY parameter throughout all functions ?
    And the scenario is :
    Nested Table would have 1000 objects in the collection,
    and each object will have size = 75 Bytes
    and in one day on an average 3 million calls made.
    regards,
    Ludy

    My bias would be not to use a package global if you can reasonably pass the collection as a parameter. It's easier to maintain code that is self-contained rather than trying to debug code whose behavior depends on the state of the session. If you pass in the collection as a parameter, you can write unit tests for all 4 procedures relatively easily rather than having to go through all 4 to test procedure D. Plus, if you don't need to maintain session state, you can update your package code without causing any application tier connections that remained open to error out.
    Performance wise, I wouldn't expect it to matter, though it would be worth benchmarking.
    Justin

  • What is the difference between using a global variable,passing a valuee and using a reference?

    I have created a project that consists of several VIs.  Only the main VI has a front panel and the others perform functions.  The function VIs are dependent on controls on the main VI's front panel.  I have several ways of passing the value of the controls.  One is to use a global variable and just place it on the dependent VIs.  Another option is to strictly connect the terminal from the control to a VI connector block and pass the value directly.  My last option is to create a reference of the control and reference it inside the dependent VIs, but this would also require connections to be made to the VI block.
    What are the advantages/disadvantages of these options?
    -Stephen

    5thGen wrote:
    I have created a project that consists of several VIs.  Only the main VI has a front panel and the others perform functions.  The function VIs are dependent on controls on the main VI's front panel.  I have several ways of passing the value of the controls. 
    1) One is to use a global variable and just place it on the dependent VIs.
    2) Another option is to strictly connect the terminal from the control to a VI connector block and pass the value directly. 
    3) My last option is to create a reference of the control and reference it inside the dependent VIs, but this would also require connections to be made to the VI block.
    What are the advantages/disadvantages of these options?
    -Stephen
    1) Globals are evil and introduce race conditions.
    2) The sub-VI only get the value when it was called and updates that occur while the sub-VI is runing are not sensed by the sub-VI
    3) This uses property node "value" or "value signaling" both of which run the user interface thread which is single-threaded and you incur a thread swap hit to performance. You also have a potential for race conditions.
    The are various methods for sharing dat to/from sub-VI which include Queues and Action Engines.
    I hope that hleps,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Passing vars to a component in as3

    This doesnt seem particulary easy... or poetic for once of a better word.
    I was hoping I could write something like....
    BookingCreator = new CreateBooking(myvar);
    But what do I put In the mxml constructor for that component?
    Its a panel so where does myvar go?
    If I could hand it myvar like that I would then use creationComplete.
    But because I dont no how to pass a var direct to the constructor Im doing it this way instead...
    BookingCreator = new CreateBooking();
    BookingCreator.addEventListener(FlexEvent.CREATION_COMPLETE,onCreated);
    mod.root.addElement(BookingCreator);
    private function onCreated(e:FlexEvent):void{
    BookingCreator.model = mod;
    BookingCreator.init();
    Is that the only way to do it?

    You can't use parameters in the constructor.
    I don't have an issue with what you are doing but I do have an issue with the way that you are naming object instances as though they are classes.
    BookingCreator is an instance, not a class - it should be named 'bookingCreator'.
    NEVER name variables with a capital letter at the start.
    If you type 'MXML constructor' into Google you will get plenty of hits about this subject.

  • Passing VARs between MXML Application and MXML components!

    Hi,
    I'm trying to pass a variable between the MXML Application and the MXML Component with ValueObjects.
    But when i call the variable on the MXML Component it is null!
    ValueObject Class Code:
    package valueObjects
        [Bindable]   
        public class MyGlobalVars
            public var NomeGaleria: String;
            public function MyGlobalVars()
    MXML Application Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"  xmlns:comp="components.*" layout="vertical" height="100%" width="100%" >
    <mx:Script>
        <![CDATA[
            import valueObjects.MyGlobalVars;
            import mx.managers.PopUpManager;
            import mx.core.Container;
            [Bindable]
            public var nomeGaleria:MyGlobalVars;
            private function AbreGaleria():void{
                  nomeGaleria=new MyGlobalVars();
                nomeGaleria.NomeGaleria = "Moda";
                PopUpManager.addPopUp(new galeriaImagens(),this,true);
        ]]>
    </mx:Script>
    <mx:Panel height="673" width="839" verticalAlign="middle" borderStyle="none" layout="absolute">
        <mx:Canvas id="SMGaleria" width="815" height="30" x="2" y="98"">
            <mx:LinkButton x="474" y="5" label="moda" click="AbreGaleria()"/>   
         </mx:Canvas>
        <mx:ViewStack id="content" height="440" width="815" borderStyle="none" x="2" y="128">
            <comp:galeriaImagens id="GaleriaImagens" x="0" y="5" strGaleria="{nomeGaleria}"/>
        </mx:ViewStack>
    </mx:Panel>
    </mx:Application>
    MXML Component Code:
    <?xml version="1.0" encoding="utf-8"?>
    <mx:TitleWindow  xmlns:mx="http://www.adobe.com/2006/mxml"
        showCloseButton="true" creationComplete="CenterMe()" backgroundColor="#000000" xmlns:components="components.*" >
    <mx:Script>
        <![CDATA[
            import valueObjects.MyGlobalVars;
            import mx.controls.Alert;
            [Bindable]
            public var strGaleria:String;
            private function CenterMe(): void{
                 Alert.show(strGaleria);
        ]]>
    </mx:Script>
    </mx:TitleWindow>
    On the MXML component the value of strGaleria is null! It would not have to be: Moda??

    You may need to change your code as follows:
    <comp:galeriaImagens id="GaleriaImagens" x="0" y="5" strGaleria="{nomeGaleria.NomeGaleria}"/>
    Previously you had set strGaleria to the value of the object, not the string within the object.
    But I think you will still have a problem because function AbreGaleria will not be called until the user clicks the link button, and only then will NomeGaleria have a value, so I would set a default value as follows, otherwise at app launch it will be null:
    public var NomeGaleria: String = "";
    or  if that does not work
    public var NomeGaleria: String = " ";
    Another possible problem is that you are calling this code at the component creationComplete, but the LinkButton has not been clicked yet, so the value object string value has not been set, so the alert will not display anything:
    private function CenterMe():void{
        Alert.show(strGaleria);
    I think you need to reorganize some things here.
    If this post answers your question or helps, please mark it as such.

  • Passing vars...JSP resolves faster than javascript - is there a workaround?

    HI
    The variable/value ("fieldA") that I want to pass from "frame1.jsp" to "frame2.jsp is actually a variable defined javascript function "getTest()" in "frame1.jsp".
    I want to pass "fieldA" from "frame1.jsp" to "frame2.jsp"..
    "frame2" is initially "blank.html. In the "getTest()" function I use (parent.frames[2].location = "frame2.jsp";) to create frame2.jsp inside of "frame2"
    I generat a "post" request (from "frame1.jsp") assigning "fieldA" to a hidden form field ("fldA") in "frame2", and then display the value of "fldA" using "<%= request.getParameter("fldA") %>"...
    But the value of hidden form field - "fldA" - is initially "null" because when "frame2.jsp" page is creatd, the JSP scriplets resolve before the javascript "getData" function can resolve. (if I click to post frame2.jsp again, the value shows - but, that's just because the frame2.jsp now exists.)
    Is there a work around?.... Or, do I need to have "frame1.jsp" call a servlet to pass "fieldA" ????
    Appreciate ANY help on this!!!!
    (NOTE -- actually, my real world need will be to assign the value to a Custom Tag parameter, rather than simply display - and that is why I need to get this to work!)
    THE WORKING CODE IS BELOW. . . (AGAIN ANY HELP IS APPRECIATED!)
    *****frame0.html*****
    <%@ page language="java" import="java.io.*, java.util.*" errorPage="error.jsp" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE>frame0</TITLE>
    </HEAD>
    <FRAMESET FRAMEBORDER="2" ROWS="20%,80%">
    <FRAME SRC="frame0.html" NAME="frame0">
    <FRAMESET FRAMEBORDER="2" COLS="20%,80%">
    <FRAME SRC=frame1.jsp?fieldX=<%= session.getParameter("fieldX") %> NAME="frame1">
    <FRAME SRC=frame2.jsp?fieldX=<%= session.getParameter("fieldX") %> NAME="frame2">
    </FRAMESET>
    </FRAMESET>
    </HTML>
    *****frame1.jsp*****
    <%@ page language="java" import="java.io.*, java.util.*" errorPage="error.jsp" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
         <head><title>frame1</title>
         <link rel="stylesheet" type="text/css" href="./standard.css">
              <script LANGUAGE="JavaScript">
                   parent.frames[2].location = "blank.html";
                   function getTest()
                        var fieldA = "HO THERE!!!"
                        <%
                             session.putValue("fieldB", "HEY THERE!!!");
                        %>
                        parent.frames[2].location = "frame2.jsp";
                        parent.frames[2].getData(fieldA);
                        return;
    </script>
         </head>
         <body bgcolor="#FFFFFF" text="#000000">
              <p>
              <h2>
              In frame1.jsp, the value in fieldA is: <%= session.getAttribute("fieldA") %>
              <h2>
              In frame1.jsp, the value in fieldB is: <%= session.getAttribute("fieldB") %>
              <p>
              <form name="reportRange">
                   <center>
                        <fieldset style="padding: 0.5em" name="customer_box">
                        <table cellpadding="0" cellspacing="0" border="0">
                             <tr class="drophead">
                                  <td valign="top" height="0" ><span class="drophead">
                                       test submit
                                  </td>
                             </tr>
                        </table>
                        </fieldset>
                   </center>
              </form>
         </body>
    </html>
    *****frame2.html*****
    <%@ page language="java" import="java.io.*, java.util.*" errorPage="error.jsp" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
         <head>
         <title>frame2</title>
              <script LANGUAGE="JavaScript">
                   function getData(fieldA)
                   document.pageData.fldA.value = fieldA;
                        document.pageData.submit();
              </script>
         </head>
         <body>
              <p>
              <h2>
              In frame2.jsp, the value of fieldA: <%= request.getParameter("fldA") %>
         <h2>
              In frame2.jsp, the value of fieldB: <%= session.getValue("fieldB") %>
              <p>
              <div id="HiddenForm">
                   <form name="pageData" method="post" action="frame2.jsp" target="_self">
                        <input type="hidden" name="fldA" value="empty">
                   </form>
              </div>
         </body>
    </html>
    *****blank.html*****
    <html>
    <head>
    <title>blank page</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="globalview.css" type="text/css">
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    </body>
    </html>
    *****error.jsp*****
    <%-- error.jsp --%>
    <%@ page language="java" isErrorPage="true"%>
    <html>
    <head>
         <title>error page</title>
    </head>
    <body>
    <h2>Error Encountered: </h2>
    <%= exception.toString() %><BR>
    <br>
    details...<%= exception.getMessage() %>
    </body>
    </html>

    So where to start...
    1) session does not have a method "getParameter()" (frame0.jsp) so I don't know how you can get this to work.
    2) When you call "javascript:getTest()" the scriptlet is not run again. It's serverside so it is execute on the server then any return data is placed where you have the scriptlet.
    3) The scriptlets in "frame0.html" will not work as the page is declared as html.
    4) Once again jsp scriptlets (including TagLibraries) are server side components. Any values passed to them should be via a request or session setting on the server side.
    For example:
    Say we have a tag "myWorkingTag" that outputs the value we assign to "valToUse" on the page.
    original jsp document (page.jsp):
    <%@ taglib uri="mytags" prefix="mine" %>
    <html>
    <body>
    <mine:myWorkingTag valToUse="xyz"/>
    </body>
    </html>
    The web browser view of page.jsp:
    <html>
    <body>
    xyz
    </body>
    </html>
    You can assign the "valToUse" attribute using <%="xyz"%> (or session.getAttribute() or request.getParameter()) on the server side but ultimately you need to send the value to the server and recompile the page.
    I've made some changes to your code (in bold) which is a minor fix but not a solution to your overall objective.
    ***** frame0.jsp *****
    <HTML>
    <HEAD>
    <TITLE>frame0</TITLE>
    </HEAD>
    <FRAMESET ROWS="20%,80%">
    <FRAME SRC="frame0.jsp" NAME="frame0">
    <FRAMESET COLS="20%,80%">
    <FRAME SRC=tFrame1.jsp?fieldX=<%= request.getParameter("fieldX") %> NAME="frame1">
    <FRAME SRC=tFrame2.jsp?fieldX=<%= request.getParameter("fieldX") %> NAME="frame2">
    </FRAMESET>
    </FRAMESET>
    </HTML>
    ***** frame1.jsp *****
    <%@ page language="java" import="java.io.*, java.util.*" errorPage="error.jsp" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head><title>frame1</title>
    <link rel="stylesheet" type="text/css" href="./standard.css">
    <script LANGUAGE="JavaScript">
    //parent.frames[2].location = "blank.html";
    function getTest()
    var fieldA = "HO THERE!!!"
    <%session.setAttribute("fieldB", "HEY THERE!!!");%>
    parent.frames[2].location = "frame2.jsp";
    parent.frames[2].getData(fieldA);
    return;
    </script>
    </head>
    <body bgcolor="#FFFFFF" text="#000000">
    <p>
    <h2>
    In frame1.jsp, the value in fieldA is: <%= session.getAttribute("fieldA") %>
    <h2>
    In frame1.jsp, the value in fieldB is: <%= session.getAttribute("fieldB") %>
    <p>
    <form name="reportRange">
    <center>
    <fieldset style="padding: 0.5em" name="customer_box">
    <table cellpadding="0" cellspacing="0" border="0">
    <tr class="drophead">
    <td valign="top" height="0" ><span class="drophead">
    test submit
    </td>
    </tr>
    </table>
    </fieldset>
    </center>
    </form>
    </body>
    </html>
    *****frame2.jsp*****
    <%@ page language="java" import="java.io.*, java.util.*" errorPage="error.jsp" %>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>frame2</title>
    <script LANGUAGE="JavaScript">
    function getData(fieldA)
    document.pageData.fldA.value = fieldA;
    document.pageData.submit();
    </script>
    </head>
    <body>
    <%if(request.getParameter("fldA")!=null){
    //this section doesn't make sense, your using the same value twice!?!%>
    <p>
    <h2>
    In frame2.jsp, the value of fieldA: <%= request.getParameter("fldA")
    %>
    <h2>
    In frame2.jsp, the value of fieldB: <%= session.getAttribute("fieldB") %>
    <p>
    <%}%>
    <div id="HiddenForm">
    <form name="pageData" method="post" action="frame2.jsp" target="_self">
    <input type="hidden" name="fldA" value="empty">
    </form>
    </div>
    </body>
    </html>
    ***** blank.html (obsolete) *****
    ***** error.jsp unchanged *****
    What you should be aiming for is either:
    A) Using the above code, send all your required parameters to the form in frame2.jsp and use these parameters to configure the page. As you can see I added an "if(request.getParameter("fldA")!=null)" block to prevent any code from being execute until you send the data.
    B) In frame1.jsp, submit it to itself with all the parameters you need and add the objects to the session. When frame1.jsp returns the page to the browser, get it to call a javascript function (<body onload='...'>") to reload frame2.jsp and collect the objects/variables from the session.
    Just remember Javascript and Java in JSP's don't exist in the same "world" so to speak. They have to cross a bridge to communicate, the bridge being the action of the form.
    Cheers,
    Anthony

  • Global Variables passing from standard form for use on custom form

    Hi,
    I'm trying to grab a value from a standard form, and pass it to a new custom form, which I am opening automatically from the standard form via personalizations. Is anyone aware of a way to send a value from one form to another? I was going to try using a global variable, which it looks like you can set through personalization. I tried doing it by passing the value as a form parameter, which works if I hard code a value, but it doesn't work if I refer to a value from the standard form.

    in your E-Business-environment may exist some special codings, which you have to think of, when passing parameters through the application.
    Copy the question to your EBS-Forum. They know ways using personalization and passing parameters

  • Passe var

    Hello,
    I'm just hacking on my keyboard but I cannnot find a solution
    for my problem.
    I wrote a dirty little function and trying to combine it with
    the blind effect. My function should be executed after the blind
    effect finished so I thought it would be the easiest way to use the
    finish parameter to call my own function after I had called the
    blind effect with onclick="blindUp.start()". Now the problem: I
    have to pass a var throught both function, the effect as well as my
    function, this var should contain the id of the div which I want to
    blind up but if I try to do it in this way
    onclick="blindUp.start('divId')" I get an error.
    Error: contentId is not defined
    Source: file://...../custom.html#content1
    Line: 94
    Line 94: var blindUp = new Spry.Effect.Blind(contentId,
    {duration: 600, from: '0px', to: '755px', toggle:false,
    finish:createObject});
    Thats a bit annoying because everythings works fine if I use
    no variable but I need it to use the functions for different
    elements on this page.
    Does anyone know how I can fix that?
    Source code:
    quote:
    <script type="text/javascript">
    function createObject(contentId, filename)
    var ele = document.getElementById(contentId);
    var children = ele.childNodes;
    for ( var i=children.length - 1; i >= 0; i-- )
    ele.removeChild( children
    var pdfOb = document.createElement("object");
    pdfOb.data = filename+".pdf";
    pdfOb.height = 750;
    pdfOb.width = 700;
    pdfOb.type = "application/pdf";
    pdfOb.id = contentId+"-pdfOb";
    ele.appendChild(pdfOb);
    </script>
    <body>
    <a href="#content1"
    onclick="blindUp.start('content1')">Title 1</a>
    Click it<br />
    <a href="#content1"
    onclick="removeOpened('content1')">Close</a>
    <p> Lorem Ipsum...
    </p>
    <div id="content1" class="objectDiv">
    </div>
    <script type="text/javascript">
    var blindUp = new Spry.Effect.Blind(contentId, {duration:
    600, from: '0px', to: '755px', toggle:false, finish:createObject});
    </script>
    </body>

    What are you trying to do? If you're just trying to scale a loaded image to a new size, you don't need so much code. And you want to use a Matrix object to scale when doing a draw.
    See if this helps. I've gotten rid of some extra code and comments, so I could more easily read it:
    function lisenFullcouv(e : Event){
        Bitmap(d.content).smoothing = true;
        var m:Matrix = new Matrix();
        m.scale(.8, .8);
        var passe:BitmapData = new BitmapData(320,480,true);
        passe.draw(d.content,m);
        var voir :Bitmap = new Bitmap(passe);    
        addChild(voir)

  • Passing Var to Java from PL/SQL

    I am trying to pass a PL/SQL varchar2 var to Java String. Java is not responding..
    sendmail(v_sub,v_msg,'[email protected]','[email protected]');
    it does accept ('ddd','ddd','[email protected]','[email protected]');
    Any ideas on how to make it work so I can use PL/SQL variable.
    Thanks much!

    Try with the following example.
    This ia taken from the Oracle8i manual.
    import java.sql.*;
    import java.io.*;
    import oracle.jdbc.driver.*;
    public class GenericDrop {
    public static void dropIt (String object_type, String object_name)
    throws SQLException {
    // Connect to Oracle using JDBC driver
    Connection conn =
    DriverManager.getConnection("jdbc:default:connection:");
    // Build SQL statement
    String sql = "DROP " + object_type + " " + object_name;
    try {
    Statement stmt = conn.createStatement();
    stmt.executeUpdate(sql);
    stmt.close();
    } catch (SQLException e) {System.err.println(e.getMessage());}
    CREATE OR REPLACE PROCEDURE drop_it (
    obj_type VARCHAR2,
    obj_name VARCHAR2)
    AS LANGUAGE JAVA
    NAME 'GenericDrop.dropIt(java.lang.String, java.lang.String)';
    Create table ee1(a number);
    declare
    i1 varchar2(20);
    i2 varchar2(20);
    begin
    i1:='TABLE';
    i2:='EE1';
    dropit(i1,i2);
    end;
    There is no problem in executing the above procedure.
    What is the exact error message you are getting?

  • Passing vars to custom popup

    I created a custom component out of a vbox. Within the vbox I
    declared a Bindable Public Variable as shown
    [Bindable]
    Public var dv_jobid:String;
    I want to launch the component in a popup window when a
    datagrid is double clicked. I call the function to create
    the popup and here is the code for that function. The popup
    gets created but when I include the code to pass a value to my
    public var I get the undefined property error. Iv been on this for
    two hours, ridiculous!!!!!!!!!!!!
    Im sure it's simple, why am I not getting this????

    Public is only capitalized here
    I will try casting viewjob as you say tomorrow, thanks. Hope
    that is it.
    That was it, thanks very much!

  • Trouble passing var using CFC

    I'm having trouble passing a variable value called from a CFC
    into Flex via RemoteObject. Basically I'm trying to pass the
    current logged-in user to a Combobox as a string. The Web directory
    in IIS is set to dissallow anonymous access and is set to
    Integrated Windows Authentication. The CFC is in the secured
    directory as well as the Flex app. If I change the CGI variable to
    something like #cgi.remote_addr# among others it works fine so I
    know it's not the actionScript or CFC code. Any ideas as to why
    #cgi.auth_user# is passing as an empty string?? One more caveat. If
    I invoke the function in my CFC from a .cfm page the auth_user is
    displayed as expected.
    ------------------------------------------------------------------------------------------ ----------

    To use RemoteObject with PHP you need to download AMFPHP and
    make some settings.
    To download go here:
    null.
    To understand how to use it with Flex go here:
    null.
    This is a video tutorial of about 7-10 minutes which will show you
    all you need you need to know to set AMFPHP in 'conversation' with
    Flex.
    Good luck!

  • Best way to pass vars from html into flash?

    I've read a variety of pages that describe how to pass a variable into a flash movie (AS3, player = v9) from the html in which it is embedded.  This page describes AS3 but neglects to mention what to do with the object and embed tags in the noscript section. Furthermore, I'm not sure the javascript I see generated in my page looks like the example there (the js in my page doesn't check AC_FL_RunContenta against zero).  This page is quite long and appears to deal mostly with AS1 and AS2 approaches which I have used before and neglects entirely the newish javascript approach which appears to be used to embed flash these days (i.e., the javascript function AC_FL_RunContent).
    I was wondering if someone could spell out the proper way to pass in a variable from HTML so that flash can see it in such a way that works even if javascript is disabled, in all browsers, etc., etc.
    I've attached the HTML generated by the Flash IDE to this topic.  Any help would be much appreciated.

    You'll have to search for that concise and thorough list of steps or figure it out using the information you now have, which is sufficient to get it done.  It's not that hard--add the FlashVars in the embedding code in the three places and use the various examples you have links to to add the code in the Flash file to access and use the FlashVars.
    Your Flash will be embedded in a web page depending on the visitors settings... if they allow javascript then the javascript portion will be used.  If they don't, then either the object or embed sections will be used depending on their browser.
    As far as javascript changes go, don't sweat 'em until you have a problem... use whatever code your Flash-created html page creates to embed the file in the page.

  • Passing var to a procedure that will be used in a where clause

    Hi,
    this is what i am facing
    I created a procedure : procName(inClause varchar2, dateClause date)
    in the procedure there is a query
    Insert into anExistingTable(val_a, val_b)
    select tableOne.a, tableTwo.b from tableOne, tableTwo
    where tableOne.col1 = tableTwo.col1 and
    tableOne.col2 in inClause and
    tableOne.col3 = dateClause;
    the select query above does not return any rows (although there are rows matching the criteria).
    I have tried to pass the inClause as : '1111','2222','3333'
    I have also tried as : ('1111','2222','3333')
    I have also tried the following query (but no luck) :
    Insert into anExistingTable(val_a, val_b)
    select tableOne.a, tableTwo.b from tableOne, tableTwo
    where tableOne.col1 = tableTwo.col1 and
    tableOne.col2[b] in (select inClause from dual) and
    tableOne.col3 = dateClause;
    I have also tried dynamic sql (but no luck)
    sqlsmt := ' Insert into anExistingTable(val_a, val_b) ' ||
    'select tableOne.a, tableTwo.b from tableOne, tableTwo ' ||
    ' where tableOne.col1 = tableTwo.col1 and ' ||'
    ' tableOne.col2 in :inclause and ' ||
    ' tableOne.col3 = :dateClause';
    execute immediate sqlsmt using inclause, dateclause
    The following query returns rows, so it seems that i dont get the query to understand the inClause parameter
    Insert into anExistingTable(val_a, val_b)
    select tableOne.a, tableTwo.b from tableOne, tableTwo
    where tableOne.col1 = tableTwo.col1 and
    tableOne.col2 in ('1111','2222','3333') and
    tableOne.col3 = dateClause;
    Is there something i am missing?
    thx
    theodore

    it has to be done with dynamic sql. but you can't use a bind variable
    sqlsmt := ' Insert into anExistingTable(val_a, val_b) ' ||
    'select tableOne.a, tableTwo.b from tableOne, tableTwo ' ||
    ' where tableOne.col1 = tableTwo.col1 and ' ||'
    ' tableOne.col2 in ' || inclause || ' and ' ||
    ' tableOne.col3 = :dateClause';
    execute immediate sqlsmt using dateclause the above assumes that the variable inclause contains the begin/end parens.
    if inclause contains string data (with single quotes), then you'll need to double up on the single quotes to keep the parsing correct
    ' tableOne.col2 in ' || replace(inclause, '''', '''''',)  || ' and ' ||

  • Pass var to a observer

    my code...
    <div id="list" spry:region="dsContratto">
              <!--- region ---> 
              <tr spry:repeat="pv" spry:even="even" spry:odd="odd"> 
                  <a href="javascript:open({contratto_id},'sost')">OpenModal</a> 
              </tr> 
    </div>
    function open(id, action) { 
        open modal and linked-region
    function funcObserverLinkedRegion(notificationState, notifier, data) { 
        how a can get value of "action" var?
    Spry.Data.Region.addObserver("detail", funcObserverLinkedRegion); 
    i solve put actionvar in window scope.
    but it not seems a good solution...
    any idea?
    many thanks

    I am sorry, but I fail to see what it is that you are trying to do
    <div id="list" spry:region="dsContratto">
              <!--- region ---> 
              <tr spry:repeat="pv" spry:even="even" spry:odd="odd"> 
                  <a href="javascript:open({contratto_id},'sost')">OpenModal</a> 
              </tr> 
    </div>
    I can see that this opens a separate window, but how does the following relate to the above?
    function open(id, action) { 
        open modal and linked-region
    function funcObserverLinkedRegion(notificationState, notifier, data) { 
        how a can get value of "action" var?
    Spry.Data.Region.addObserver("detail", funcObserverLinkedRegion); 
    Gramps

Maybe you are looking for

  • Safari 4.0.5 QTCF.dll

    Hi,, I will give you all information in this first post so it is easier I have Safari 4.0.5 (531.22.7) And every time i open it up, after a few seconds it errors, 2 times, both with exactly the same text in error dialouge, one straight after the othe

  • Union report in obiee 11g problem

    HI,     I build union report in obiee 11g.In that report i have one column i.e Financial month.I have excluded Financial month column in table view.     Now my requirement is I have to show results based Financial month at dashboard.For example if i

  • VO with Adobe Acrobat 9 Pro

    Can someone please give me a hint on how to get VO to focus on the document pane in Acrobat? I cannot get VO to read a PDF in Acrobat. It reads the Bookmarks/Pages pane just fine, but will not go to the documents pane. Even when I close the other pan

  • I updated adobe lightroom cc but it wont open ?

    i updated adobe lightroom cc but it wont open ?

  • Why is broadband required with WRT54G?

    I bought a new WRT54G and a companion wireless pci card for my other PC after specifically asking the tech guy on duty if this would work as a 2 PC network without any internet connection, and he said yes. Only after getting it home and opening the b