I figured out what the problem was, so in case someone else runs across this post, here is the fix...
success: function (data) {
for (var i = 0; i < data.length; i++) {
var store = Ext.StoreMgr.lookup("stationStore")...
I am creating the following combobox:
//stations store
var stationStore = Ext.create('Ext.data.Store', {
id: 'stationStore',
fields:[{name: 'station'}]
});
the store is build on app load, and is empty to start. At this point the combobox is hidden Once the user runs a search...
Fixed it...it seems that cin>> can leave a trailing \n character that was getting read as an enter key strike...
changing:
cout << "Do you want to search again (Y/N)?" << endl;
cout << "You must type a 'Y' or an 'N' :";
cin >> ans;
To:
cout << "Do you want to search again (Y/N)?" << endl...
Ok, First of all, immense thanks goes to Mark44 for helping step my way through to a solution that appears to work correctly. The code now searches and displays the proper index (working code to follow). The last step is to get the Do you wish to continue logic working. The program runs...
I will rewrite using your suggestions. As for the debugger, I usually do, but I have been having issues with the Dev-C++ IDE and haven't been able to get the debugger to run, which is causing me no end of trouble. Thanks so much for the continued help, I am really trying to get a handle on this...
new code still just returns the first array item infinitely, any pointers Mark?
#include <iostream>
#include <string>
using namespace std;
int mySearch(string songArray[], int arraySize, string songName, int songIndex){
for (int i = 0; i < arraySize; i+1){
cout <<...
Update on requirements... Algorithm must be non-recursive...
I feel like I am almost there, but I am still misunderstanding something about writing the search part of the algorithm. I have included my updated code. Now all it does is continually print the first song in the array infinitely...
Moving forward I will only post the code for the searchForSongs function as everything seems to be right to this point:
int searchForSongs(string songArray[], int arraySize, string songName, int targetSize){
for (int i = 0; i < arraySize; i++){
cout << songArray[i] << endl...
Ok, got rid of the globals, and am now passing everything as params, I will continue to work on this as we go, now to actually splitting the arrays...I am honestly a bit confused about recursion here, but will continue to try to move forward...
NEW CODE:
#include <iostream>
#include <string>...
The following code returns the number of elements in my song array:
sizeof(songArray)/sizeof(string); // Size of the array / size of each element gives the actual size of the array.
Thanks for the pointer, I will keep trying to move forward from here.
Ok, so I have made a bit more progress, but I'm getting stuck on splitting the array still, can anyone point me to the next step?
#include <iostream>
#include <string>
using namespace std;
string songName;
string songArray[] = {"Against the Wind", "Bohemian Rhapsody", "California...
Hi Mark,
thanks for the reply.
To start, I moved all of the search code into a search function as advised... *SEE CODE BELOW*
#include <iostream>
#include <string>
using namespace std;
string songName;
string songArray[] = {"Against the Wind", "Bohemian Rhapsody", "California...
Homework Statement
This is the assignment instructions:[/B]
In C++, code a search algorithm that searches a list of strings for a particular song. The searching algorithm will have two inputs: the playlist, which is a string array that contains a list of songs in alphabetical order; and a...
This was done by design. Part of the requirement was to not allow creation of a department until 3 employees had been added. I agree that the debugging would be simpler, but reqs have to be met. As for the dependencies, I was in a rush and didn't take the time to remove the ide specific...
Thanks Silicon, that was the key. I took this advice:
and swapped out the displayTA and System.out lines. I then modded the displayTA line as follows, and now get the desired output!
Thanks Again!
displayTA.setText("Department ID: = " + d.getDeptID() + "\n" + "Department Name = " +...