Help me debug this JNI Code

Hi all i've got this third party DLL with a source code downloaded
and this JNI method has a memory leak problem. The hard part is i can't
seem to find it resources seem to be properly released. This code is
kind of long any suggestions are welcomed.
JNIEXPORT jobject JNICALL Java_ca_beq_util_win32_registry_RegistryKey_getValue(JNIEnv *env, jobject obj, jstring name) {
// get the root key (RootKey) from the RegistryKey (this.getRootKey.getValue())
int nRootKey = getRootKey(env, obj);
// get the path (String) from the RegistryKey (this.getPath())
// get reference to RegistryKey class
jclass CRegistryKey = env->GetObjectClass(obj);
// get field ID of path string
jfieldID fid_path = env->GetFieldID(CRegistryKey, "path", fieldDescriptor::jfd_String);
if(fid_path == NULL) { return NULL; }
// get reference to path string
jstring path = (jstring)env->GetObjectField(obj, fid_path);
if(path == NULL) { return NULL; }
// convert to native string
const char *szPath = env->GetStringUTFChars(path, NULL);
if(szPath == NULL) { return NULL; }
// open registry key for reading
HKEY hkey;
if(RegOpenKeyEx((HKEY)nRootKey, szPath, 0, KEY_READ, &hkey) != ERROR_SUCCESS) {
env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Error opening registry key");
env->ReleaseStringUTFChars(path, szPath);
return NULL;
} // if
else {
const char *szName = env->GetStringUTFChars(name, NULL);
// find the type and size of the value
DWORD type;
DWORD size;
if(RegQueryValueEx(hkey, szName, NULL, &type, (LPBYTE)NULL, &size) != ERROR_SUCCESS) {
env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Error retreiving registry value");
RegCloseKey(hkey);
env->ReleaseStringUTFChars(name, szName);
return NULL;
} // if
// get memory to hold the value
char data = (char)malloc(size);
// read the value
if(RegQueryValueEx(hkey, szName, NULL, &type, (LPBYTE)data, &size) != ERROR_SUCCESS) {
env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Error retreiving registry value");
free(data);
RegCloseKey(hkey);
env->ReleaseStringUTFChars(name, szName);
return NULL;
} // if
RegCloseKey(hkey);
env->ReleaseStringUTFChars(name, szName);
char* szField; // set to string version of registry type
jobject dataValue; // data to be passed in RegistryValue.setData()
jclass CInteger; // java.lang.Integer for DWORD base types
jmethodID mid_IntegerConstructor; // java.lang.Integer.Integer(int) for DWORD base types
char *tmp;                          // buffer, used when expanding REG_EXPAND_SZ types
DWORD required; // buffer size, used when expanding REG_EXPAND_SZ types
// convert the registry data to a Java type
switch(type) {
// raw, unformatted, binary data
case REG_NONE:
case REG_BINARY:
if(type == REG_NONE) {
szField = "REG_NONE";
} // if
else {
szField = "REG_BINARY";
} // else
dataValue = env->NewByteArray(size);
if(dataValue == NULL) { return NULL; }
env->SetByteArrayRegion((jbyteArray)dataValue, 0, size, (signed char*)data);
break;
// integer/long values
case REG_DWORD:
case REG_DWORD_BIG_ENDIAN:
if(type == REG_DWORD) {
szField = "REG_DWORD";
} // if
else {
szField = "REG_DWORD_BIG_ENDIAN";
} // else
CInteger = env->FindClass(classDescriptor::jcd_Integer);
if(CInteger == NULL) { return NULL; }
mid_IntegerConstructor = env->GetMethodID(CInteger, "<init>", "(I)V");
if(mid_IntegerConstructor == NULL) { return NULL; }
dataValue = env->NewObject(CInteger, mid_IntegerConstructor, *(long*)data);
               env->DeleteLocalRef((jobject)CInteger);
break;
// string values
case REG_SZ:
szField = "REG_SZ";
dataValue = env->NewStringUTF(data);
break;
// expanded environment variable values
case REG_EXPAND_SZ:
szField = "REG_EXPAND_SZ";
// determine required size
required = ExpandEnvironmentStrings(data, NULL, 0);
tmp = (char*)malloc(required);
// expand the strings
if(!ExpandEnvironmentStrings(data, tmp, required)) {
env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Error expanding registry strings");
} // if
dataValue = env->NewStringUTF(tmp);
          //     free(tmp); // gonx
          //     free((jobject)required);// gonx
break;
// string arrays (unsupported)
case REG_MULTI_SZ:
szField = "REG_MULTI_SZ";
env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Unsupported data type");
break;
// everything else (nothing)
default:
env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Unsupported data type");
break;
} // switch
// look up ValueType class
jclass CValueType = env->FindClass(registryDescriptor::jcd_ValueType);
if(CValueType == NULL) { return NULL; }
// get the appropriate ValueType
jfieldID fid_type = env->GetStaticFieldID(CValueType, szField, registryDescriptor::jfd_ValueType);
if(fid_type == NULL) { return NULL; }
jobject typeValue = env->GetStaticObjectField(CValueType, fid_type);
// create a new RegistryValue object:
// get RegistryValue class definition
jclass CRegistryValue = env->FindClass(registryDescriptor::jcd_RegistryValue);
if(CRegistryValue == NULL) { return NULL; }
// use default constructor to create new RegistryValue
jmethodID mid_Constructor = env->GetMethodID(CRegistryValue, "<init>", "()V");
if(mid_Constructor == NULL) { return NULL; }
jobject registryValue = env->NewObject(CRegistryValue, mid_Constructor);
// use RegistryValue.setName() to set the name
jmethodID mid_setName = env->GetMethodID(CRegistryValue, "setName", "(Ljava/lang/String;)V");
if(mid_setName == NULL) { return NULL; }
env->CallObjectMethod(registryValue, mid_setName, name);
// use RegistryValue.setType() to set the type
jmethodID mid_setType = env->GetMethodID(CRegistryValue, "setType", "(Lca/beq/util/win32/registry/ValueType;)V");
if(mid_setType == NULL) { return NULL; }
env->CallObjectMethod(registryValue, mid_setType, typeValue);
// use RegistryValue.setData() to set the data
jmethodID mid_setData = env->GetMethodID(CRegistryValue, "setData", "(Ljava/lang/Object;)V");
if(mid_setData == NULL) { return NULL; }
env->CallObjectMethod(registryValue, mid_setData, dataValue);
return registryValue;
} // else

First thing I would do is post the code in a formatted code block. :)
JNIEXPORT jobject JNICALL Java_ca_beq_util_win32_registry_RegistryKey_getValue(JNIEnv *env, jobject obj, jstring name) {
    // get the root key (RootKey) from the RegistryKey (this.getRootKey.getValue())
    int nRootKey = getRootKey(env, obj);
    // get the path (String) from the RegistryKey (this.getPath())
    // get reference to RegistryKey class
    jclass CRegistryKey = env->GetObjectClass(obj);
    // get field ID of path string
    jfieldID fid_path = env->GetFieldID(CRegistryKey, "path", fieldDescriptor::jfd_String);
    if (fid_path == NULL) {
        return NULL;
    // get reference to path string
    jstring path = (jstring)env->GetObjectField(obj, fid_path);
    if (path == NULL) {
        return NULL;
    // convert to native string
    const char *szPath = env->GetStringUTFChars(path, NULL);
    if (szPath == NULL) {
        return NULL;
    // open registry key for reading
    HKEY hkey;
    if (RegOpenKeyEx((HKEY)nRootKey, szPath, 0, KEY_READ, &hkey) != ERROR_SUCCESS) {
        env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Error opening registry key");
        env->ReleaseStringUTFChars(path, szPath);
        return NULL;
    } // if
    else {
        const char *szName = env->GetStringUTFChars(name, NULL);
        // find the type and size of the value
        DWORD type;
        DWORD size;
        if (RegQueryValueEx(hkey, szName, NULL, &type, (LPBYTE)NULL, &size) != ERROR_SUCCESS) {
            env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Error retreiving registry value");
            RegCloseKey(hkey);
            env->ReleaseStringUTFChars(name, szName);
            return NULL;
        } // if
        // get memory to hold the value
        char *data = (char*)malloc(size);
        // read the value
        if (RegQueryValueEx(hkey, szName, NULL, &type, (LPBYTE)data, &size) != ERROR_SUCCESS) {
            env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Error retreiving registry value");
            free(data);
            RegCloseKey(hkey);
            env->ReleaseStringUTFChars(name, szName);
            return NULL;
        } // if
        RegCloseKey(hkey);
        env->ReleaseStringUTFChars(name, szName);
        char* szField; // set to string version of registry type
        jobject dataValue; // data to be passed in RegistryValue.setData()
        jclass CInteger; // java.lang.Integer for DWORD base types
        jmethodID mid_IntegerConstructor; // java.lang.Integer.Integer(int) for DWORD base types
        char *tmp; // buffer, used when expanding REG_EXPAND_SZ types
        DWORD required; // buffer size, used when expanding REG_EXPAND_SZ types
        // convert the registry data to a Java type
        switch (type) {
        // raw, unformatted, binary data
        case REG_NONE:
        case REG_BINARY:
            if (type == REG_NONE) {
                szField = "REG_NONE";
            } // if
            else {
                szField = "REG_BINARY";
            } // else
            dataValue = env->NewByteArray(size);
            if (dataValue == NULL) {
                return NULL;
            env->SetByteArrayRegion((jbyteArray)dataValue, 0, size, (signed char*)data);
            break;
            // integer/long values
        case REG_DWORD:
        case REG_DWORD_BIG_ENDIAN:
            if (type == REG_DWORD) {
                szField = "REG_DWORD";
            } // if
            else {
                szField = "REG_DWORD_BIG_ENDIAN";
            } // else
            CInteger = env->FindClass(classDescriptor::jcd_Integer);
            if (CInteger == NULL) {
                return NULL;
            mid_IntegerConstructor = env->GetMethodID(CInteger, "<init>", "(I)V");
            if (mid_IntegerConstructor == NULL) {
                return NULL;
            dataValue = env->NewObject(CInteger, mid_IntegerConstructor, *(long*)data);
            env->DeleteLocalRef((jobject)CInteger);
            break;
            // string values
        case REG_SZ:
            szField = "REG_SZ";
            dataValue = env->NewStringUTF(data);
            break;
            // expanded environment variable values
        case REG_EXPAND_SZ:
            szField = "REG_EXPAND_SZ";
            // determine required size
            required = ExpandEnvironmentStrings(data, NULL, 0);
            tmp = (char*)malloc(required);
            // expand the strings
            if (!ExpandEnvironmentStrings(data, tmp, required)) {
                env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Error expanding registry strings");
            } // if
            dataValue = env->NewStringUTF(tmp);
            // free(tmp); // gonx
            // free((jobject)required);// gonx
            break;
            // string arrays (unsupported)
        case REG_MULTI_SZ:
            szField = "REG_MULTI_SZ";
            env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Unsupported data type");
            break;
            // everything else (nothing)
        default:
            env->ThrowNew(env->FindClass(registryDescriptor::jcd_RegistryException), "Unsupported data type");
            break;
        } // switch
        // look up ValueType class
        jclass CValueType = env->FindClass(registryDescriptor::jcd_ValueType);
        if (CValueType == NULL) {
            return NULL;
        // get the appropriate ValueType
        jfieldID fid_type = env->GetStaticFieldID(CValueType, szField, registryDescriptor::jfd_ValueType);
        if (fid_type == NULL) {
            return NULL;
        jobject typeValue = env->GetStaticObjectField(CValueType, fid_type);
        // create a new RegistryValue object:
        // get RegistryValue class definition
        jclass CRegistryValue = env->FindClass(registryDescriptor::jcd_RegistryValue);
        if (CRegistryValue == NULL) {
            return NULL;
        // use default constructor to create new RegistryValue
        jmethodID mid_Constructor = env->GetMethodID(CRegistryValue, "<init>", "()V");
        if (mid_Constructor == NULL) {
            return NULL;
        jobject registryValue = env->NewObject(CRegistryValue, mid_Constructor);
        // use RegistryValue.setName() to set the name
        jmethodID mid_setName = env->GetMethodID(CRegistryValue, "setName", "(Ljava/lang/String;)V");
        if (mid_setName == NULL) {
            return NULL;
        env->CallObjectMethod(registryValue, mid_setName, name);
        // use RegistryValue.setType() to set the type
        jmethodID mid_setType = env->GetMethodID(CRegistryValue, "setType", "(Lca/beq/util/win32/registry/ValueType;)V");
        if (mid_setType == NULL) {
            return NULL;
        env->CallObjectMethod(registryValue, mid_setType, typeValue);
        // use RegistryValue.setData() to set the data
        jmethodID mid_setData = env->GetMethodID(CRegistryValue, "setData", "(Ljava/lang/Object;)V");
        if (mid_setData == NULL) {
            return NULL;
        env->CallObjectMethod(registryValue, mid_setData, dataValue);
        return registryValue;
    } // else
}

Similar Messages

  • Need some help in debugging this exported script

    Below is DDL generated by visio forward engineering tool . The example below consists of 2 test tables with one foreign key.
    Forward engineering generated DDL script
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table1]') AND type in (N'U'))
    DROP TABLE [dbo].[Table1]
    GO
    CREATE TABLE [dbo].[Table1] (
    [test] CHAR(10) NOT NULL
    , [test2] CHAR(10) NULL
    GO
    ALTER TABLE [dbo].[Table1] ADD CONSTRAINT [Table1_PK] PRIMARY KEY CLUSTERED (
    [test]
    GO
    GO
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table2]') AND type in (N'U'))
    DROP TABLE [dbo].[Table2]
    GO
    CREATE TABLE [dbo].[Table2] (
    [test2] CHAR(10) NOT NULL
    GO
    ALTER TABLE [dbo].[Table2] ADD CONSTRAINT [Table2_PK] PRIMARY KEY CLUSTERED (
    [test2]
    GO
    GO
    ALTER TABLE [dbo].[Table1] WITH CHECK ADD CONSTRAINT [Table2_Table1_FK1] FOREIGN KEY (
    [test2]
    REFERENCES [dbo].[Table2] (
    [test2]
    GO
    GO
    When i converted this DDL script using scratch editor the migration tool gave some errors can anyone help me to resolve below
    DECLARE
    v_temp NUMBER(1, 0) := 0;
    BEGIN
    BEGIN
    SELECT 1 INTO v_temp
    FROM DUAL
    WHERE EXISTS ( SELECT *
    FROM objects
    WHERE OBJECT_ID_ = NULL/*TODO:OBJECT_ID(N'[OPS].[Table1]')*/
    AND TYPE IN ( N'U' )
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    IF v_temp = 1 THEN
    TRUNCATE TABLE Table1;
    END IF;
    END;
    CREATE TABLE Table1
    test CHAR(10) NOT NULL,
    test2 CHAR(10)
    ALTER TABLE Table1
    ADD
    CONSTRAINT Table1_PK PRIMARY KEY( test );
    --SQLDEV:Following Line Not Recognized
    DECLARE
    v_temp NUMBER(1, 0) := 0;
    BEGIN
    BEGIN
    SELECT 1 INTO v_temp
    FROM DUAL
    WHERE EXISTS ( SELECT *
    FROM objects
    WHERE OBJECT_ID_ = NULL/*TODO:OBJECT_ID(N'[OPS].[Table2]')*/
    AND TYPE IN ( N'U' )
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    IF v_temp = 1 THEN
    TRUNCATE TABLE Table2;
    END IF;
    END;
    CREATE TABLE Table2
    test2 CHAR(10) NOT NULL
    ALTER TABLE Table2
    ADD
    CONSTRAINT Table2_PK PRIMARY KEY( test2 );
    --SQLDEV:Following Line Not Recognized
    ALTER TABLE Table1
    ADD
    CONSTRAINT Table2_Table1_FK1 FOREIGN KEY( test2 ) REFERENCES Table2 (test2)
    --SQLDEV:Following Line Not Recognized
    ;

    Pl do not post duplicates - Need some help in debugging this script

  • Please help me transform this C++ code to java code....

    guys...please help me transform this C++ code to java code....please try to explain the code..thanks
    [program]
    #include <stdio.h>
    #define ALIVE 1
    #define DEAD 0
    #define SZ 33
    int stschk (int ,int );
    main()
    int s[SZ][SZ], i, j;
    for (i=0; i<sz; i++ ) s[0] = DEAD;
    for (j=0; j<sz; j++ ) s[0][j] = DEAD;
    s[0][1] = ALIVE;
    for (i=0; i<sz-1; i++) {
    for ( j=1;j<sz;j++ ) {
    s[i][j] = stschk(s[i][j-1],s[i+1][j];
    if(s[i][j-1]==ALIVE) printf("*");
    else printf(" ");
    printf("\n");
    int stschk(int s1,int s2)
    if(((s1==DEAD)&&(s2==ALIVE))||
    ((s1==ALIVE)&&(s2==DEAD))) return ALIVE;
    else return DEAD;

    Being picky, that's not C++, that's C. Standard headers in C++ dont' have .h after them, loop variables are scoped with the for, you use constants rather than #defines, etc..
    C and C++ both don't initialise arrays by default; you'd have to write an initialiser to get it to zero out the array:
        int s[sz][sz] = {};gcc will insert a call to memset to zero the array.
    If the author was assuming that the array was zeroed out, there would be no point zeroing the first row and column.
    The code reads values which haven't been initialised. If you mark such values explicitly undefined, and change the program to report an error when undefined, then you get several cases where the program makes such report.
    So either it' s a primitive random number generator (some random number generators use uninitialised memory as a source of randomness), or it's buggy, or it's processing undefined data and throwing away the result. Either way, it cannot be directly be ported to Java if the undefined values (which are limited to a small area of the ouput) are significant.

  • Please! help me with this wrong code, where is mistake

    please! help me with this wrong code, where is mistake?
    import java.util.Stack;
    public class KnightsTour {
    Vars locs[];
    private int size, max=1, d=0, board[][];
    public KnightsTour(int x,int y, int newSize)
         size=newSize;
         locs=new Vars[size*size+1];
         for(int n=1;n<=size*size;n++)
              locs[n]=new Vars();
         board=new int[size+1][size+1];
         for(int n=1;n<=size;n++)
              for(int n2=1;n2<=size;n2++)
                   board[n][n2]=0;
         locs[max].x=x;
         locs[max].y=y;
         locs[max].d=1;
         board[x][y]=max;
         max++;
    class Vars{
         int x;
         int y;
         int d;
    public void GO()
         int n=0;
         while(max<=size*size)
              n++;
              d++;
              if(d>8)
                   max--;
                   board[locs[max].x][locs[max].y]=0;
                   d=locs[max].d+1;
              move();
         printBoard();
    public void move()
         int x=locs[max-1].x, y=locs[max-1].y;
         switch(d)
         case 1:x--;y-=2;break;
         case 2:x++;y-=2;break;
         case 3:x+=2;y--;break;
         case 4:x+=2;y++;break;
         case 5:x++;y+=2;break;
         case 6:x--;y+=2;break;
         case 7:x-=2;y++;break;
         case 8:x-=2;y--;break;
         //System.out.println(" X: "+x+" Y: "+y+" |"+max);
         if((x<1)||(x>size)||(y<1)||(y>size)){}
         else if(board[x][y]!=0){}
         else
              locs[max].x=x;
              locs[max].y=y;
              locs[max].d=d;
              board[x][y]=max;
              max++;
              d=0;
              //printBoard();
    public void printBoard()
         for(int n=1;n<=size;n++)
              for(int n2=1;n2<=size;n2++)
                   if(board[n2][n]<10)
                        System.out.print(board[n2][n]+" ");
                   else
                        System.out.print(board[n2][n]+" ");
              System.out.println();
         //System.out.println();
         System.out.println();
         public static void main (String[]args){
              KnightsTour k = new KnightsTour(1,1,8);
         }

    public class KnightsTour {
        Vars locs[];
        private int size,  max = 1,  d = 0,  board[][];
        public static void main (String[] args) {
            KnightsTour k = new KnightsTour (1, 1, 8);
            k.GO ();
        public KnightsTour (int x, int y, int newSize) {
            size = newSize;
            locs = new Vars[size * size + 1];
            for (int n = 1; n <= size * size; n++) {
                locs[n] = new Vars ();
            board = new int[size + 1][size + 1];
            for (int n = 1; n <= size; n++) {
                for (int n2 = 1; n2 <= size; n2++) {
                    board[n][n2] = 0;
            locs[max].x = x;
            locs[max].y = y;
            locs[max].d = 1;
            board[x][y] = max;
            max++;
        class Vars {
            int x;
            int y;
            int d;
        public void GO () {
            int n = 0;
            while (max <= size * size) {
                n++;
                d++;
                if (d > 8) {
                    max--;
                    board[locs[max].x][locs[max].y] = 0;
                    d = locs[max].d + 1;
                move ();
            printBoard ();
        public void move () {
            int x = locs[max - 1].x, y = locs[max - 1].y;
            switch (d) {
                case 1:
                    x--;
                    y -= 2;
                    break;
                case 2:
                    x++;
                    y -= 2;
                    break;
                case 3:
                    x += 2;
                    y--;
                    break;
                case 4:
                    x += 2;
                    y++;
                    break;
                case 5:
                    x++;
                    y += 2;
                    break;
                case 6:
                    x--;
                    y += 2;
                    break;
                case 7:
                    x -= 2;
                    y++;
                    break;
                case 8:
                    x -= 2;
                    y--;
                    break;
    //System.out.println(" X: "x" Y: "y" |"+max);
            if ((x < 1) || (x > size) || (y < 1) || (y > size)) {
            } else if (board[x][y] != 0) {
            } else {
                locs[max].x = x;
                locs[max].y = y;
                locs[max].d = d;
                board[x][y] = max;
                max++;
                d = 0;
    //printBoard();
        public void printBoard () {
            for (int n = 1; n <= size; n++) {
                for (int n2 = 1; n2 <= size; n2++) {
                    if (board[n2][n] < 10) {
                        System.out.print (board[n2][n] + " ");
                    } else {
                        System.out.print (board[n2][n] + " ");
                System.out.println ();
    //System.out.println();
            System.out.println ();
    }formatting ftw.
    If you call GO () you get in an infinite loop. max gets decreased, and it loops while max is smaller then or equal to size * size. Is your looping logic correct ?

  • How to manage the memory within this JNI code

    This is a piece of JNI code that i had written..........
    i am calling these methods in a infinite loop to listen for changes......
    if a change has occured it shpuld get changed. other wise not....
    But the memory is allocated 4 bytes every second.... even if the user doesnt makes a change....... ( memory increases with TIME....... )
    How to get rid of this problem
    Please Help!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    #include <jni.h>
    #include "ParameterClass.h"
    #include <stdio.h>
    #include <scrpcdll.h>
    const char *NetAddr = "";
    const char *str = NULL;
    int sp= 0;
    double value= 0;
    jsize doubleLen = 0;
    jsize strLen = 0;
    int val=0;
    int i= 0 ;
    jdouble *body = NULL;
    const char *name = NULL;
    jstring *string = NULL;
    const char *tableStr = NULL;
    int sp1 = 0;
    double value1 = 0;
    JNIEXPORT jdouble JNICALL
    Java_ParameterClass_IdentificationValue(JNIEnv *env, jobject obj,jstring parameterName,jdouble parameterValue)
         if(SC_ConnectToSoftcar(NetAddr))
              str = (*env)->GetStringUTFChars(env,parameterName,NULL);
              sp = SC_AddVari(str, 6, "M");
              SC_Set(sp,parameterValue);
              (*env)->ReleaseStringUTFChars(env,parameterName,str);
              (*env)->ReleaseStringUTFChars(env,parameterName,NULL);
              value = SC_Get(sp);
         (*env)->DeleteLocalRef(env,parameterName);
         return value;
    JNIEXPORT void JNICALL
    Java_ParameterClass_OnlineValue(JNIEnv *env1,jobject obj1,jobjectArray str,jdoubleArray doArr)
         if(SC_ConnectToSoftcar(NetAddr))
              doubleLen = (*env1)->GetArrayLength(env1, doArr);
              strLen = (*env1)->GetArrayLength(env1,str);
              body = (*env1)->GetDoubleArrayElements(env1,doArr,NULL);
              for(i = 0; i < doubleLen; i++)
                   *string = (jstring)(*env1)->GetObjectArrayElement(env1,str,i);
                   name = (*env1)->GetStringUTFChars(env1,*string,NULL);
                   val = SC_AddVari(name, 6, "revs");
                   SC_Set(val,body);
                   (*env1)->ReleaseStringUTFChars(env1,*string,name);
                   (*env1)->ReleaseStringUTFChars(env1,*string,NULL);
              (*env1)->ReleaseDoubleArrayElements(env1,doArr,body,0);
              (*env1)->DeleteLocalRef(env1, *string);
         SC_DisconnectFromSoftcar();
         return;

    Hai,
    Thanks for your comments.......
    In Java i call the JNI methods inside a Infinite loop...
    when i comment this Infinite loop then the memory doesnt Increase at all.....
    but i cannot comment since i need a functionality to execute through JNI.....
    so if i uncomment this Infinte loop then i get a Probelm.........
    This is the JAVA CODE which calls JNI CODE:::::::::::::::::::::
    while(loopForever)
         streamWrite();
         System.gc();
    public void streamWrite()
    // Getting the Parameter Value from the Softcar
         for(i = 0; i < newparameterArray.length; i++)
              newparameterArray[i] = valueClass.returnIdentificationValue(prefix+parent.parameterName);
              System.gc();
    /*Checking the Array of values: Checking which value of the Array has changed in Softcar      Checking for the Elements of the Array which had been changed by the User if the change is made then Updating to the ASAP-3 Server.........*/
         if(Arrays.equals(parameterArray,newparameterArray) == true)
              for(i = 0; i < newparameterArray.length; i++)
              newparameterArray[i] = valueClass.returnIdentificationValue(prefix+parent.parameterName[i]);
              System.gc();
         else{
              for(i = 0; i < newparameterArray.length; i++)
                   if(parameterArray[i] != newparameterArray[i])
                        parameterArray[i] = newparameterArray[i];
                             parent.commandparameters.setapsparameters.parameterField.setText(parent.parameterName[i]);
                             parent.commandparameters.setapsparameters.parameterValueField.setText(Double.toString(newparameterArray[i]));
              try{
                   bos.write((byte[])parent.commandparameters.setapsparameters.setParameterArray());
                   bos.flush();
                   Thread.sleep(500);
                   readfromStream();
                   serverResponse();
              }catch(IOException exception){System.err.println(" Write Stream Exception" + exception.getMessage());}
              catch(InterruptedException ie){System.err.println(ie.getMessage());};
              //parameterArray[i] = newparameterArray[i];
              System.gc();
    //Getting the TableValue from Softcar.......
              for(j = 0; j < Integer.parseInt(parent.xDimension); j++)
                   newtableValueArray[j] = valueClass.returngetTableValue(arrayString[j]);
                   System.gc();
    //Comparing the Values ( whether the user has chaged the TableValue )
              if(Arrays.equals(tableValueArray,newtableValueArray) == true)
                   for(j = 0; j < newtableValueArray.length; j++)
                        newtableValueArray[j] = valueClass.returngetTableValue(arrayString[j]);
                        System.gc();
              else
                   for(j = 0; j < newtableValueArray.length; j++)
                        if((tableValueArray[j] != newtableValueArray[j]))
                             tableValueArray[j] = newtableValueArray[j];
                             parent.commandparameters.setlookupparameters.yindexField.setText(parent.yDimension);
                             parent.commandparameters.setlookupparameters.xindexField.setText(Integer.toString(j+1));
                             parent.commandparameters.setlookupparameters.valueField.setText(Double.toString(newtableValueArray[j]));
                             try{
                                  bos.write((byte[])parent.commandparameters.setlookupparameters.setlookupArray());
                                  bos.flush();
                                  Thread.sleep(500);
                                  readfromStream();
                                  serverResponse();
                             }catch(IOException exception){System.err.println(" Write Stream Exception" + exception.getMessage());}
                             catch(InterruptedException ie){System.err.println(ie.getMessage());};
                             System.gc();

  • Please help me debug this program unit!!!!!

    dear sir,
    i tried diligently to find and to debug this tiny program unit,although my observation to the coding rules of the packages ,compilation error still occur.
    therefore,kindly i'm asking you sir to learn me how to correct it.
    thank you.
    create or replace package test_pack is
    type emp_table_type is table of emp.sal%type
    index by binary_integer;
    emp_list emp_table_type;
    function test_sal
    (v_sal in emp.sal%type)
    return emp_table_type;
    end test_pack;
    create or replace package body test_pack is
    temp emp.sal%type;
    cursor emp_cursor is
    select sal from emp;
    i number :=1;
    j number :=1;
    function test_sal
    (v_sal in emp.sal%type)
    return emp_table_type
    is
    open emp_cursor;
    loop
    fetch emp_cursor into temp;
    if temp < v_sal then
    emp_list(i):=temp;
    bms_output.put_line('rowcount i='||emp_cursor%rowcount);
    dbms_output.put_line('iterator i='||i);
    i:=i+1;
    else
    dbms_output.put_line('rowcount j='||emp_cursor%rowcount);
    dbms_output.put_line('iterator j='||j);
    j:=j+1;
    end if;
    if emp_cursor%notfound then
    dbms_output.put_line('cursor closed...');
    close emp_cursor;
    return emp_list;
    exit;
    end if;
    end loop;
    end test_pack;

    You can use "show err" to show the errors after compilation errors occur:
    SQL> create or replace package test_pack is
      2    type emp_table_type is table of emp.sal%type index by binary_integer;
      3    emp_list emp_table_type;
      4    function test_sal(v_sal in emp.sal%type) return emp_table_type;
      5  end test_pack;
      6  /
    Package is aangemaakt.
    SQL> create or replace package body test_pack is
      2    temp emp.sal%type;
      3    cursor emp_cursor is
      4    select sal from emp;
      5    i number :=1;
      6    j number :=1;
      7
      8    function test_sal
      9    (v_sal in emp.sal%type)
    10    return emp_table_type
    11    is
    12      open emp_cursor;
    13      loop
    14        fetch emp_cursor into temp;
    15        if temp < v_sal then
    16          emp_list(i):=temp;
    17          bms_output.put_line('rowcount i='||emp_cursor%rowcount);
    18          dbms_output.put_line('iterator i='||i);
    19          i:=i+1;
    20        else
    21          dbms_output.put_line('rowcount j='||emp_cursor%rowcount);
    22          dbms_output.put_line('iterator j='||j);
    23          j:=j+1;
    24        end if;
    25        if emp_cursor%notfound then
    26          dbms_output.put_line('cursor closed...');
    27          close emp_cursor;
    28          return emp_list;
    29          exit;
    30        end if;
    31      end loop;
    32  end test_pack;
    33  /
    Waarschuwing: package-body is aangemaakt met compilatiefouten.
    SQL> show err
    Fouten voor PACKAGE BODY TEST_PACK:
    LINE/COL ERROR
    14/7     PLS-00103: Symbool "FETCH" aangetroffen terwijl een van de
             volgende werd verwacht:
             constant exception <een ID>
             <een scheidingsteken-ID tussen dubbele aanhalingstekens>
             table LONG_ double ref char time timestamp interval date
             binary national character nchar
    32/5     PLS-00103: Symbool "TEST_PACK" aangetroffen terwijl een van de
             volgende werd verwacht:
             ;To make your program compile, add a begin and end and fix the typo (in bold):
    SQL> create or replace package body test_pack is
      2    temp emp.sal%type;
      3    cursor emp_cursor is
      4    select sal from emp;
      5    i number :=1;
      6    j number :=1;
      7
      8    function test_sal
      9    (v_sal in emp.sal%type)
    10    return emp_table_type
    11    is
    12    begin
    13      open emp_cursor;
    14      loop
    15        fetch emp_cursor into temp;
    16        if temp < v_sal then
    17          emp_list(i):=temp;
    18          dbms_output.put_line('rowcount i='||emp_cursor%rowcount);
    19          dbms_output.put_line('iterator i='||i);
    20          i:=i+1;
    21        else
    22          dbms_output.put_line('rowcount j='||emp_cursor%rowcount);
    23          dbms_output.put_line('iterator j='||j);
    24          j:=j+1;
    25        end if;
    26        if emp_cursor%notfound then
    27          dbms_output.put_line('cursor closed...');
    28          close emp_cursor;
    29          return emp_list;
    30          exit;
    31        end if;
    32      end loop;
    33    end;
    34  end test_pack;
    35  /
    Package-body is aangemaakt.
    SQL> declare
      2    t test_pack.emp_table_type;
      3  begin
      4    t := test_pack.test_sal(2000);
      5    for i in 1..t.count
      6    loop
      7      dbms_output.put_line(t(i));
      8    end loop;
      9  end;
    10  /
    rowcount i=1
    iterator i=1
    rowcount i=2
    iterator i=2
    rowcount i=3
    iterator i=3
    rowcount j=4
    iterator j=1
    rowcount i=5
    iterator i=4
    rowcount j=6
    iterator j=2
    rowcount j=7
    iterator j=3
    rowcount j=8
    iterator j=4
    rowcount j=9
    iterator j=5
    rowcount i=10
    iterator i=5
    rowcount i=11
    iterator i=6
    rowcount i=12
    iterator i=7
    rowcount j=13
    iterator j=6
    rowcount i=14
    iterator i=8
    rowcount i=14
    iterator i=9
    cursor closed...
    800
    1600
    1250
    1250
    1500
    1100
    950
    1300
    1300
    PL/SQL-procedure is geslaagd.To fix the bug of the last iteration and put the variables in the sections they belong:
    SQL> create or replace package test_pack is
      2    type emp_table_type is table of emp.sal%type index by binary_integer;
      3    function test_sal(v_sal in emp.sal%type) return emp_table_type;
      4  end test_pack;
      5  /
    Package is aangemaakt.
    SQL> create or replace package body test_pack
      2  is
      3    function test_sal(v_sal in emp.sal%type) return emp_table_type
      4    is
      5      emp_list emp_table_type;
      6      temp emp.sal%type;
      7      cursor emp_cursor is select sal from emp;
      8      i number :=1;
      9      j number :=1;
    10    begin
    11      open emp_cursor;
    12      loop
    13        fetch emp_cursor into temp;
    14        if emp_cursor%notfound then
    15          dbms_output.put_line('cursor closed...');
    16          exit;
    17        end if;
    18        if temp < v_sal then
    19          emp_list(i):=temp;
    20          dbms_output.put_line('rowcount i='||emp_cursor%rowcount);
    21          dbms_output.put_line('iterator i='||i);
    22          i:=i+1;
    23        else
    24          dbms_output.put_line('rowcount j='||emp_cursor%rowcount);
    25          dbms_output.put_line('iterator j='||j);
    26          j:=j+1;
    27        end if;
    28      end loop;
    29      close emp_cursor;
    30      return emp_list;
    31    end;
    32  end test_pack;
    33  /
    Package-body is aangemaakt.
    SQL> declare
      2    t test_pack.emp_table_type;
      3  begin
      4    t := test_pack.test_sal(2000);
      5    for i in 1..t.count
      6    loop
      7      dbms_output.put_line(t(i));
      8    end loop;
      9  end;
    10  /
    rowcount i=1
    iterator i=1
    rowcount i=2
    iterator i=2
    rowcount i=3
    iterator i=3
    rowcount j=4
    iterator j=1
    rowcount i=5
    iterator i=4
    rowcount j=6
    iterator j=2
    rowcount j=7
    iterator j=3
    rowcount j=8
    iterator j=4
    rowcount j=9
    iterator j=5
    rowcount i=10
    iterator i=5
    rowcount i=11
    iterator i=6
    rowcount i=12
    iterator i=7
    rowcount j=13
    iterator j=6
    rowcount i=14
    iterator i=8
    cursor closed...
    800
    1600
    1250
    1250
    1500
    1100
    950
    1300
    PL/SQL-procedure is geslaagd.To be really efficient and not care about looping, using counters and dbms_output, and assuming the emp table won't ever be a big table (else use the LIMIT clause):
    SQL> create or replace package body test_pack
      2  is
      3    function test_sal(v_sal in emp.sal%type) return emp_table_type
      4    is
      5      emp_list emp_table_type;
      6    begin
      7      select sal bulk collect into emp_list
      8        from emp
      9       where sal < v_sal
    10      ;
    11      return emp_list;
    12    end;
    13  end;
    14  /
    Package-body is aangemaakt.
    SQL> declare
      2    t test_pack.emp_table_type;
      3  begin
      4    t := test_pack.test_sal(2000);
      5    for i in 1..t.count
      6    loop
      7      dbms_output.put_line(t(i));
      8    end loop;
      9  end;
    10  /
    800
    1600
    1250
    1250
    1500
    1100
    950
    1300
    PL/SQL-procedure is geslaagd.Hope it helps.
    Regards,
    Rob.

  • Please help me debug this code!

    HELP! I can't figure out where I'm going wrong. Thank you.
    import java.lang.Math.*;
    import java.io.*;
    public class Feature_Recognizer {
         Vertices vertices;   /* storage bin for vertices*/
         Edges edges;         /* storage bin for edges*/
         Faces faces;         /* storage bin for faces*/
         /*** Reads file and stores data into vertices, edges, and faces bins ***/
         void readFile(String file)
              BufferedReader inputFile = null; /*start reading the input file*/
              String[] info;
              String temp;
              /*need to fix io exceptions in java.lang
               * They need to be caught or declared to be thrown*/
              try{
                   inputFile = new BufferedReader(new FileReader(file));
              catch (FileNotFoundException e){
                   System.out.println("File named"+file+"does not exist");
                   return;
              catch (IOException e){
                   System.out.println("IO Exception.  Error reading from:"+file);
                   return;
                  /*begin reading in data array, set into vertices/edges/faces*/                         
                   inputFile.readLine();                                   /* will skip comments in input files*/
                   temp = inputFile.readLine();                            /* store number of vertices*/
                   vertices = new Vertices(Integer.parseInt(temp.trim())); /* initialize the vertices based on data array*/
                   inputFile.readLine();                                   /* will skip comments in input files*/
                   /* store vertices*/
                   int i=0;
                   while(i++<vertices.total)
                        temp = inputFile.readLine();
                        info = temp.split(" ");
                        vertices.addVertex(Double.parseDouble(info[0]),Double.parseDouble(info[1]),Double.parseDouble(info[2]));
                   inputFile.readLine();                             /* will skip comments in input files*/
                   temp = inputFile.readLine();                      /* store number of edges*/
                   edges = new Edges(Integer.parseInt(temp.trim())); /* initialize the edges based on the data array*/
                   inputFile.readLine();                             /* will skip comments in input files*/
                   /* store edges*/
                   int i1=0;
                   while(i1++<edges.total)
                        temp = inputFile.readLine();
                        info = temp.split(" ");
                        edges.addEdge(vertices.getVertex(Integer.parseInt(info[0])),
                             vertices.getVertex(Integer.parseInt(info[1])),
                             Integer.parseInt(info[2]));
                   inputFile.readLine();                             /* will skip comments in input files*/
                   temp = inputFile.readLine();                      /* store number of faces*/
                   faces = new Faces(Integer.parseInt(temp.trim())); /* initialize faces based on the data array*/
                   inputFile.readLine();                             /* will skip comments in input files*/
                   /* store faces*/
                   int i2=0;
                   while(i2++<faces.total)
                        /* input # of edges*/
                        temp = inputFile.readLine();
                        faces.addFace(Integer.parseInt(temp.trim()));
                        /* input faces*/
                        temp = inputFile.readLine();
                        info = temp.split(" ");
                        int j=0;
                        while(j++<faces.getFace(i2).Edge_Totals)
                             if(Integer.parseInt(info[j]) < 0)
                                  faces.getFace(i2).edges.addEdge(edges.getEdge(Math.abs(Integer.parseInt(info[j]))),true);
                             else
                                  faces.getFace(i2).edges.addEdge(edges.getEdge(Math.abs(Integer.parseInt(info[j]))),false);
                        /* input normal vector*/
                        temp = inputFile.readLine();
                        info = temp.split(" ");
                        int j1=0;
                        while(j1++<3)
                             faces.getFace(i2).normal[j1] = Integer.parseInt(info[j1]);
                   /***possibly place another IO exception in here
                   catch (IOException e){
                   System.out.println("IO Exception");
                   return;
         /*** State Classes: edge, face, vertex ***/
         /* Nested Edge object class*/
         class Edge{
                   int identity,           /* identity of edge*/
                        type;               /* concave or convex?*/
                   Vertices vertices;      /* vertices that make up the edge*/
                   Faces faces;            /* faces corresponding to the edge*/
                   double length;          /* length of edge*/
                   /* Edge class constructor*/
                   Edge(int IDENTITY, Vertex A, Vertex B, int TYPE)
                        identity = IDENTITY;
                        vertices = new Vertices(2);
                        vertices.addVertex(A);
                        vertices.addVertex(B);
                        type = TYPE;
                        faces = new Faces(2);
                   /* Length_Calculator will compute the length of edge*/
                 void Length_Calculator()
                        length = Math.pow( (vertices.getVertex(2).x - vertices.getVertex(1).x)*(vertices.getVertex(2).x - vertices.getVertex(1).x)
                                 + (vertices.getVertex(2).y - vertices.getVertex(1).y)*(vertices.getVertex(2).y - vertices.getVertex(1).y)
                                  + (vertices.getVertex(2).z - vertices.getVertex(1).z)*(vertices.getVertex(2).z - vertices.getVertex(1).z)
                                 , .5 );
                   /* getFaces finds the faces which are related to the edge
                   (returns the runtime class of an object)*/
                 void getFaces()
                        int i=1;
                        while( i++ <=Feature_Recognizer.this.faces.total){
                             int j=1;
                             while(     j++<=Feature_Recognizer.this.faces.getFace(i).Edge_Totals){
                                  if(identity == Feature_Recognizer.this.faces.getFace(i).edges.getEdge(j).identity){
                                       faces.addFace(Feature_Recognizer.this.faces.getFace(i));
         /* Edges object class (Edge bin)nested Edges Class*/
         class Edges
                   int index,       /* current index in array*/
                        total;       /* total number of edges*/
                   Edge[] edges;    /* actual edges bin*/
                   boolean[] sign;  /* positive or negative (for face object)*/
                   /* Edges class constructor*/
                   Edges(int Edge_Totals)
                        index = 0;
                        total = Edge_Totals;
                        edges = new Edge[Edge_Totals];
                        sign = new boolean[Edge_Totals];
                   /* method to add an already existing Edge object*/
                   void addEdge(Edge e)
                        edges[index++] = e;
                   /* method to an already existing Edge object*/
                   /* and state if it is negative or positive (for faces only)*/
                   void addEdge(Edge e, boolean isNegative)
                        sign[index] = isNegative;
                        edges[index++] = e;
                   /* method to create and add an Edge object*/
                   void addEdge(Vertex a, Vertex b, int type)
                        edges[index++] = new Edge(index,a,b,type);
                   /* returns the Edge corresponding to its identity*/
                   Edge getEdge(int identity)
                        return edges[identity-1];
                   /* finds the lengths and faces of each Edge in the bin*/
                   void Edge_Stats()
                        int i=0;
                        while(i++<total){
                             edges.Length_Calculator();
                             edges[i].getFaces();
         /* Face object class nested face class*/
         class Face
                   int identity, /* edge identity*/
                        Edge_Totals; /* number of edges that make up the face*/
                   Edges edges; /* edges that make up the face*/
                   int[] normal; /* the vector of the normal to the face*/
                   /* Face class constructor*/
                   Face(int IDENTITY, int numE)
                        identity = IDENTITY;
                        Edge_Totals = numE;
                        edges = new Edges(numE);
                        normal = new int[3];
         /* Faces object class (Face bin)nested faces class*/
         class Faces
                   int index, /* current index in array*/
                        total; /* total number of Faces*/
                   Face[] faces; /* actual faces bin*/
                   /* Faces class constructor*/
                   Faces(int numFaces)
                        index = 0;
                        total = numFaces;
                        faces = new Face[numFaces];
                   /* method to sum an already existing Face object*/
                   void addFace(Face f)
                        faces[index++] = f;
                   /* method to create and sum a Face object*/
                   void addFace(int numE)
                        faces[index++] = new Face(index,numE);
                   /* returns the Face corresponding to its identity*/
                   Face getFace(int identity)
                        return faces[identity-1];
         /* Vertex object class nested vertex class*/
         class Vertex
                   int identity; /* vertex identity*/
                   double x,y,z; /* coordinates*/
                   /* Vertex class constructor*/
                   Vertex(int IDENTITY, double X, double Y, double Z)
                        identity = IDENTITY;
                        x = X;
                        y = Y;
                        z = Z;
              /* Vertices object class (Vertex bin)nested vertices bin*/
         class Vertices
                   int index, /* current index in array*/
                        total; /* total number of vertices*/
                   Vertex[] points; /* actual Vertex bin*/
                   /* Vertices class constructor*/
                   Vertices(int numVertices)
                        index = 0;
                        total = numVertices;
                        points = new Vertex[numVertices];
                   /* method to add an already existing Vertex object*/
                   void addVertex(Vertex v)
                        points[index++] = v;
                   /* method to create and add a Vertex object*/
                   void addVertex(double x, double y, double z)
                        points[index++] = new Vertex(index,x,y,z);
                   /* returns the Vertex corresponding to it's identity*/
                   Vertex getVertex(int identity)
                        return points[identity-1];
    /* displays each edge's type based on data array and the corresponding faces to that edge*/
         void printEdges_Found(){
              String shape;
              System.out.println("Edge\tType\tFaces");
              int i=0;
              while(i++<edges.total){
                   if(edges.getEdge(i).type == 0)
                        shape = "Concave";
                   if(edges.getEdge(i).type == 1)
                        shape = "Convex";
                   else
                        println("Input file must have 0 or 1 for shape type");
                   System.out.println(i + "\t" + shape + "\t" + edges.getEdge(i).faces.getFace(1).identity
                                       + ", " + edges.getEdge(i).faces.getFace(2).identity + "\t");
              System.out.println();
         /* VRML output file maker*/
         void VRML_Output(String file)
              PrintStream outputFile = null;
                   outputFile = new PrintStream(new FileOutputStream(file));
              outputFile.println("#VRML V2.0 utf8");
              outputFile.println("\tShape{");
              outputFile.println("\t\tgeometry IndexedFaceSet{");
              outputFile.println("\t\t\tcoord Coordinate{");
              outputFile.print("\t\t\t\tpoint[  ");
              int i=0;
              while(i++<vertices.total){
                   if(i > 0)
                        if(i%4 == 0) {
                             outputFile.println("\n");
                             outputFile.print("\t\t\t\t\t");
                   outputFile.print(vertices.getVertex(i+1).x + " " + vertices.getVertex(i+1).y
                                       + " " + vertices.getVertex(i+1).z);
                   if(i != vertices.total-1)
                        outputFile.print(",");
              outputFile.println("]");
              outputFile.println("\t\t\t}");
              outputFile.print("\t\t\tcoordIndex[");
              int i3=1;
              while(i3++<=faces.total){
                   int j2=0;
                   while(j2++<faces.getFace(i3).edges.total){
                        if(faces.getFace(i3).edges.sign[j2])
                             outputFile.print(faces.getFace(i3).edges.getEdge(j2+1).vertices.getVertex(1).identity-1 + ", ");
                        else
                             outputFile.print(faces.getFace(i3).edges.getEdge(j2+1).vertices.getVertex(2).identity-1 + ", ");
                   outputFile.println("-1");
                   if(i != faces.total)
                        outputFile.print("\t\t\t\t ");
              outputFile.println("\t\t\t]");
              outputFile.println("\t\t}");
              outputFile.println("\t}");
              outputFile.close();
         /*** feature recognition step:***/
         /* finds the slots*/
         void Slot_Finder()
              int i=1;
                   while(i++<=edges.total){
                   double L=0.0, W=0.0, H=0.0;
                   if(edges.getEdge(i).type == 0) {
                        int vertexID = edges.getEdge(i).vertices.getVertex(1).identity;
                        int j=1;
                        while(j++<=edges.total)
                             if(vertexID == edges.getEdge(j).vertices.getVertex(1).identity || vertexID == edges.getEdge(j).vertices.getVertex(2).identity){
                                  if(edges.getEdge(j).vertices.getVertex(1).z - edges.getEdge(j).vertices.getVertex(2).z != 0)
                                       H = edges.getEdge(j).length;
                                  else
                                       if(edges.getEdge(j).length > L){
                                            W = L;
                                            L = edges.getEdge(j).length;
                                       else
                                            W = edges.getEdge(j).length;
                        System.out.println("A slot was found at edge #" + i + " with length " + L + ", width " + W + " and height " + H);
         /* finds the bases*/
         void Base_Finder()
              int i=1;
              while(i++<=faces.total)
                   if(faces.getFace(i).normal[2] == -1)
                        double L, W;
                        if (faces.getFace(i).edges.getEdge(1).length >= faces.getFace(i).edges.getEdge(2).length )
                             L = faces.getFace(i).edges.getEdge(1).length; W = faces.getFace(i).edges.getEdge(2).length;
                        else
                             L = faces.getFace(i).edges.getEdge(2).length; W = faces.getFace(i).edges.getEdge(1).length;
                        System.out.println("A base was found at face #" + i + " with length " + L + " and width " + W);
    /* finds the ribs*/
         void Rib_Finder()
              int i=1;
              while(i++<=faces.total){
                   if(faces.getFace(i).normal[2] == 1) {
                        double L, W;
                        if ( faces.getFace(i).edges.getEdge(1).length >= faces.getFace(i).edges.getEdge(2).length ){
                             L = faces.getFace(i).edges.getEdge(1).length; W = faces.getFace(i).edges.getEdge(2).length;
                        else {
                             L = faces.getFace(i).edges.getEdge(2).length; W = faces.getFace(i).edges.getEdge(1).length;
                        if(W < 1.5 && faces.getFace(i).edges.getEdge(1).type == 1 && faces.getFace(i).edges.getEdge(2).type == 1)
                             System.out.println("A rib was found at face #" + i + " with length " + L + " and width " + W);
         /*** main program***/
         public static void main(String[] args) {
                   Feature_Recognizer a = new Feature_Recognizer();
                   a.readFile(args[0]);
                   a.edges.Edge_Stats();
                   a.Edges_Found();
                   a.VRML_Output(args[1]);
                   a.Slot_Finder();
                   a.Base_Finder();
                   a.Rib_Finder();
         }/*main ends here*/

    Try formatting your code better. Or use an auto formatter.
    You have too many '}' before this statement delete one.
    There is no such package as java.lang.Math
    You have about 4 more bugs to fix to get it to compile.
    Nearly there.

  • Help me debug this please

    First, I'm a complete noob here and in AS3. i know AS2 and this is my  first project in AS3...
    here's my FLA:
    http://www.directoph.com/projectbetatest/3dbrochuretest/3D-Brochure3.fla
    here's the live demo:
    http://www.directoph.com/projectbetatest/3dbrochuretest/
    Movie Behavior:
    It's a digital version of brochure with three versions (US, Hawaii,  Canada), upon loading of the main movie, a script will load an image  that will be the reference for the magnification. click and dragging  over the brochure will magnify its contents. clicking "view back" will  3D rotate the brochure then load the back image, then script again to  magnify the back contents.
    all works well for the 3 versions.
    the problem occurs when, lets say, I'm in Hawaii version and I clicked  USA. Same with when in Canada version and I clicked USA or Hawaii, in  short, errors occurs when jumping into an 'earlier' frame, or in  backward behavior.
    clicking to Hawaii or Canada from USA - no error;
    clicking to Canada from Hawaii - no error;
    clicking to USA from Hawaii - error;
    clicking to USA from Canada - error;
    clicking to Hawaii from Canada - error;
    Error:
    TypeError: Error #1009: Cannot access a property or method of a  null object reference.
         at 3D_fla::MainTimeline/frame1()
         at flash.display::MovieClip/gotoAndPlay()
         at 3D_fla::MainTimeline/usa2()
    I hope I made it clear. Ignore  the "PDF" button by the way, I haven't coded it yet. If you find my code  as crappy as hell, feel free to laugh... :-)
    Any help would be greatly appreciated. Thanks!

    The 1009 error indicates that one of the objects being targeted by your code is out of scope.  This could mean that the object....
    - is not in the display list
    - doesn't have an instance name (or the instance name is mispelled)
    - does not exist in the frame where that code is trying to talk to it
    - is animated into place but is not assigned instance names in every keyframe for it
    - is one of two or more consecutive keyframes of the same objects with different names assigned.
    If you go into your Publish Settings Flash section and select the option to Permit debugging, your error message should have a line number following the frame number which will help you isolate which object is involved.

  • Need some help in debugging this script

    Below is DDL generated by visio forward engineering tool . The example below consists of 2 test tables with one foreign key
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table1]') AND type in (N'U'))
    DROP TABLE [dbo].[Table1]
    GO
    CREATE TABLE [dbo].[Table1] (
    [test] CHAR(10) NOT NULL
    , [test2] CHAR(10) NULL
    GO
    ALTER TABLE [dbo].[Table1] ADD CONSTRAINT [Table1_PK] PRIMARY KEY CLUSTERED (
    [test]
    GO
    GO
    IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[Table2]') AND type in (N'U'))
    DROP TABLE [dbo].[Table2]
    GO
    CREATE TABLE [dbo].[Table2] (
    [test2] CHAR(10) NOT NULL
    GO
    ALTER TABLE [dbo].[Table2] ADD CONSTRAINT [Table2_PK] PRIMARY KEY CLUSTERED (
    [test2]
    GO
    GO
    ALTER TABLE [dbo].[Table1] WITH CHECK ADD CONSTRAINT [Table2_Table1_FK1] FOREIGN KEY (
    [test2]
    REFERENCES [dbo].[Table2] (
    [test2]
    GO
    GO
    When i converted this using scratch editor the migration tool gave some errors can anyone help me to resolve below
    DECLARE
    v_temp NUMBER(1, 0) := 0;
    BEGIN
    BEGIN
    SELECT 1 INTO v_temp
    FROM DUAL
    WHERE EXISTS ( SELECT *
    FROM objects
    WHERE OBJECT_ID_ = NULL/*TODO:OBJECT_ID(N'[OPS].[Table1]')*/
    AND TYPE IN ( N'U' )
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    IF v_temp = 1 THEN
    TRUNCATE TABLE Table1;
    END IF;
    END;
    CREATE TABLE Table1
    test CHAR(10) NOT NULL,
    test2 CHAR(10)
    ALTER TABLE Table1
    ADD
    CONSTRAINT Table1_PK PRIMARY KEY( test );
    --SQLDEV:Following Line Not Recognized
    DECLARE
    v_temp NUMBER(1, 0) := 0;
    BEGIN
    BEGIN
    SELECT 1 INTO v_temp
    FROM DUAL
    WHERE EXISTS ( SELECT *
    FROM objects
    WHERE OBJECT_ID_ = NULL/*TODO:OBJECT_ID(N'[OPS].[Table2]')*/
    AND TYPE IN ( N'U' )
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    IF v_temp = 1 THEN
    TRUNCATE TABLE Table2;
    END IF;
    END;
    CREATE TABLE Table2
    test2 CHAR(10) NOT NULL
    ALTER TABLE Table2
    ADD
    CONSTRAINT Table2_PK PRIMARY KEY( test2 );
    --SQLDEV:Following Line Not Recognized
    ALTER TABLE Table1
    ADD
    CONSTRAINT Table2_Table1_FK1 FOREIGN KEY( test2 ) REFERENCES Table2 (test2)
    --SQLDEV:Following Line Not Recognized
    ;

    Welcome to the forum!
    Whenever you post you need to provide your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
    >
    Below is DDL generated by visio forward engineering tool . The example below consists of 2 test tables with one foreign key
    When i converted this using scratch editor the migration tool gave some errors can anyone help me to resolve below
    >
    Not familiar with either of those tools but they appear to be producing such garbage as to not be useful at all. You may want to try using sql developer and the data modeler module.
    The reason I say that is that this code (notice that since I put \ on the line before and after the code it preserved the formatting)DECLARE
    v_temp NUMBER(1, 0) := 0;
    BEGIN
    BEGIN
    SELECT 1 INTO v_temp
    FROM DUAL
    WHERE EXISTS ( SELECT *
    FROM objects
    WHERE OBJECT_ID_ = NULL/*TODO:OBJECT_ID(N'[OPS].[Table1]')*/
    AND TYPE IN ( N'U' )
    EXCEPTION
    WHEN OTHERS THEN
    NULL;
    END;
    IF v_temp = 1 THEN
    TRUNCATE TABLE Table1;
    END IF;
    END;
    CREATE TABLE Table1
    test CHAR(10) NOT NULL,
    test2 CHAR(10)
    This code appears to check if table1 exists. Then if the table exists it TRUNCATEs it. But then it attempts to CREATE the table.
    Well - you can't have it both ways. If the table exists you can't create it.
    If this code is typical of what your tools are producing you need to either use another tool (e.g. sql developer) or do the conversion manually.
    You can download sql developer here
    http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/index.html                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Plz help me in this simple code

    hi every one
    I try to generate a serial number the column ia varchar2
    I need to know the maxium length for the data in this column
    I try to write this code
    declare
    max_l number;
    begin
         select max(length(ITEM_NO)) into max_l from COMPANY_ITEMS;
    end if;
    this code give me value in toad but in form give me error
    how can I over comee at this error

    Hi,
    declare
    max_l number;
    begin
         select max(length(ITEM_NO)) into max_l from COMPANY_ITEMS;
    end if;The problem in your code is that you are using *"end if;"* instead of *"end;"*
    this code give me value in toad but in form give me error Not sure how it worked in toad, it will never work even in toad.
    Hope this helps.
    Best Regards
    Arif Khadas

  • Who can help me write this Java code show the prime number ???? PLEASEEEEEE

    Write java code print prime number like this
    Sample Screen Print:
    Initial matrix with N = 37
    2 3 4 5 6 7 8 9 10
    11 12 13 14 15 16 17 18 19 20
    21 22 23 24 25 26 27 28 29 30
    31 32 33 34 35 36 37
    Intermediate results (after 1st iteration)
    2 3 5 7 9
    11 13 15 17 19
    21 23 25 27 29
    31 33 35 37
    Intermediate results (after 2nd iteration)
    2 3 5 7
    11 13 17 19
    23 25 29
    31 35 37
    Intermediate results (after 7th iteration)
    2 3 5 7
    11 13 17 19
    23 29
    31 37
    Final results
    2 3 5 7 11 13 17 19 23 29
    31 37
    How to write this code ?
    Please Help me!
    Thank you so muchhh ?????

    h2. {color:#ff0000}Multiplepost{color}
    Replies here: http://forum.java.sun.com/thread.jspa?threadID=5241012&tstart=0
    There is a useful answer the original thread. Answer it, or ignore it as you like, but don't create multiple threads.

  • Can sumone help me with this promo code question?

    I got a promo code and I entered it but the itunes music store says that this code as already been used. I haven't used the code and would like to know how to redeem my credits.

    Just FYI, everyone here is just a fellow user; no one here (with very rare exeptions) works for Apple. Everyone here helps out of the goodness of their hearts and as they have time and knowledge.
    So have patience when you post; it's very unlikely that you'll get a response within just a couple of minutes, and in some cases it may take hours for someone to see your question who has suggestions to offer. So please don't post back again (unless you're adding details to your question) for at least a few hours, and better not for a day or so, and definitely don't post back on a few minutes after your first post. That's just going to annoy people and make them less likely to want to help you.

  • Please help me with this ABAP code!

    Here is my code:
    ===
    REPORT ZCFICO6010
             line-count 65
             line-size 132
             no standard page heading.
    tables: zsopshist, zsops.
    data: old_prezsops like zsops_prev.     "PJCHG10854
    data: new_prezsops like zsops_prev.     "PJCHG10854
    data: old_zzsops like zsops.            "PJCHG10854
    data: new_zzsops like zsops.            "PJCHG10854
    data: long_rec(900) type c.             "PJCHG10854
    data: old_lzsops like long_rec.         "PJCHG10854
    data: new_lzsops like long_rec.         "PJCHG10854
    data: curr_zsops like zsops,
          prev_zsops like zsops_prev.
    data: begin of i_key,
      kostl(5),
      aedat(8),
      cputm(6).
    data:   end of i_key.
    DATA: HEADER like zsops-oprcd,
          header1(92) type c.
        header1 like header.
    data: v_field(18) type c,
          v_old(20)  type c,
          v_new(20)  type c,
          user like zsops-uname,
          date like zsops-aedtm.
    data: begin of table occurs 0,
          text(20) type c,
          oprcd like zsops-oprcd,
          field(15) type c,
          user like zsops-uname,
          date like zsops-aedtm,
          v_old(20) ,
          v_new(20) ,
        end of table.
    data: text(30) type c.
    data: begin of itab occurs 0,
           srtfd like zsopshist-srtfd,
         end of itab.
    *data: ihist like old_zsops occurs 0 with header line,
         nhist like new_zsops occurs 0 with header line.
    data: ihist like zsops occurs 0 with header line,
          nhist like zsops occurs 0 with header line.
    *&      Selection Screen
    SELECTION-SCREEN BEGIN OF BLOCK one WITH FRAME TITLE TEXT-200.
    parameters: s_oprcd  like zsops-oprcd obligatory,
                s_oprcdh like zsops-oprcd .
                    s_cputm   for sy-uzeit.
    SELECTION-SCREEN END OF BLOCK one.
    SELECTION-SCREEN BEGIN OF BLOCK three WITH FRAME TITLE TEXT-300.
    parameters:s_aedtm  like zsops-aedtm obligatory,
    s_aedtmh like zsops-aedtm obligatory.
    SELECTION-SCREEN END OF BLOCK three.
    SELECTION-SCREEN BEGIN OF BLOCK TWO WITH FRAME TITLE TEXT-100.
    PARAMETERS: P_REGSRT RADIOBUTTON GROUP RADI,
                P_ACCSRT RADIOBUTTON GROUP RADI.
    SELECTION-SCREEN END OF BLOCK TWO.
    parameters: new_date like sy-datum obligatory default '20051214'.
    *&      Top-Of-Page
    top-of-page.
    BEGIN OF BLOCK INSERTED FOR                              "JJMM20040330
      DATA: CC_LOW LIKE ZSOPS-OPRCD,
            CC_HIGH LIKE ZSOPS-OPRCD,
            FROM_DATE(10) TYPE C,
            TO_DATE(10)   TYPE C.
      WRITE: S_OPRCD TO CC_LOW NO-ZERO,
             S_AEDTM TO FROM_DATE USING EDIT MASK '__/__/____',
             S_AEDTMH TO TO_DATE USING EDIT MASK '__/__/____'.
      IF S_OPRCDH = S_OPRCD.
        CONCATENATE: 'Cost Center'(T02) CC_LOW 'Changed On'(T04) FROM_DATE
                     'To'(T03) TO_DATE 'Sort By'(T05) text INTO HEADER1
                     separated by space.
      ELSE.
        WRITE: S_OPRCDH TO CC_HIGH NO-ZERO.
        CONCATENATE: 'Cost Center'(T02) CC_LOW 'To'(T03) CC_HIGH
                     'Changed On'(T04) FROM_DATE 'To'(T03) TO_DATE
                     'Sort By'(T05) text INTO HEADER1 separated by space.
      ENDIF.
    END OF BLOCK INSERTED FOR                                "JJMM20040330
      PERFORM DISPLAY_PAGE_HEADER(ZCLT0001) USING
                                          header1            "JJMM20040330
                                            HEADER
                                            TEXT-T01
                                            header1.           "JJMM20040330
      Write:/ 'Field Changed'(C01), 25 'Old Values'(C02),
               55 'New Values'(C03), 85 'Cost Center'(C04),
              105 'Changed By'(C05), 120 'Changed On'(C06).
      uline.
    start-of-selection.
      data: time(6),
            v_subrc like sy-subrc,
            prev_format(1),
            srtfd like zsopshist-srtfd,
            srtfdh like zsopshist-srtfd.
      srtfd0(5) = s_oprcd5(5).
      srtfd+5(8) = s_aedtm.
      srtfd+13(6) = '000000'.
       if s_oprcdh is initial.
         s_oprcdh = s_oprcd.
       endif.
      srtfdh0(5) = s_oprcdh5(5).
      srtfdh+5(8) = s_aedtmh.
      srtfdh+13(6) = '999999'.
      select srtfd from zsopshist into table itab
              WHERE  SRTFD >= SRTFD
              AND    SRTFD <= SRTFDH.
    sort itab by srtfd.
      loop at itab.
        IF ITAB+5(8) GE S_AEDTM  AND                            "IJHM00001
            ITAB+5(8) LE S_AEDTMH.                              "IJHM00001
          move: itab+0(5)          to i_key-kostl,
                itab+5(8)          to i_key-aedat,
                itab+13(6)         to i_key-cputm.
          clear: v_subrc, prev_format.
          if itab+5(8) lt new_date.
            prev_format = 'X'.
            perform import_record_prev changing v_subrc.      "PJCHG10854
          else.
            perform import_record changing v_subrc.           "PJCHG10854
          endif.
          if v_subrc = 0.                                     "PJCHG10854
            perform get_final_table.
          endif.
        ENDIF.                                                  "IJHM00001
      endloop.
      if p_regsrt = 'X'.
        sort table by oprcd field date descending.
        text = 'Cost Center'(C04).
      else.
        sort table by field oprcd date descending.
        text = 'Field Changed'(C01).
      endif.
       perform write_report.
          FORM get_final_table                                          *
    form get_final_table.
    move old_zsops to ihist.           "PJCHG10854
    move new_zsops to nhist.           "PJCHG10854
      if prev_format eq 'X'.              "PJCHG10854
        move old_prezsops to ihist.       "PJCHG10854
        move new_prezsops to nhist.       "PJCHG10854
      else.                               "PJCHG10854
        move old_zzsops to ihist.         "PJCHG10854
        move new_zzsops to nhist.         "PJCHG10854
      endif.                              "PJCHG10854
      if ihist-ivcrg ne nhist-ivcrg.
       table-text = 'Invst Charge Base'(F01).
       table-field = 'IVCRG'.
        table-v_old   = ihist-ivcrg.
        table-v_new   = nhist-ivcrg.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
      if ihist-mgtfp ne nhist-mgtfp.
        table-field = 'MGTFP'.
        table-text = 'Mgt Fee %'(F02).
        table-v_old(12)   = ihist-mgtfp.
        table-v_new(12)   = nhist-mgtfp.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
      if ihist-discd ne nhist-discd.
        table-field = 'DISCD'.
        table-text = 'Cash Disc. Passback'(F03).
        table-v_old   = ihist-discd.
        table-v_new   = nhist-discd.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
      if ihist-consc ne nhist-consc.
        table-field = 'CONSC'.
        table-text = 'Subsidy Calc'(F04).
        table-v_old   = ihist-consc.
        table-v_new   = nhist-consc.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
      if ihist-payfart ne nhist-payfart.
        table-field = 'PAYFART'.
        table-text = 'Payroll Fringe'(F05).
        table-v_old(12)   = ihist-payfart.
        table-v_new(12)   = nhist-payfart.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
      if ihist-frbpb ne nhist-frbpb.
        table-field = 'FRBPB'.
        table-text = 'Rebate Pass Back'(F06).
        table-v_old(12)   = ihist-frbpb.
        table-v_new(12)   = nhist-frbpb.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
      if ihist-exlca ne nhist-exlca.
        table-field = 'EXLCA'.
        table-text = 'Excl Source27'(F07).
        table-v_old   = ihist-exlca.
        table-v_new   = nhist-exlca.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
      perform write_report.
        append table.
      endif.
      if ihist-exlcb ne nhist-exlcb.
        table-field = 'EXLCB'.
        table-text = 'Excl Source11'(F08).
        table-v_old   = ihist-exlcb.
        table-v_new   = nhist-exlcb.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
      perform write_report.
        append table.
      endif.
      if ihist-trnrate ne nhist-trnrate.
        table-field = 'TRNRATE'.
        table-text = 'Payroll Training'(F09).
        table-v_old(12)   = ihist-trnrate.
        table-v_new(12)   = nhist-trnrate.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
      if ihist-mgffa ne nhist-mgffa.
        table-field = 'MGFFA'.
        table-text = 'Mgt Fee Amt'(F10).
        table-v_old(12)   = ihist-mgffa.
        table-v_new(12)   = nhist-mgffa.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
      perform write_report.
        append table.
      endif.
      if ihist-mgtfi ne nhist-mgtfi.
        table-field = 'MGTFI'.
        table-text = 'Mgt Fees Indicator'(F11).
        table-v_old   = ihist-mgtfi.
        table-v_new   = nhist-mgtfi.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
      perform write_report.
        append table.
      endif.
      if ihist-eqres ne nhist-eqres.
        table-field = 'EQRES'.
        table-text = 'Eqip Res Accrual'(F12).
      table-v_old = ihist-eqres.                             "JJMM20040331
      table-v_new = nhist-eqres.                             "JJMM20040331
        table-v_old(12) = ihist-eqres.                         "JJMM20040331
        table-v_new(12) = nhist-eqres.                         "JJMM20040331
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
      if ihist-ovrhd ne nhist-ovrhd.
        table-field = 'OVRHD'.
        table-text = 'OverHead Amt'(F13).
        table-v_old(12)   = ihist-ovrhd.
        table-v_new(12)   = nhist-ovrhd.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
        if ihist-xaccural ne nhist-xaccural.
        table-field = 'XACCUARAL'.
        table-text = 'Exclude Accrual'(F14).
        table-v_old(12)   = ihist-xaccural.
        table-v_new(12)   = nhist-xaccural.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
      if ihist-ovrrt ne nhist-ovrrt.
        table-field = 'OVRRT'.
        table-text = 'OverHead Rate'(F15).
        table-v_old(12)   = ihist-ovrrt.
        table-v_new(12)   = nhist-ovrrt.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
        if ihist-ztbd01 ne nhist-ztbd01.
        table-field = 'ZTBD01'.
      table-text = 'Char1'.                                  "JJMM20040330
        table-text = 'Meal Allowance'(F16).                    "JJMM20040330
        table-v_old   = ihist-ztbd01.
        table-v_new   = nhist-ztbd01.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    BEGIN OF BLOCK INSERTED FOR                            "JJMM20040330
      if ihist-earlybil ne nhist-earlybil.
        table-field = 'EARLYBIL'.
        table-text = 'Early Billing'(F17).
        table-v_old   = ihist-earlybil.
        table-v_new   = nhist-earlybil.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
      if ihist-combined ne nhist-combined.
        table-field = 'COMBINED'.
        table-text = 'Combined Billing'(F18).
        table-v_old   = ihist-COMBINED.
        table-v_new   = nhist-COMBINED.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    END OF BLOCK INSERTED FOR                                "JJMM20040330
        if ihist-rate1 ne nhist-rate1.
        table-field = 'RATE1'.
        table-text = 'Rate 1'(F19).
        table-v_old(12)   = ihist-rate1.
        table-v_new(12)  = nhist-rate1.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    *if ihist-rate1 ne nhist-rate2.                            "JJMM20040330
      table-field = 'RATE1'.                                 "JJMM20040330
    if ihist-rate2 ne nhist-rate2.                            "JJMM20040330
        table-field = 'RATE2'.                                 "JJMM20040330
        table-text = 'Rate 2'(F20).
        table-v_old(12)   = ihist-rate2.
        table-v_new(12)   = nhist-rate2.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    *if ihist-rate1 ne nhist-rate3.                            "JJMM20040330
    if ihist-rate3 ne nhist-rate3.                            "JJMM20040330
        table-field = 'RATE3'.
        table-text = 'Rate 3'(F21).
        table-v_old(12)   = ihist-rate3.
        table-v_new(12)   = nhist-rate3.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    *if ihist-rate1 ne nhist-rate4.                            "JJMM20040330
    if ihist-rate4 ne nhist-rate4.                            "JJMM20040330
        table-field = 'RATE4'.
        table-text = 'Rate 4'(F22).
        table-v_old(12)   = ihist-rate4.
        table-v_new(12)   = nhist-rate4.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    *if ihist-rate1 ne nhist-rate5.                            "JJMM20040330
    if ihist-rate5 ne nhist-rate5.                            "JJMM20040330
        table-field = 'RATE5'.
        table-text = 'Rate 5'(F23).
        table-v_old(12)   = ihist-rate5.
        table-v_new(12)   = nhist-rate5.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    *if ihist-rate1 ne nhist-rate6.                            "JJMM20040330
    if ihist-rate6 ne nhist-rate6.                            "JJMM20040330
        table-field = 'RATE6'.
        table-text = 'Rate 6'(F24).
        table-v_old(12)   = ihist-rate6.
        table-v_new(12)   = nhist-rate6.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    *if ihist-rate1 ne nhist-rate7.                            "JJMM20040330
    if ihist-rate7 ne nhist-rate7.                            "JJMM20040330
        table-field = 'RATE7'.
        table-text = 'Rate 7'(F25).
        table-v_old(12)   = ihist-rate7.
        table-v_new(12)   = nhist-rate7.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    *if ihist-rate1 ne nhist-rate8.                            "JJMM20040330
    if ihist-rate8 ne nhist-rate8.                            "JJMM20040330
        table-field = 'RATE8'.
        table-text = 'Rate 8'(F26).
        table-v_old(12)   = ihist-rate8.
        table-v_new(12)   = nhist-rate8.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    *if ihist-rate1 ne nhist-rate9.                            "JJMM20040330
    if ihist-rate9 ne nhist-rate9.                            "JJMM20040330
        table-field = 'RATE9'.
        table-text = 'Rate 9'(F27).
        table-v_old(12)   = ihist-rate9.
        table-v_new(12)   = nhist-rate9.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    *if ihist-rate1 ne nhist-rate10.                           "JJMM20040330
    if ihist-rate10 ne nhist-rate10.                          "JJMM20040330
        table-field = 'RATE10'.
        table-text = 'Rate 10'(F28).
        table-v_old(12)   = ihist-rate10.
        table-v_new(12)   = nhist-rate10.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    *if ihist-rate1 ne nhist-rate11.                           "JJMM20040330
    if ihist-rate11 ne nhist-rate11.                          "JJMM20040330
       table-field = 'RATE11'.
        table-text = 'Rate 11'(F29).
        table-v_old(12)   = ihist-rate11.
        table-v_new(12)   = nhist-rate11.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      perform write_report.
      endif.
    The following lines of code have been added per change IJHM00001
    if ihist-rate12 ne nhist-rate12.
       table-field = 'RATE12'.
        table-text = 'Rate 12'(F30).
        table-v_old(12)   = ihist-rate12.
        table-v_new(12)   = nhist-rate12.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-rate13 ne nhist-rate13.
       table-field = 'RATE13'.
        table-text = 'Rate 13'(F31).
        table-v_old(12)   = ihist-rate13.
        table-v_new(12)   = nhist-rate13.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-rate14 ne nhist-rate14.
       table-field = 'RATE14'.
        table-text = 'Rate 14'(F32).
        table-v_old(12)   = ihist-rate14.
        table-v_new(12)   = nhist-rate14.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-rate15 ne nhist-rate15.
       table-field = 'RATE15'.
        table-text = 'Rate 15'(F33).
        table-v_old(12)   = ihist-rate15.
        table-v_new(12)   = nhist-rate15.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-rate16 ne nhist-rate16.
       table-field = 'RATE16'.
        table-text = 'Rate 16'(F34).
        table-v_old(12)   = ihist-rate16.
        table-v_new(12)   = nhist-rate16.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-rate17 ne nhist-rate17.
       table-field = 'RATE17'.
        table-text = 'Rate 17'(F35).
        table-v_old(12)   = ihist-rate17.
        table-v_new(12)   = nhist-rate17.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-rate18 ne nhist-rate18.
       table-field = 'RATE18'.
        table-text = 'Rate 18'(F36).
        table-v_old(12)   = ihist-rate18.
        table-v_new(12)   = nhist-rate18.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    The following lines of code have been added per change IJHM00002
    if ihist-rate19 ne nhist-rate19.
       table-field = 'RATE19'.
        table-text = 'Rate 19'(F37).
        table-v_old(12)   = ihist-rate19.
        table-v_new(12)   = nhist-rate19.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-rate20 ne nhist-rate20.
       table-field = 'RATE20'.
        table-text = 'Rate 20'(F38).
        table-v_old(12)   = ihist-rate20.
        table-v_new(12)   = nhist-rate20.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-rate21 ne nhist-rate21.
       table-field = 'RATE21'.
        table-text = 'Rate 21'(F39).
        table-v_old(12)   = ihist-rate21.
        table-v_new(12)   = nhist-rate21.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-rate22 ne nhist-rate22.
       table-field = 'RATE22'.
        table-text = 'Rate 22'(F40).
        table-v_old(12)   = ihist-rate22.
        table-v_new(12)   = nhist-rate22.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-intcrb ne nhist-intcrb.
       table-field = 'INTCRB'.
        table-text = 'Intcrb'(F47).                             "IJHM00002
       table-text = 'Intcrb'(F37).                            "IJHM00002
        table-v_old   = ihist-intcrb.
        table-v_new   = nhist-intcrb.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-intcrr ne nhist-intcrr.
       table-field = 'INTCRR'.
        table-text = 'Intcrr'(F48).                             "IJHM00002
       table-text = 'Intcrr'(F38).                            "IJHM00002
        table-v_old(12)   = ihist-intcrr.
        table-v_new(12)   = nhist-intcrr.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-zwktran ne nhist-zwktran.
       table-field = 'ZWKTRAN'.
        table-text = 'Data Trans End Unit'(F49).                "IJHM00002
       table-text = 'Data Trans End Unit'(F39).               "IJHM00002
        table-v_old   = ihist-zwktran.
        table-v_new   = nhist-zwktran.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-zwkbud ne nhist-zwkbud.
       table-field = 'ZWKBUD'.
        table-text = 'Wkly Budget Ind'(F50).                    "IJHM00002
       table-text = 'Wkly Budget Ind'(F40).                   "IJHM00002
        table-v_old   = ihist-zwkbud.
        table-v_new   = nhist-zwkbud.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-bcycle ne nhist-bcycle.
       table-field = 'BCYCLE'.
        table-text = 'Bcycle'(F51).                             "IJHM00002
       table-text = 'Bcycle'(F41).                            "IJHM00002
        table-v_old   = ihist-bcycle.
        table-v_new   = nhist-bcycle.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    if ihist-ovind ne nhist-ovind.
       table-field = 'OVIND'.
        table-text = 'Ovind'(F52).                              "IJHM00002
       table-text = 'Ovind'(F42).                             "IJHM00002
        table-v_old   = ihist-ovind.
        table-v_new   = nhist-ovind.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    *New code for PRSID -
    "ZN032106
      if ihist-prsid ne nhist-prsid.
       table-field = 'PRSID'.
        table-text = 'PRSID'(F53).
        table-v_old   = ihist-prsid.
        table-v_new   = nhist-prsid.
        table-user    = nhist-uname.
        table-date    = nhist-aedtm.
        table-oprcd = nhist-oprcd.
        append table.
      endif.
    *End of new code----
    "ZN032106
    endform.
          FORM write_report                                             *
    form write_report.
    loop at table.
      write:/1 table-text,   25 table-v_old(12) left-justified,
             55 table-v_new(12) left-justified, 85 table-oprcd,
             106 table-user, 120 table-date.
      uline.
    endloop.
    skip 5.                                                    "JJMM20040330
    write:/35 TEXT-R01.                                        "JJMM20040330
    reserve 1 lines.                                           "JJMM20040330
    endform.
    *&      Form  import_record
    form import_record changing p_subrc.
         import i_key
               old_zsops to old_zzsops
               new_zsops to new_zzsops
               from database zsopshist(Z1)
               id i_key.
         p_subrc = sy-subrc.
    endform.                    " import_record
    *&      Form  import_record_prev
    form import_record_prev changing p_subrc.
         import i_key
               old_zsops to old_prezsops
               new_zsops to new_prezsops
               from database zsopshist(Z1)
               id i_key.
         p_subrc = sy-subrc.
    endform.                    " import_record_prev
    *&      Form  import_record_long
    form import_record_long changing p_subrc.
         import i_key
               old_zsops to old_lzsops
               new_zsops to new_lzsops
               from database zsopshist(Z1)
               id i_key.
         p_subrc = sy-subrc.
    endform.                    " import_record_prev
    ===
    <b>Here is the dump I am getting:</b>
    ====================
      Error when attempting to IMPORT object "OLD_ZSOPS".
    An exception occurred that is explained in detail below.                      
    The exception, which is assigned to class 'CX_SY_IMPORT_MISMATCH_ERROR', was  
      not caught in                                                                
    procedure "IMPORT_RECORD" "(FORM)", nor was it propagated by a RAISING clause.
    Since the caller of the procedure could not have anticipated that the         
    exception would occur, the current program is terminated.                     
    The reason for the exception is:                                              
    The object "OLD_ZSOPS" has a different object type in the dataset from        
    that in the target program "ZCFICO6010".                                      
       Try to find out why the type of the object is incorrect.                            
       There are various possible options:                                                                               
    1. The type of the imported object has changed in the Data Dictionary.              
          Make sure that the type of the imported object matches the type                  
          of the object in the Data Dictionary.                                            
          If the data cannot be restored from another source, the data must be             
          read by the 'old' structure, converted und again eported with the new            
          structure, so that future IMPORTs will always function with the new              
          structure.                                                                               
    2. A new program version is active, which no longer fits the dataset.               
          Try to solve the error generating the program "ZCFICO6010" again. This           
          works as follows: Select transaction SE38 in the SAP system. Enter               
          the program name "ZCFICO6010". Then activate the function 'Generate'.                                                                               
    If the error occures in a non-modified SAP program, you may be able to              
       find an interim solution in an SAP Note.                                            
       If you have access to SAP Notes, carry out a search with the following              
       keywords:                                                                               
    "CONNE_IMPORT_WRONG_OBJECT_TYPE" "CX_SY_IMPORT_MISMATCH_ERROR"                      
       "ZCFICO6010" or "ZCFICO6010"                                                        
       "IMPORT_RECORD"                                                                               
    If you cannot solve the problem yourself and want to send an error                  
       notification to SAP, include the following information:                                                                               
    1. The description of the current problem (short dump)                              
        To save the description, choose "System->List->Save->Local File           
    (Unconverted)".                                                                               
    2. Corresponding system log                                                                               
    Display the system log by calling transaction SM21.                       
        Restrict the time interval to 10 minutes before and five minutes          
    after the short dump. Then choose "System->List->Save->Local File            
    (Unconverted)".                                                                               
    3. If the problem occurs in a problem of your own or a modified SAP          
    program: The source code of the program                                      
        In the editor, choose "Utilities->More                                    
    Utilities->Upload/Download->Download".                                                                               
    4. Details about the conditions under which the error occurred or which      
    actions and input led to the error.                                                                               
    The exception must either be prevented, caught within proedure               
    "IMPORT_RECORD" "(FORM)", or its possible occurrence must be declared in the 
    RAISING clause of the procedure.                                             
    To prevent the exception, note the following:                                
    ==============
    Sorry forthis lengthy post but I was having difficulty explaining in previous post. All answers will be rewarded..
    Thanks.
    Mithun

    What is the structure for zsops ?
    There seems to be a compatibility issue....

  • Help, I get this error code when installing encore cs5 from master collection Exit Code: 6.

    Hello all,
    I have been having a problem installing encore cs5 into my Dell xps studio 8100.  the machine is literally three days old and aside from the os, there's nothing else installed in it.
    I was able to run the installation for CS5 without any issues until it got to encore.  everything else installed without an issue but it refuses to install encore.  I have installed the same master collection on another machine, a little older than the new dell, and it installed flawlessly.  But on the new machine, no dice.
    I have posted below the error msg logs i received from the install.  Any help would be much appreciated please.
    Exit Code: 6
    -------------------------------------- Summary --------------------------------------
    - 1 fatal error(s), 3 error(s), 8 warning(s)
    WARNING: OS requirements not met for {33A3F995-8333-4676-8D6F-AB7674BB52EA}
    WARNING: OS requirements not met for {565DE707-5798-4FC3-8DF6-0F58A348A9B0}
    WARNING: OS requirements not met for {5DDABB74-A879-4BE7-A4C6-FD41793942DB}
    WARNING: OS requirements not met for {694213D7-1E0E-4C8F-B822-E2E3680C0FCE}
    WARNING: OS requirements not met for {7816FDDE-40D4-482D-AD7D-97858985DB3E}
    WARNING: OS requirements not met for {AAE6F374-91CB-45FB-9282-4CFA0DED2088}
    WARNING: OS requirements not met for {B8D286BC-A68D-4E74-9F68-8756A49896D8}
    WARNING: Payload cannot be installed due to dependent operation failure
    ERROR: The following payload errors were found during install:
    ERROR:  - Adobe Encore CS5_AdobeEncore5en_USLanguagePack: Install failed
    ERROR:  - Adobe Encore CS5: Failed due to Language Pack installation failure
    FATAL ERROR: Cannot create extract assets at 'C:\Program Files (x86)\Common Files\Adobe\Installers\adobeTemp\{D8465547-5D5B-4856-A93A-8AC0A05C5D4D}' from zip file 'D:\Adobe CS5\payloads\AdobeEncore5AllRetail\Assets1_1.zip'. Error 23 Data error (cyclic redundancy check).

    Hmm... My CS5/AVCHD 1st Impressions http://forums.adobe.com/thread/652694?tstart=0 includes a link to the computer I built
    My CS5 install went with no problems at all, so I'm pretty much out of ideas, other than a note I saved
    Install Checklist http://forums.adobe.com/thread/569663?tstart=0

  • Help plsss converting this AS2 code to AS3!!

    here is a little AS2 code that is in fact a photo gallery
    that i use in my site and i want to convert it to AS3 but i just
    cant seem to get it right... could someone plssss help me?!?!

    with what part are you having trouble?

Maybe you are looking for

  • Adobe Creative Cloud installation funktioniert nicht

    Hallo, Ich habe folgendes Problem: Immer wenn ich CC installieren will kommt mir eine Windows Meldung mit Programm funktioniert nicht mehr Als ich es vor 1 Woche deinstalliert habe kam mir eine fehler meldung "fehler beim deinstallieren" danach habe

  • Cloud Suiten

    Hallo Viele Nutzer finden das Cloud Angebot von Adobe nur überrissen und teuer. Warum führ man nicht wie früher verschiedene Suiten in der Cloud ein? Ich brauche keine Master Collection Version. Alle auf ein Abo zu Vergewaltigung und dann noch die hö

  • Download error for Inspiration Browser and AIR- Elements 9

    I have had Elements 9 for months but just installed it. I want to the the Inspiration Browser. It is not installed and asks if I want to install. I say yes and am taken to a downoad page saying I also need AIR, would i like to download both. I say ye

  • How to deal with files ?!!!!

    hiii, guys i dont believe that a huge program like flash with all these abilities doesnt deal easily with files !!! I just want to do simple reading and writing to text files. Something veryyyyyy simple like writing a name and reading it again later

  • MIDI error message on startup

    Garageband 3 presents the following error on start up: Garageband has detected a possible conflict between one of more third party MIDI or audio drivers. Be sure to install the latest drivers for all audio and MIDI equipment connected to your compute