off the screen

This is a discussion on off the screen within the C++ Programming forums, part of the General Programming Boards category; i wrtoe a thingy that reads from stats.sav. but when it displaysa all the variables it justassigned and stuff it ...

  1. #1
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608

    off the screen

    i wrtoe a thingy that reads from stats.sav. but when it displaysa all the variables it justassigned and stuff it goes offscreen any suggesstions?
    Code:
    if (menuselect == 1){
    textcolor(RED);
    clrscr();
    Sleep(1000);
       	ifstream fin;
    	fin.open("Stats.sav");
    	if(fin.fail())
    	{
    		cout << "ERROR: Could not find Stats.sav!\n";
            goto menu;
    	}
     	cout << endl;
      	while(getline(fin, szLine))
    		cout << szLine << endl;
    
    	cout << endl;
      	fin.clear();
    
      	fin >> szWord >> player;
        fin >> szWord >> charactertype;
    	fin >> szWord >> health;
    	fin >> szWord >> gold;
        fin >> szWord >> magic;
        fin >> szWord >> attack;
        fin >> szWord >> aim;
        fin >> szWord >> defence;
        fin >> szWord >> weapon;
        fin >> szWord >> shield;
        fin >> szWord >> armor;
        fin >> szWord >> item1;
        fin >> szWord >> item2;
        fin >> szWord >> item3;
        fin >> szWord >> item4;
        fin >> szWord >> item5;
        fin >> szWord >> item6;
        fin >> szWord >> item7;
        fin >> szWord >> item8;
        fin >> szWord >> item9;
        fin >> szWord >> item10;
        fin >> szWord >> item11;
        fin >> szWord >> item12;
        fin >> szWord >> item13;
        fin >> szWord >> item14;
        fin >> szWord >> item15;
        fin >> szWord >> item16;
        fin >> szWord >> item17;
        fin >> szWord >> item18;
        fin >> szWord >> item19;
        fin >> szWord >> item20;
        fin >> szWord >> item21;
        fin >> szWord >> item22;
        fin >> szWord >> item23;
        fin >> szWord >> item24;
        fin >> szWord >> item25;
        fin >> szWord >> item26;
        fin >> szWord >> item27;
        fin >> szWord >> item28;
        fin >> szWord >> item29;
        fin >> szWord >> item30;
    	fin.close();
    
    system ("pause");
    }
    Email: Klinerr1@nc.rr.com || AIM: MisterSako || MSN: sakotheinsane@hotmail.com

    -the shroom has spoken

  2. #2
    Just because ygfperson's Avatar
    Join Date
    Jan 2002
    Posts
    2,493
    i don't understand how it can go offscreen. in the console it should always wrap.

    where do you display the variables? it appears to me that you're reading in every line, and printing it immediately. then you reset the file buffer and read into each variable. you never print out directly from the variables.

    can you give us an idea of what the output screenshot looks like? are you working in a non-console enviroment?

  3. #3
    Sir Mister Insane Sako Klinerr1's Avatar
    Join Date
    May 2002
    Posts
    608
    sure thing here is the exe u gotta create a new game first to make the .sav file then press continue game. the snipet is the entire code for the conitnue game part. press 2 at the beggngin to skip intro press 1 to see it
    Attached Files Attached Files
    Email: Klinerr1@nc.rr.com || AIM: MisterSako || MSN: sakotheinsane@hotmail.com

    -the shroom has spoken

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Render text
    By Livijn in forum C++ Programming
    Replies: 6
    Last Post: 07-06-2007, 03:32 PM
  2. Feedback: Functional Specification Wording
    By Ragsdale85 in forum C++ Programming
    Replies: 0
    Last Post: 01-18-2006, 03:56 PM
  3. char copy
    By variable in forum C Programming
    Replies: 8
    Last Post: 02-06-2005, 09:18 PM
  4. i am not able to figure ot the starting point of this
    By youngashish in forum C++ Programming
    Replies: 7
    Last Post: 10-07-2004, 02:41 AM
  5. Converting from Screen to World Coordinates
    By DavidP in forum Game Programming
    Replies: 9
    Last Post: 05-11-2004, 12:51 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21