lol

nice one.
Anyway vectors are pain in the ... After reading all of the documents there is for vectors my head is going to explode but vectorName.clear() and vectorName.resize() nor vectorName.erase(begin, end) vectorName.swap() does not do the job i want. [dont mind the name vectorName its just for argument, and all the calls have their respective values]
So i am in a little confusion. I took values from groups with this code:
for (unsigned i = 0; i < 30; ++i)
{
tgui::EditBox::Ptr Ime = Group1->get("Ime" + tgui::to_string(i));
sf::String ValueIme = Ime->getText();
tgui::EditBox::Ptr Ime1napomene = Group1Napomene->get("Ime" + tgui::to_string(i));
Ime1napomene->setText(ValueIme);
// Code down is irrelevant lets focus on code above.
// Uzmi Prezime iz Group1
tgui::EditBox::Ptr Prezime = Group1->get("Prezime" + tgui::to_string(i));
sf::String ValuePrezime = Prezime->getText();
// Prebaci prezime iz Group1 u Group1Napomene
tgui::EditBox::Ptr Prezime1napomene = Group1Napomene->get("Prezime" + tgui::to_string(i));
Prezime1napomene->setText(ValuePrezime);
// Uzmi BrojTelefona iz Group1
tgui::EditBox::Ptr BrojTelefona = Group1->get("BrojTelefona" + tgui::to_string(i));
sf::String ValueBrojTelefona = BrojTelefona->getText();
// Prebaci BrojTelefona iz Group1 u Group1Napomene
tgui::EditBox::Ptr BrojTelefona1napomene = Group1Napomene->get("BrojTelefona" + tgui::to_string(i));
BrojTelefona1napomene->setText(ValueBrojTelefona);
// Uzmi DatumRodjenja iz Group1
tgui::EditBox::Ptr DatumRodjenja = Group1->get("DatumRodjenja" + tgui::to_string(i));
sf::String ValueDatumRodjenja = DatumRodjenja->getText();
// Prebaci DatumRodjenja iz Group1 u Group1Napomene
tgui::EditBox::Ptr DatumRodjenja1napomene = Group1Napomene->get("DatumRodjenja" + tgui::to_string(i));
DatumRodjenja1napomene->setText(ValueDatumRodjenja);
}
Lets examine it.
tgui::EditBox::Ptr Ime = Group1->get("Ime" + tgui::to_string(i)); << Ime get EditBox named Ime + i
sf::String ValueIme = Ime->getText(); << sf::String get a value.
That code was for transfering from Group1 to Group2. Can i use that sf::String Ime to write it to .txt file? And since its for loop sf::String ime will get diferent values, and each values will be stored in .txt [with std::ios::app ] Which is better solution than this:
EditBoxNames[i] = Group1->get("Ime" + tgui::to_string(i)); // EditBoxNames is vector<tgui::EditBox.....>
GroupNames.push_back(EditBoxNames[i]->getText()); // GroupNames is vector<sf::String>....
saveGroup1Names(GroupNames); // function with iterations to save to file
The only problem is: How to save to file when inputed string is sf::String instead of std::string.
Here is my function to save to .txt when is std::string
void saveIt(sf::String Text)
{
std::ofstream snimi;
snimi.open("Imena.txt", std::ios::app);
for (unsigned int i = 0; i < 30; ++i)
{
snimi << "Name" + tgui::to_string(i+1) + ": ";
snimi << Text;
snimi << "\n";
}
snimi.close();
}