This site requires JavaScript, please enable it in your browser!
Greenfoot back
superwombat
superwombat wrote ...

2016/6/30

Editor Bug

superwombat superwombat

2016/6/30

#
I've noticed a slight bug with the greenfoot IDE/editor when it comes to slightly more complicated expressions.
for(Class 2dArray[][]:3dArray){
    for(Class Array[]:2dArray){
        for(Class a:2dArray){
              //do something
         }
     }
}
The code still works, but in the editor, the highlighting is weird.
danpost danpost

2016/6/30

#
It highlights better this way:
for(Class[][] array2d : array3d){
    for(Class[] array : array2d){
        for(Class a : array){
            //do something
        }
    }
}
The following is what the java tutorials say about naming variables:
Variable names are case-sensitive. A variable's name can be any legal identifier — an unlimited-length sequence of Unicode letters and digits, beginning with a letter, the dollar sign "$", or the underscore character "_". The convention, however, is to always begin your variable names with a letter, not "$" or "_". Additionally, the dollar sign character, by convention, is never used at all. You may find some situations where auto-generated names will contain the dollar sign, but your variable names should always avoid using it. A similar convention exists for the underscore character; while it's technically legal to begin your variable's name with "_", this practice is discouraged. White space is not permitted.
superwombat superwombat

2016/6/30

#
Alright, thanks! It just gets a bit confusing and ugly sometimes.
You need to login to post a reply.