Having a problem with formatting

Home Forums Procoding Having a problem with formatting

Tagged: ,

This topic contains 2 replies, has 1 voice, and was last updated by  audiocommander 7 years ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #560

    Jbounds

    When I enter this piece of code the programm becomes indented to the center of the screen which makes it slightly confusing to read my code. I have narrowed it down to my Substanuiating a string with numbers. Here is an example you can try and copy and paste this to your sketch.

    PFont PacFont;
    PImage PacImage;
    color blinkycol = color(255, 0, 0);
    color pinkycol = color(255, 184, 222);
    color clydecol = color(255, 184, 71);
    color deadghostcol = color(0, 0, 0);
    color dotscol = color(255, 184, 151);
    //color wallscol = color(26,26,173);
    color pacolor = color(255, 255, 0);
    color inkycol = color(0, 255, 222);
    int pacX = 447;
    int pacY = 591;
    int step =1;
    int PacTurnYs [] = {92, 217, 310, 403, 496, 591, 684, 776, 870, 964};
    int PacTurnXs [] = {53, 117, 212, 305, 401, 494, 587, 682, 777, 839 };
    int pacDiameter = 39;
    int pacSilouet;
    int  MovementForMouth, Direction, ChangeDirection, Score;

    Even with this small problem I absolutely love this app. Keep up the good work. It would be really cool if there was a formatting button, like there is for the find and replace addition ( that was a really good addition by the way.)

    #561

    audiocommander
    Keymaster

    Hi Jbounds,

    thanks a lot for the kind words.

    Yeah, I know, the editor kind of has some annoyances and I’m currently working on a new (native) editor, but there are a lot of major and minor problems, so I’m not sure if the new editor will be finished soon. I will try and see if I can fix this issue for the next update.

    As an immediate workaround, instead of:

    int pacTurnYs [] = {92, 217, 310, 403, 496, 591, 684, 776, 870, 964};

    you could also write:

    int[] pacTurnYs = new int(10);
    pacTurnYs[0] = 92;
    pacTurnYs[1] = 217;
    pacTurnYs[2] = 310;
    pacTurnYs[3] = 403;
    pacTurnYs[4] = 496;
    pacTurnYs[5] = 591;
    pacTurnYs[6] = 684;
    pacTurnYs[7] = 776;
    pacTurnYs[8] = 870;
    pacTurnYs[9] = 964;

    I know that’s not ideal, but it does at least autoindent correctly.

    Cheers,
    Michael

    #585

    audiocommander
    Keymaster

    …and btw: the upcoming Version (which is currently in review) has a preference setting to disable autoindentation.

Viewing 3 posts - 1 through 3 (of 3 total)

The topic ‘Having a problem with formatting’ is closed to new replies.