aspose file tools*
The moose likes Beginning Java and the fly likes variable not know in current context Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "variable not know in current context" Watch "variable not know in current context" New topic
Author

variable not know in current context

Steven Zoraster
Greenhorn

Joined: Dec 24, 2012
Posts: 4


Why am I getting "variable not known in current context" for x in the following code:

float x = 0.0f;
for(int i=0;i<dataIn.length;i++){
x = (float)dataIn[0][i];
float y = (float)dataIn[1][i];
float z = (float)dataIn[2][i];
boolean b = distanceTransform(M,
Gf,dzdx,dzdy,grad,x,y,z);
}

Netbeans documentation says to initialize a variable before using it should cure this problem
Stevens Miller
Ranch Hand

Joined: Jul 26, 2012
Posts: 567
    
    4

Steven Zoraster wrote:Why am I getting "variable not known in current context" for x in the following code:


Gonna need a little more of that context to be of any help. Can you post the class and method definitions that include this fragment (assuming they're not too long, of course)?

Netbeans documentation says to initialize a variable before using it should cure this problem

If anything, I'd expect that to generate a "The assigned value is never used" warning, rather than solve anything.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: variable not know in current context