Global variables in a format plugin

Hello,
I developped a format plugin under Windows and I am now porting it to the Macinstosh. I found that the global variables dont seem to behave as they do in windows. In windows, they are real global variables that keep they value as long as Photoshop runs. Under the Macintosh, the variables get reset once in a while. It seems that the plugin gets reloaded, probably after each set of events ( ex: if loading a file requires a ReadStart, ReadContinue and ReadFinish event, then the global variables keep their value for these events. On the next file loaded, they are reinitialised to their default value).
This is a bit annoying because I like keeping a few basic states in memory to save time (ex: load an INI file only once) but that does not work on the Mac. Is there something to do to have the same behavior as we have under windows (have the plugin loaded only once or some other way to have global variables keep their values?
Thanks,
Gilbert

Plugins get unloaded when they're done being used - that is pretty well documented in the SDK.
You can't assume that globals will remain valid on any platform.
That's why the example plugins save their globals in a structure and save that via the plugin API.

Similar Messages

  • Use global Variable for Formatstring

    Hello
    I wanna use a global variable for a format string. see picture. But I don't work.
    Can anybody give me an idea, why it won't work?
    Thanks a lot!!!
    Attachments:
    GlobalVariable.jpg ‏61 KB

    As others said, the problem is not the global.
    See attached a picture of how to do what you want. Since the Format String is unknown at edit time, you must provide the types to all inputs that are not DBL.
    From your example, the while loop has been coded exactly like a for loop. It can be replaced with a for loop with auto-indexing, unless you really want the local variable to be update at each iteration every 50 ms. This delay is not necessary unless the computed array is huge and you want to leave some CPU time to other code in your application. Even then you can enter a delay of 0ms to force to swap to other tasks.
    I don't know what your INT>BOOL VI does but using Scan from String you can read a number directly into a boolean. The number i
    s rounded to an unsigned integer and 0 is False and >0 is True.
    For example you scan a string for a boolean with format string %d.
    "0" --> False
    "24" --> True
    "-18" -- False (coerced to unsigned = 0)
    You scan a string for a boolean with format string %f:
    Negative number up to "0.5" --> False (coerced and rounded to 0)
    Number greater that 0.5 --> True
    LabVIEW, C'est LabVIEW
    Attachments:
    diag.jpg ‏15 KB

  • What format to input $currentdate(datetime) Global Variable in Data Services Management Console?

    What is the correct input format for the datetime Global Variable in Data Services Management Console? 
    I've tried several formats and keep getting a syntax error. 
    The DSMC is Version: 14.0.3.451
    I'm a new user and learning as I go.  
    Thanks for your help. 

    Hi,
    if you get syntax error as below,
      Syntax error at line <1>: <>: near <.04> found <a float> expecting <+, ||, DIVIDE, MOD, *, SUBVARIABLE, a decimal>.
      1 error(s), 0 warning(s).
      Check and fix the syntax and retry the operation.
      Error parsing global variable values from the command line: <$sedate=2014.12.04 12:00:00;>.
    Check the syntax and try again.
    solution is simple
    Place the global variable value in single quotes '2014.12.04 12:00:00'

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

  • Global variable in XSLT

    Hi,
    I have a requirement in XSLT mapping where i sum up all the data related to amount field and then want to display total that i have added in the another node
    eg.
    <Detail>
    <xsl:variable name="<b>etotal</b>" select="sum(ns0:pay/ns0:checkList/ns0:check/ns0:deductionList/ns0:adjustment/ns0:amount/ns0:amount)"/>
    </Detail>
    <Trailer>
    <TotalDeductionAmount><xsl:value-of select="<b>$etotal</b>"/>
    </TotalDeductionAmount>
    </Trailer>
    how to do ?
    since the above example the scope of the variable is local and cannot be accessed globally. how to declare a global variable and then assign value to the variable
    or is there any other method to do this in XSLT
    Thanks in advance
    With Regards
    Pradeep N

    Hi,
    Please see below sample code is solving your problem. Global variable can not solve the problem, you need to use templates and call then appropriately.
    -Kavita
    Sample Input
    <?xml version="1.0" encoding="UTF-8"?>
    <root>
    <Test>23</Test>
    <Test>34</Test>
    <Test>90</Test>
    </root>
    Sample Output
    <?xml version="1.0" encoding="UTF-8"?>
    <Mt_test>
         <Header>"create the header data according to req"</Header>
         <Details>
              <DetailsCol>23</DetailsCol>
         </Details>
         <Details>
              <DetailsCol>34</DetailsCol>
         </Details>
         <Details>
              <DetailsCol>90</DetailsCol>
         </Details>
         <Trailer>
              <TotalSum>147</TotalSum>
         </Trailer>
    </Mt_test>
    XLST:
    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <xsl:template match="/">
    <xsl:element name="Mt_test">
    <xsl:element name="Header">"create the header data according to req"</xsl:element>
              <xsl:variable name="checkNext" select="//Test[1]"/>
    <xsl:call-template name="GenerateTest">
    <xsl:with-param name="currNode" select="//Test[1]"></xsl:with-param>
    <xsl:with-param name="Sum" select="0"></xsl:with-param>
    </xsl:call-template>
    </xsl:element>
    </xsl:template>
    <xsl:template name="GenerateTest">
    <xsl:param name="currNode"></xsl:param>
    <xsl:param name="Sum"></xsl:param>
    <xsl:element name="Details">
    <xsl:element name="DetailsCol"><xsl:value-of select="$currNode"></xsl:value-of></xsl:element>
    </xsl:element>
    <xsl:variable name="Sum1" select="$Sum + $currNode"></xsl:variable>
    <xsl:variable name="checkNext" select="$currNode/following-sibling::*[1]"/>
    <xsl:choose>
         <xsl:when test="$checkNext">
    <xsl:call-template name="GenerateTest">
    <xsl:with-param name="currNode" select="$checkNext"></xsl:with-param>
    <xsl:with-param name="Sum" select="$Sum1"></xsl:with-param>
    </xsl:call-template>     
         </xsl:when>
         <xsl:otherwise>
         <xsl:call-template name="GenerateTrailer">
    <xsl:with-param name="currNode" select="chkeckNext"></xsl:with-param>
    <xsl:with-param name="Sum" select="$Sum1 "></xsl:with-param>
    </xsl:call-template>
         </xsl:otherwise>
    </xsl:choose>
    </xsl:template>
    <xsl:template name="GenerateTrailer">
    <xsl:param name="currNode"></xsl:param>
    <xsl:param name="Sum"></xsl:param>
    <xsl:element name="Trailer">
    <xsl:element name="TotalSum"><xsl:value-of select="$Sum"></xsl:value-of></xsl:element>
    </xsl:element>
    </xsl:template>
    </xsl:stylesheet>

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

  • Referencing Global Variable in Forms DDL (Form Personalization R12)

    Team,
    I'm saving a profile option in a Global variable GLOBAL.FLINV_PROFILE_VALUE when a form opens.
    Then I am clearing the variable using Forms DDL and calling FND_PROFILE.SAVE function.
    I need to then reset the profile option with a second call to FND_PROFILE.SAVE. I'm trying to use Forms DDL, i.e.
    DECLARE
    a BOOLEAN;
    BEGIN
    a := fnd_profile.SAVE ('PER_SECURITY_PROFILE_ID'
    , '''||:global.flinv_profile_value||'''
    , ''USER''
    , ''1110''
    , NULL
    , NULL
    END;
    but I'm not finding a proper way to pass that global variable. Is there a way to reference these variables in the DDL? Should I use 'Call a procedure' and format the call differently?
    Any ideas are welcome.
    Joe

    Not sure why your using an anonymous block. Personalization rules should look like the following in a *.ldt file.
    BEGIN FND_FORM_CUSTOM_RULES "314"
    FUNCTION_NAME = "INV_INVITSNU"
    DESCRIPTION = "Disable Query-Enter Mode"
    TRIGGER_EVENT = "WHEN-NEW-BLOCK-INSTANCE"
    TRIGGER_OBJECT = "MTL_SERIAL_NUMBERS"
    SEQUENCE = "20"
    CREATED_BY = "34307"
    CREATION_DATE = "2012/04/22"
    OWNER = "USER123"
    LAST_UPDATE_DATE = "2012/04/22"
    LAST_UPDATE_LOGIN = "145888118"
    ENABLED = "Y"
    FIRE_IN_ENTER_QUERY = "N"
    FORM_NAME = "INVITSNU"
    RULE_TYPE = "A"
    BEGIN FND_FORM_CUSTOM_ACTIONS "314" "314"
    SEQUENCE = "10"
    PROPERTY_VALUE = "5"
    ARGUMENT_TYPE = "B"
    CREATED_BY = "34307"
    CREATION_DATE = "2012/04/22"
    OWNER = "USER123"
    LAST_UPDATE_DATE = "2012/04/22"
    LAST_UPDATE_LOGIN = "145888118"
    TARGET_OBJECT = "MTL_SERIAL_NUMBERS"
    ACTION_TYPE = "P"
    ENABLED = "Y"
    OBJECT_TYPE = "BLOCK"
    MESSAGE_TYPE = "S"
    BUILTIN_TYPE = "C"
    LANGUAGE = "*"
    PROPERTY_NAME = "195"
    MENU_SEPERATOR = "N"
    END FND_FORM_CUSTOM_ACTIONS
    BEGIN FND_FORM_CUSTOM_SCOPES "314" "20" ""
    LAST_UPDATE_DATE = "2012/04/22"
    OWNER = "USER123"
    CREATION_DATE = "2012/04/22"
    CREATED_BY = "34307"
    LAST_UPDATE_LOGIN = "145888118"
    END FND_FORM_CUSTOM_SCOPES
    END FND_FORM_CUSTOM_RULES

  • Global variable in servlet & DBPooling questions

    Hello guys,
    I used to develop PHP/ASP, and am new to servlet. I have been searching around for a solution ...
    With Php, we can get the reference of a global variable in any classes->functions...
    How do I do this with servlet ?
    And second..I have developed the DB class as below... I set the datasource to be static, so it initializes only once. Is it a good idea? How would you like to improve this class? any comments?
    package shop.database;
    import javax.sql.DataSource;
    import java.sql.*;
    import org.apache.commons.dbcp.BasicDataSource;
    import org.apache.log4j.Logger;
    import shop.admin.exception.GeneralException;
    public class DdManager {
         static protected Logger logger = Logger.getLogger(DdManager.class);
         private String userName = "root";
    private String password = "";
    private String hostName = "jdbc:mysql://localhost:3306/shop";
    private String database="shop";
         static private DataSource ds;     // set this to be static so all threads share the same job in JVM
         private Statement stmt;
         private Connection conn;
         private ResultSet rs;
         private CallableStatement cs;
    public DdManager() {}
    * setup the data source and return it
         public static DataSource getDataSource(
              String sDrvName,
              String sUserName,
              String sPwd,
              String connectURI) {
              BasicDataSource ds = new BasicDataSource();
              ds.setDriverClassName( sDrvName );
              ds.setUsername( sUserName );
              ds.setPassword( sPwd );
              ds.setUrl( connectURI );
              ds.setMaxActive( 15 );
              ds.setMaxIdle( 10 );
              ds.setMaxWait( 10000 ); // 10 seconds
              return ds;
         * static init of the class
         * this class is will be called only once to initialize the DataSource
         static {
              try {
                   Class.forName( "com.mysql.jdbc.Driver" );
                   ds = getDataSource(     "com.mysql.jdbc.Driver",
                                            "root",
                                            "jdbc:mysql://localhost:3306/shop" );
                   if (ds == null) {
                        String msg = "Connection Pool error";
                        logger.error(msg);
                        throw new GeneralException(msg);
                   logger.info("DataSource has been initialized");
              } catch(Exception exception) {
                   logger.error(exception.toString());
                   try {
                        throw new GeneralException(exception.toString());
                   } catch (GeneralException e) {
                        logger.error(e.toString());
         * get the connection from the pool (DataSource)
    public void openConnection() throws GeneralException {
    try {
         BasicDataSource bds = (BasicDataSource) ds;
         logger.info("NumActive: " + bds.getNumActive() + ", " + "NumIdle: " + bds.getNumIdle());
    conn = ds.getConnection();
    logger.info("Connection of " + database + " has been established");
    } catch(Exception exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    * close the connection will actually return the connection to the pool (Must)
    public void closeConnection() throws GeneralException {
         initResource();
    try {
         if (conn != null){
                   conn.close();
                   logger.info("Connection of " + database + " has been closed");
    } catch(SQLException exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    * prepare the calling stmt
    public void prepareProcedure(String callStatement) throws GeneralException {
         initResource();
    try {
         cs = conn.prepareCall(callStatement);
    } catch(SQLException exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    * set the pass-in parameter for "String"
    public void setParameter(int position, String parameter) throws GeneralException {
    try {
         cs.setString(position, parameter);
    } catch(Exception exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    * set the pass-in parameter for "Integer"
    public void setParameter(int position, int parameter) throws GeneralException {
    try {
         cs.setInt(position, parameter);
    } catch(Exception exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    * execute the procedure and return the resultset
    public ResultSet execProcedure() throws GeneralException {
    try {
         rs = cs.executeQuery();
    } catch(SQLException exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    return rs;
    * close the statment and resultset
         private void initResource() throws GeneralException {
         try {
              if(rs != null) {
                   rs.close();
              if(stmt!= null) {
                   stmt.close();
              logger.info("Statement & Resultset have been free");
         } catch(Exception exception) {
         logger.error(exception.toString());
         throw new GeneralException(exception.toString());
    Thanks mates!
    myy

    Thanks Saish,
    Your response is really appreciated. Sorry about that
    as i didnt know there is 'code' formatting button,
    and I will look into the Singleton pattern.
    As I'm still in the learning stage. Therefore, i
    still have a lot of thing do not understand.
    ... use it in a method signature ...What is "a method signature" ?
    A method signature is basically the method's parameters, return value, name and any access or other modifiers. The following is a method signature:
    static final public void main(final String[] args)Between the braces of the method body is the implementation (or as I already alluded to, the method body).
    Consider using an already-developed connection poolimplementation, such as Jakarta Commons DBCP ...
    I'm trying to implement the Jakarta DBCP. Did I go
    into the wrong way?
    Sorry, did not read the imports. Yes, you are. However, I am confused about what you are trying to implement. You have a static method getDataSource(). You also have a static variable 'ds'. Use one or the other. I would be that there are seemingly random errors cropping up based on whether you remember to call getDataSource() or not.
    You do not, generally, want the data source to be static. Multiple threads might use the class. And if there is only a static data source, you will either need to synchronize the methods that use the data source (resulting in a scaling bottleneck) or not synchronize them (which will totally destroy any concept of a logical unit of work or database transaction).
    .. A static datasource, as in your class, can onlysafely be used by one thread at a time, potentially
    introducing scaling bottlenecks (or race conditions)
    in your system ...
    So, you mean there is no need for the DataSource to
    be static ?
    No, in fact, IMO, it should not be. That is why you are pooling. Use instances. The pool will manage the connections and their availabilty for you.
    Why are you throwing GeneralException everywhere?Here's a question: can someone using your class (a
    caller) realistically be expected to handle a
    database exception?
    When there is a database error, I just want to stop
    the process and redirect the user to an error page. I
    will look into the unchecked exceptions. Thanks.
    Unchecked exceptions do not need to be declared in a method signature or caught within the method body. Checked exceptions do. As such, an added benefit is that unchecked exceptions de-clutter your code.
    In your initResources() method, what happens if theclose() on ResultSet throws an exception
    Oh, yes. I'm so stupid.
    Now I only have ...
         private static DataSource ds;     // set this to
    be static so all threads share the same obj in JVM
         private Connection conn;
         private CallableStatement cs;
    private void initResource() throws GeneralException
    n {
         try {
              if(cs != null) {
                   cs.close();
    logger.info("CallableStatement has been
    as been free");
         } catch(Exception exception) {
         logger.error(exception.toString());
    throw new
    throw new GeneralException(exception.toString());
    You still have issues.
    public void initResources() {
       if (rs != null) {
         try { rs.close(); } catch (SQLException ignore) { ignore.printStackTrace(); }
       if (stmt != null) {
         try { stmt.close(); } catch (SQLException ignore) { ignore.printStackTrace(); }
    }Normally, this type of method would not be called initResources() but rather closeResources() or freeResources(). It would be called from within the 'finally' block of another method using the CallableStatement or ResultSet.
    This is really is problem, would you mind to tell me
    how to handle this(close the connection) if the
    close() on either CallableStatement or Resultset
    throws an exception ?
    See above. Simply log the exception (there is usually nothing meaningful you can do if a close() fails, and it is up to you as a developer if this is an error or just a warning). Another option is to 'chain' exceptions. In your own exception, add a method 'addException(Throwable)'. This would add another exception to a List of exceptions. When you print the stack trace, iterate through the chained exceptions to print them all out. One place where I find this useful is rollback() code. If the original SQL statement fails AND the rollback fails, I definitely want to see that rollback() exception as well in my logs.
    The DB thing makes me headache. What I actually
    wanted is a solution for:
    Let say I have a class "HelloAction.class" contains
    the code:
    public ActionForward XXX() {
         DbManager DB = new DBManager();
         ... do some DB thing here...
         SecondClass SC = new SecondClass();
         SC.doSomeOtherDbThing();
         ... do something else...
         ThirdClass TC = new ThirdClass();
         SC.doMoreOtherDbThing();
    }There are some functions in SecondClass.class and
    ThirdClass.class that will need database connection.
    I consider 'global variable' is because I want these
    two classes are able to use the same
    connection(DbManager) from the function -
    ActionForward XXX().
    What is the best way to implement the above situation
    (sharing the same connection in different classes &
    sub-classes?
    I also just realize that the problem of multi-threads
    with these two class variables..
         private Connection conn;
         private CallableStatement cs;Really headache. I really appreciate any comments.
    Thanks.
    - myyPass the Connection or DataSource to each method or constructor. Call commit() or rollback() from the method that created the transaction.
    - Saish

  • PS Custom Format Plugin - Issue Reading Files 2GB & 4GB

    Is this issue fixable within our format plugin code, or is it  a photoshop limitation?
    I am new to Photoshop & Photoshop Plugins.  I have reviewed the sdk photoshop documentation & searched web on this subject.
    I am working with a photoshop format plugin written by my predecessor who is no longer here.
    The plugin is modeled after the simpleFormat plugin.
    The plugin is being used on systems running Photoshop CS6 & CC on 64bit Windows 7 with 8GB or more memory.
    The plugin allows a file of our format to be opened, read and written.
    ISSUE:
    The plugin works fine reading  files < 2GB or > 4GB.  For files between 2GB and 4GB, the call to allocate memory fails.
    In the plugin's PIPL structure:   the FormatMaxSize {32767, 32767} and PluginMaxSize {PlugInMaxSize { 2147483647, 2147483647 }
    In the plugin code;  the DoReadStart() method opens the file and reads the file header information.  This works fine.
    Next, in the DoReadContinue() method: SPsBuffer->New(&bufferSize, buffersize) is returning NULL.     see below.
    void PluginMain (const int16 selector,
                                                                             FormatRecordPtr formatParamBlock,
                                                                             intptr_t * data,
                                                                             int16 * result)
        gFormatRecord = reinterpret_cast<FormatRecordPtr>(formatParamBlock);
              gPluginRef = reinterpret_cast<SPPluginRef>(gFormatRecord->plugInRef);
              gResult = result;
              gDataHandle = data;
    sSPBasic = ((FormatRecordPtr)formatParamBlock)->sSPBasic;
    if (gCountResources == NULL ||
                gGetResources == NULL ||
                gAddResource == NULL ||
    gFormatRecord->advanceState == NULL)
    *gResult = errPlugInHostInsufficient;
    return;
    // new for Photoshop 8, big documents, rows and columns are now > 30000 pixels
    if (gFormatRecord->HostSupports32BitCoordinates)
            gFormatRecord->PluginUsing32BitCoordinates = true;
    static void DoReadPrepare()
         gFormatRecord->maxData = 0
    static void DoReadContinue (void)
              int32 done;
              int32 total;
              int32 row;
              VPoint imageSize = GetFormatImageSize();
              /* Set up the buffer & progress variables. */
              done = 0;
              total = imageSize.v;
        Ptr pixelData        = NULL;
        Ptr rawData          = NULL;
        Ptr uncompressedData = NULL;
        int64* offsetTable   = NULL;
    /* allocate the pixel buffer. */
              unsigned32 bufferSize = gFormatRecord->planes * imageSize.v * imageSize.h;
              pixelData = sPSBuffer->New( &bufferSize, bufferSize );            <======   This allocation fails for file sizes > 2GB & < 4GB.
              if (pixelData == NULL)
                        *gResult = memFullErr;
                        //return;
                        if(*gResult == memFullErr) { goto ReadContinueCleanUp; }

    Some examples of files that are successfully read and files that are not successfully read are shown below:
    Filenames that contain "nok" as part of the name, would not open and an out of RAM error occurs.
    in the ReadContinue method, shown in an earlier post on this thread.
    Filenames
    12x12ok
    12x24ok
    ok
    nok
    nok
    nok
    ok
    hdots
    17280
    17280
    23160
    23180
    30001
    32768
    32768
    vdots
    8640
    17280
    23160
    23180
    30001
    32768
    32768
    hdots * vdots
    149299200
    298598400
    536385600
    537312400
    900060001
    1.074E+09
    1.074E+09
    hdots  + vdots
    25920
    34560
    46320
    46360
    60002
    65536
    65536
    hdpi,vdpi
    1440:720
    1440:720
    1440:720
    1440:720
    1440:720
    1440:720
    1440:720
    #channels
    4
    4
    4
    4
    4
    4
    5
    #bpp
    2
    2
    2
    2
    2
    2
    2
    compression
    Packbits
    Packbits
    Packbits
    Packbits
    Packbits
    fileLength(bytes)
    8593776
    8647536
    14365054
    17063936
    21258240
    filesize (MB)
    356
    712
    8.19
    8.24
    13.7
    16.27
    20.27
    filesize (GB)
    0.348
    0.69
    0.008
    0.008
    0.0134
    0.016
    0.0198

  • Change source path in batch Job in global variable in data services

    Hi Experts,
    my organization has created job in data services 3.2 to cleanse the data reading from excel flat files. the folder path was store in the global variable(I think) and now they have changed the directories hence is it throwing me below error.
    Error, Input file  does not exist please confirm existence and restart job, 16 ) >
    failed, due to error <50316>: <>>> Error, Input file  does not exist please confirm existence and restart job>. I want to update the folder path. I am sure it would be easy but I am very new to BODS.
    (12.2) 07-15-14 16:10:08 (14232:12656)  PRINTFN: > 'JOB DEBUG' : '>>> Sleeping for 35.000000 seconds...  '
    (12.2) 07-15-14 16:10:43 (14232:12656)  PRINTFN: > 'JOB DEBUG' : '>>> Waking up......  '
    (12.2) 07-15-14 16:10:43 (14232:12656)  PRINTFN: > 'JOB DEBUG' : 'Starting the timer loop number 6...'
    (12.2) 07-15-14 16:10:43 (14232:12656) WORKFLOW: Work flow <WF_Metadata_Files> is started.
    (12.2) 07-15-14 16:10:43 (14232:12656)  PRINTFN: > 'JOB DEBUG' : '>>> $G_FILENAME_IN : ALL_Metadata_SALES.xls...'
    (12.2) 07-15-14 16:10:43 (14232:12656)  PRINTFN: > 'JOB DEBUG' : '>>> looking for input file name
                                                     \\infra\finance\production\sales\Metadata\ALL_Metadata_SALES.xls'
    (12.2) 07-15-14 16:11:08 (14232:12656)  PRINTFN: > 'JOB DEBUG' : '>>>  Input file Name is '
    (12.2) 07-15-14 16:11:08 (14232:12656)  PRINTFN: > 'JOB ERROR' : '>>> Error, Input file  does not exist please confirm existence and restart job'
    I want to update the folder path\\infra\finance\production\sales\Metadata\ALL_Metadata_SALES.xls to \\Home\BIData\finance\production\sales\Metadata\ALL_Metadata_SALES.xls
    when i investigated WF_Metadata_files i saw there is a global called INPUT_DIR i assume I have to change the path there. I tried to find old directory in the batch job but i cant find it and even When i give value to global variable it is still pointing to old path.
    Can anybody please help me.
    Thanks
    Tim

    Hi Tim,
    If having specified the value in the global variable it is still pointing to the old path there can be a couple of scenarios applicable
    1. There is a different global varaiable being used for the file path
    2. The filepath is hardcoded in the file-format or Excel file definition despite the declaration of the global variable.
    Are you getting this error when running a dataflow within this workflow or in a script? It will be better to run the workflow in debug mode and look through the stages to find out where exactly in the workflow it fails.
    kind regards
    Raghu

  • Format Plugin Issue

    Dear Experts,
    I develop "Custom Format Plugin" using sample sdk's code. It is working fine for Grey as well as RGB images. But it is creating problems for Indexed images. When I filled the redLUT,greenLUT and blueLUT member of FormatRecord strcture, It showed me image with only red color. As far as I understand , it is not setting the other colors table properly.Thats why it is displaying image with only red color rest image is displayed with black color. if I don't fill the blue and green table , result remain the same. So it is confirmed that after filling all the three tables , it has effect only for red color rest remain unchanged. I won't be able to break where actually the problem is coming. Kindly help me in this regard, if somebody had done work similar to that in their project.
    Thanks;
    Vikas

    Dear Experts,<br />             Kindly find the code given below:-<br /><br />SimpleFormat.cpp<br /><br />SPBasicSuite * sSPBasic = NULL;<br />SPPluginRef gPluginRef = NULL;<br /><br />FormatRecord * gFormatRecord = NULL;<br />int32 * gDataHandle = NULL;<br />Data * gData = NULL;<br />int16 * gResult = NULL;<br /><br />#define gCountResources gFormatRecord->resourceProcs->countProc<br />#define gGetResources   gFormatRecord->resourceProcs->getProc<br />#define gAddResource     gFormatRecord->resourceProcs->addProc<br /><br />static void DoReadStart (void)<br />{<br />     <br />     // If you add fmtCanCreateThumbnail to the FormatFlags PiPL property<br />     // you will get called to create a thumbnail. The only way to tell<br />     // that you are processing a thumbnail is to check openForPreview in the<br />     // FormatRecord. You do not need to parse the entire file. You need to<br />     // process enough for a thumbnail view and you need to do it quickly.<br />     <br />     <br />     ReadScriptParamsOnRead (); // override params here<br />     <br />     /* Exit if we have already encountered an error. */<br /><br />    if (*gResult != noErr) return;<br />          <br />     /* If we have not encountered an error, then we want to read<br />        the file header. */<br />        <br />     *gResult = SetFPos (gFormatRecord->dataFork, fsFromStart, 0);<br />     if (*gResult != noErr) return;<br />     <br />     ReadSome (sizeof (header.manufacturer), &header.manufacturer);<br />     if(header.manufacturer != manufacturer_flag)<br />          return;<br />     <br />     ReadSome(sizeof(header.version), &header.version);<br />     if(header.version != version_0 && header.version != version_2 && header.version != version_3 && header.version != version_4 && header.version != version_5)<br />          return;<br /><br />     ReadSome(sizeof(header.encoding), &header.encoding);<br />     if(header.encoding != uncompressed)<br />          return;<br /><br />     ReadSome(sizeof(header.bits_per_sample), &header.bits_per_sample);<br />     if(header.bits_per_sample != bits_1 && header.bits_per_sample != bits_2 && header.bits_per_sample != bits_4 <br />          && header.bits_per_sample != bits_8)<br />          return;<br /><br />     for (int i=0;i< window_size;i++)<br />          ReadSome(sizeof(header.window[i]), &(header.window[i]));<br /><br />     header.image_height = header.window[3] - header.window[1] + 1;<br />     header.image_width = header.window[2] - header.window[0] + 1;<br /><br />     ReadSome(sizeof(header.hdpi), &header.hdpi);<br />     ReadSome(sizeof(header.vdpi), &header.vdpi);<br /><br />     for(int i= 0; i<default_palette_size; i++)<br />     ReadSome(sizeof(header.palette[i]), &header.palette[i]);<br /><br />     ReadSome(sizeof(header.reserved), &header.reserved);<br />     <br />     ReadSome(sizeof(header.nplanes), &header.nplanes);<br />     if (header.nplanes != index_gray && header.nplanes != rgb && header.nplanes != rgba)<br />          return;<br /><br />     ReadSome(sizeof(header.bytes_per_line), &header.bytes_per_line);<br />     ReadSome(sizeof(header.palette_info), &header.palette_info);<br /><br />     ReadSome(sizeof(header.hscreen_size), &header.hscreen_size);<br />     ReadSome(sizeof(header.vscreen_size), &header.vscreen_size);<br />     <br />     //header.filler.resize(filler_size);<br />     for(int i= 0; i<filler_size; i++)<br />     ReadSome(sizeof(header.filler[i]), &header.filler[i]);<br />     <br /><br />     // read gray/index/bitmap type<br />     if (header.nplanes == index_gray){<br />          if(header.palette_info == palette_info_type  && header.version <= version_3)<br />               gFormatRecord->imageMode = plugInModeGrayScale;<br />          else if(header.bits_per_sample > bits_1)<br />               gFormatRecord->imageMode = plugInModeIndexedColor;<br />          else if(header.bits_per_sample == bits_1)<br />                gFormatRecord->imageMode = plugInModeBitmap;<br />     }<br />     else if (header.nplanes == rgb) {<br />          gFormatRecord->imageMode = plugInModeRGBColor;<br />     }<br />     else if (header.nplanes == rgba) {<br />          gFormatRecord->imageMode = plugInModeCMYKColor;<br />     }<br />  <br />     VPoint imageSize;<br />     <br />     imageSize.h = header.image_width;<br />     imageSize.v = header.image_height;<br />     SetFormatImageSize(imageSize);<br />     gFormatRecord->depth = header.bits_per_sample;<br />     gFormatRecord->planes = header.nplanes;<br />     gFormatRecord->transparencyPlane = 0;<br />     gFormatRecord->canTranspose = TRUE;<br />     gFormatRecord->transparencyMatting = DESIREDMATTING;<br /><br />     if (sPSHandle->New != NULL)<br />          gFormatRecord->imageRsrcData = sPSHandle->New(0);<br />     gFormatRecord->imageRsrcSize = 0;<br />          <br />     /* Next, we will will read the lookup tables if in indexed color mode. */<br />     <br />     if (gFormatRecord->imageMode == plugInModeIndexedColor)<br />     {<br />          LONG data_size = header.bytes_per_line * header.image_height;<br /><br />          long data_moved = SetFilePointer ((HANDLE)gFormatRecord->dataFork,data_size, NULL,FILE_CURRENT);<br />          if (data_moved != 128 + data_size)<br />               return;<br />     <br />          int8 color_marker;<br />          ReadSome (1, &color_marker);<br />          if (*gResult != noErr) return;<br /><br />          if(color_marker == 12){<br />               ReadSome (sizeof (LookUpTable), &gFormatRecord->redLUT);<br />               ReadSome (sizeof (LookUpTable), &gFormatRecord->greenLUT);<br />               ReadSome (sizeof (LookUpTable), &gFormatRecord->blueLUT);<br />               if (*gResult != noErr)<br />                    goto CleanUp;<br />          }<br />          data_moved = SetFilePointer ((HANDLE)gFormatRecord->dataFork,128, NULL,FILE_BEGIN);<br />          if(data_moved != 128)<br />               return;<br />          <br />     }<br />          <br />     return;<br />          <br />     /* The following code does any clean-up work in the event of an error. */<br />     <br />CleanUp:<br />     <br />     DisposeImageResources ();   <br />}<br /><br />/*****************************************************************************/<br /><br />static void DoReadContinue (void)<br />{<br />     <br />     int32 done;<br />     int32 total;<br />     int16 plane;<br />     int32 row;<br />     <br />     /* Dispose of the image resource data if it exists. */<br />     <br />     DisposeImageResources ();<br />     <br />     /* Set up the progress variables. */<br />     <br />     done = 0;<br />     VPoint imageSize = GetFormatImageSize();<br />     total = imageSize.v * gFormatRecord->planes;<br />          <br />     /* Next, we will allocate the pixel buffer. */<br /><br />     uint32 bufferSize = header.bytes_per_line;//RowBytes();<br />     Ptr pixelData = sPSBuffer->New( &bufferSize, bufferSize );<br />     <br />     if (pixelData == NULL)<br />     {<br />          *gResult = memFullErr;<br />          return;<br />     }<br />     <br />     /* Set up to start returning chunks of data. */<br />     <br />     VRect theRect;<br /><br />     theRect.left = 0;<br />     theRect.right = imageSize.h;<br />     gFormatRecord->colBytes = (gFormatRecord->depth + 7) >> 3;<br />     gFormatRecord->rowBytes =/* header.bytes_per_line;//*/RowBytes();<br />     gFormatRecord->planeBytes = 0;<br />     gFormatRecord->data = pixelData;<br /><br />          <br />     for (row = 0; *gResult == noErr && row < imageSize.v; ++row)<br />     {<br />          for (plane = 0; *gResult == noErr && plane < gFormatRecord->planes; ++plane)<br />          {<br />               gFormatRecord->loPlane = gFormatRecord->hiPlane = plane;<br />               theRect.top = row;<br />               theRect.bottom = row + 1;<br />               SetFormatTheRect(theRect);<br />               ReadSome (header.bytes_per_line/*header.image_width*/, pixelData);<br />               <br />               if(*gResult == noErr)<br />                    *gResult = gFormatRecord->advanceState();<br />               <br />               gFormatRecord->progressProc(++done, total);<br />          }<br />          <br />     }<br /><br />     if (*gResult != noErr) return;<br />     <br />     gFormatRecord->data = NULL;<br />     <br />     sPSBuffer->Dispose(&pixelData);<br /><br />     DoReadICCProfile ();<br />}<br /><br />/*****************************************************************************/<br /><br />static void DoReadFinish (void)<br />{<br />     /* Test the ability to create the file inside a smart object */<br />     /* This flag also tells you which menu item was selected */<br /><br />     // if openAsSmartObject is already true then you cannot turn it off<br />     gFormatRecord->openAsSmartObject = gData->openAsSmartObject;<br />     <br />     // every other time we open as smart, that should be confusing enough for a user!<br />     gData->openAsSmartObject = !gData->openAsSmartObject;<br />     <br />     /* Dispose of the image resource data if it exists. */<br />     DisposeImageResources ();<br />     WriteScriptParamsOnRead (); // should be different for read/write<br />     //AddComment (); // write a history comment<br /><br />}

  • Program units (Package) as global variable

    Hi all,
    Report 10g, generate PDF on the web.
    I need to manage some informations as rowtype.
    So, I defined a program unit as Package Spec VAR and defined v1 tablename%rowtype. When fired the trigger After Parameter Form run a procedure that populate the VAR.v1 and so I can use this information inside the column formula or format trigger without read the table many times.
    I try on client / server and all is ok.
    I try on the web and the package spec not work good. Exist some rule or bug about it?
    I try to move the package on the DB as Stored Procedure and so the report is ok.
    Thank you in advance.

    But in report builder is it possible to use global variable define as rowtype?
    I have some doubts about it.
    About my problem I want add an example to understand better the situation:
    As program unit I defined:
    PACKAGE VAR IS
    vTab0001 tab0001%rowtype;
    END;
    FUNCTION TAB0001_GET (pCom number) RETURN tab0001%rowtype IS
    vTab0001rec tab0001%rowtype;
    BEGIN
    Select *
    into vTab0001rec
    from tab0001
    where t0001soc = pCom;
    return (vTab0001rec);
    Exception when others Then
         return (null);
    END;
    About the After Parameter Form trigger:
    var.vTab0001 := tab0001_get(:company_code);
    With the srw.message(12345, var.vTab0001.t0001soc) check the value in all the report.
    In client/server all it is ok.
    In web I received the error
    REP-0069: Internal error
    REP-57054: In-process job terminated:Terminated with error:
    REP-1418: 'cf_1formula': Passed null arguments to SRW.MESSAGE.
    So, I have the evidence that the var.vTab0001.t0001soc is null.
    Can you help me to find a way?
    Is there someone that had this case in report builder?

  • Output a global variable to RS232 module

    Hello!
    I am new in using DASYLab and I find it very interesting, though I have
    this problem: I want to control the velocity of a stepper motor by
    ajusting the value  of a global variable and send it to the RS232
    output module. The problem is that I dont know the output format of
    this variable. How is the sintax of the output?
    Many thanks
    Miguel Neto

    Attached you can find a "complex" example: The worksheet controls via RS232 a small electric engine. The engine understands three commands with format "<cmd><number>", eg. "F500" (set frequency to 500Hz), "D100" (set duty cycle to 10%), and "V450" (set voltage to 4.5V). That "450" means "4.5V" was hardcoded into the hardware.
    Note how the values from the sliders are send indirectly to the hardware: first, the value is stored in a global variable. The value are now modified "behind the scenes" by calculating a global string (see attached image). If that string content changes, the action modules send that string via RS232 output module to the hardware.
    The calculation of the string is necessary to get rid of the decimals after the comma.
    Rename the file rs232_example._zip to rs232example.zip (remove underscore), because the NI forum is unable to recognize the ZIP file created with 7zip app... :/
    Attachments:
    rs232_example.jpg ‏70 KB
    rs232_example._zip ‏25 KB

  • Setting global variable that are static but I want them to change

    I'm trying to set a global variable so I can let the user change the state in the Plugin Manager.  I've created a checkbox (in PluginManager.lua)
    f:checkbox {
         title = 'Show HTTP response',
         value = _G.showHttpResponse,
    that references the global variable (in PluginInit.lua)
    _G.showHttpResponse = true
    The state of the checkbox accurately reflects the initial value as set.  Everything seems fine but after unchecking the checkbox, the value is always true in my plugin.  I expected _G.showHttpResponse to change to reflect the setting in the checkbox.
    What have I overlooked?  Is this only for setting static globals?
    Abe

    Reading the Lightroom SDK manual seemed to indicate that using globals would be the way to go.  I'm thinking that it is only appropriate for static text.
    I've taken both your suggestions and have used the plugin preferences.  I didn't think you could get and set them in the Plugin Manager but they work just fine.  Now I set my debug flags in the plugin manager screen and they are available to the plugin and are persisted as well.
    Thanks for the suggestion.  Everything is working.

  • Global variable updating

    Problem:
    If you have a book with ten chapters and use a variable as the issue number in the footer of each page, this results in a long and manual process to update it.
    It would save me a lot of time if I could update a variable across all files in a book at the same time.
    Proposed solution:
    At the moment, variables are only managed in individual .fm files, not in the .book file. You could have a Global Variable Update option in the book window which brings up a dialog allowing you to select any open .fm file (much like the Import Formats window). Then you can select a variable from this .fm file and type a new value for it. The variable will then be updated for all .fm files in the book (or created if no such variable exists).

    There is a way to update your single variable definition across your entire book. I'm assuming you want the variable value to be the same in all or in all your selected files as well.
    Requirement: The variable you are updating must be named the same in all your files.
    Potential Pitfall: If you have Running h/f variables defined differently from file to file, the definitions will be overwritten to what the file you are importing from has defined.
    Ok, assuming your variable "issue number" is named the same in all your chapters, make a copy of one of your chapters by saving it out as "importvar.fm" (or whatever).
    Now edit the definition of that user variable to what it needs to be. Do not close the variable palette.
    In the list of user variables, delete all other user variables, but leave "Issue Number" as the only user defined variable in the palette.
    Close the variable palette and save the file.
    Select the files in your book that you want to import to. File>Import>Formats (Alt FIO) and select ONLY "Variable Definitions". Select "Import".
    Done. In addition to your request for an update to the program, I would like the ability to deselect the system variables from a "Variable Definitions" Import.

Maybe you are looking for

  • Trouble connecting MacBook to HDTV. SOS!!!!

    In terms of connecting an original MacBook to an HDTV, will a miniDVI (not miniDigitalPort) to VGA adapter do the trick and send the video signal. I am hearing some confusion about analog and digital signals crisscrossing and I know nothing about eit

  • PDF data truncated

    Hi All, I am trying to convert the Spool data to PDF and sending it as email. The email has sent sucessfully, but the problem here is the data is getting truncated. But in spool I can see all the fields displayed. Where as in PDF some fields are gett

  • Submit job in background

    Hi All I have a program with selection screen. The selection screen has Job name as one of the parameters. When I press F8 (Execute), this program should get scheduled in the background with the job name taken from selection screen. How to submit a p

  • Windows 8 won't install on my dc110

    I'm struggling to install Windiws 8 on my DC110. When I run the installer it tells me I need to locate a missing media driver. I'm installing it off a bootable sd card I made using winusb. Has anybody else suffered thus problem?

  • CS6 web design premium trial install error

    after finally able to direct download and install the cs6 web design premium, i received the following warning: Exit Code: 6 Please see specific errors and warnings below for troubleshooting. For example,  ERROR: DW050 ... WARNING: DF029, DS013 ... -