Scrolling matrix display

I got it to work. Here it is in case anyone needs it

void staticDisplay()
{
  
curcharix = 0;
curcharbit = 0;
curcharixsave = 0;
curcharbitsave = 0;
curcharixsave2 = 0;
curcharbitsave2 = 0;

clearDisplay();
  
bool endFlag = false;
  
    for (i=devCount-1;i>=0;i--) // Loop through our X displays
    {
      for (j=0;j<8;j++) // Set up rows on current  display
      {      
        byte outputbyte = 0;
   
        curchar = msg[curcharix];
   
        curcharixsave = curcharix;
        curcharbitsave = curcharbit;
      
        for (k=7;k>=0;k--) // Copy over data for 8 columns to current row and send it to current display
        {
          // This byte is the bitmap of the current character for the current row
          byte currentcharbits = Font8x5[((curchar-32)*8)+j];
      
          if (currentcharbits & (1<<curcharbit))
            outputbyte |= (1<<k);
      
          // advance the current character bit of current character
      
          curcharbit ++;
      
          if (curcharbit > lentbl_S[curchar-32]) // we are past the end of this character, so advance.
          {
            curcharbit = 0;
            curcharix += 1; 
            if (curcharix+1 > msgsize) k=-1; //This end the current display
            curchar = msg[curcharix];
            
          }
        }
      
        lc.setRow(i, j, outputbyte);
        
       if (endFlag) return;

        if (j != 7) // if this is not the last row, roll back advancement, if it is, leave the counters advanced.
        {
          curcharix = curcharixsave;
          curcharbit = curcharbitsave;
          if (curcharix+1 > msgsize) endFlag=true; //sets that we are done and exit after the next iteration
        }

      }
    }

  

  
}