Could you give me an example of how I would go about using the String::Format function?
Here is the code I have right now. It's just a basic sequential number generator that pulls the starting number, qty of numbers, and output filename from a text boxes.
void MyFrame::OnBtnStart(wxCommandEvent & event) {
int start_number = atoi(txtStartNumber->GetValue());
int qty = atoi(txtQty->GetValue());
const wxString *output_filename = new wxString(txtOutputFile->GetValue());
wxFFileOutputStream output_file_stream( *output_filename );
wxTextOutputStream data_output_stream( output_file_stream );
for(int i = (start_number - 1); i < qty; i++) {
srand(i+1);
data_output_stream << i+1 << 'n';
}
wxMessageDialog dlgFinished(this, _("Number generation complete."), _("Finished"), wxICON_INFORMATION|wxOK, wxDefaultPosition);
dlgFinished.ShowModal();
} |