Re: searching through an array of strings?
Re: searching through an array of strings? Awesome! That's a huge confidence boost for me, knowing that I understand it enough to be able to give you exactly what you needed. Glad to help. URL: http://forum.audiogames.net/viewtopic.php?pid=260478#p260478 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: searching through an array of strings?
Re: searching through an array of strings? Hey,Thanks for the quick reply!I'm happy to say this is what I was looking for! Thanks a bunch sneak! URL: http://forum.audiogames.net/viewtopic.php?pid=260473#p260473 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: searching through an array of strings?
Re: searching through an array of strings? Look at the help file in the bgt manual on string_contains.Just change it to return string_contains(arrayString[x], "Diana"); That should return the position where the character set starts in the string. URL: http://forum.audiogames.net/viewtopic.php?pid=260472#p260472 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: searching through an array of strings?
Re: searching through an array of strings? hello,This does work, and does partially solve the problem, however I completely forgot to mention I need to find the actual position in the array where the string is found, since that is what I am dealing with. Lol, its what happens when I write posts up in about 5 minutes, rofl.Thanks for the reply sneak! URL: http://forum.audiogames.net/viewtopic.php?pid=260469#p260469 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: searching through an array of strings?
Re: searching through an array of strings? If you mean how to search each entry in the array to see if it contains a phrase or character then yes there is.I realized after posting that I should've commented this out to explain what I'm doing. //This declares the array of type string called arrayString and gives it 5 empty entries.string[] arrayString(5);//The following 5 lines store a string within the array in a unique entry.arrayString[0]="Hi my name is George.";arrayString[1]="Hi my name is Alex.";arrayString[2]="Hi my name is Diana.";arrayString[3]="Hi my name is Bobbie";arrayString[4]="Hi my name is Lewis";//This creates a loop through arrayString and checks each entry for the characters 'diana', I don't recall if the string_contains function is case sensitive or not. It then returns the string that contains the text. You can manipulate this easily enough to return the location of the character in the string as well as the entire string.for(int x=0; x<arrayString.length; x++){if(-1<string_contains(arrayString[x], "Diana", 1)){return arrayString[x];}}Hope this helps! URL: http://forum.audiogames.net/viewtopic.php?pid=260461#p260461 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: searching through an array of strings?
Re: searching through an array of strings? If you mean how to search each entry in the array to see if it contains a phrase or character then yes there is.I realized after posting that I should've commented this out to explain what I'm doing. //This declares the array of type string called arrayString and gives it 5 empty entries.string[] arrayString(5);//The following 5 lines stores a string within the array in a unique entry.arrayString[0]="Hi my name is George.";arrayString[1]="Hi my name is Alex.";arrayString[2]="Hi my name is Diana.";arrayString[3]="Hi my name is Bobbie";arrayString[4]="Hi my name is Lewis";//This creates a loop through arrayString and checks each entry for the characters 'diana', I don't recall if the string_contains function is case sensitive or not. It then returns the string that contains the text. You can manipulate this easily enough to return the location of the character in the string as well as the entire string.for(int x=0; x<arrayString.length; x++){if(-1<string_contains(arrayString[x], "Diana", 1)){return arrayString[x];}}Hope this helps! URL: http://forum.audiogames.net/viewtopic.php?pid=260461#p260461 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
Re: searching through an array of strings?
Re: searching through an array of strings? If you mean how to search each entry in the array to see if it contains a phrase or character then yes there is.string[] arrayString(5);arrayString[0]="Hi my name is George.";arrayString[1]="Hi my name is Alex.";arrayString[2]="Hi my name is Diana.";arrayString[3]="Hi my name is Bobbie";arrayString[4]="Hi my name is Lewis";for(int x=0; x<arrayString.length; x++){if(-1<string_contains(arrayString[x], "Diana", 1)){return arrayString[x];}} URL: http://forum.audiogames.net/viewtopic.php?pid=260461#p260461 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
searching through an array of strings?
searching through an array of strings? Hello all,Is it possible to search through an array of strings using wildcards in bgt?I'm creating a very basic parser, and I need to be able to find where things get placed. I've tried the array.find function, but the value needs to be static for that to work properly.Thanks in advance everyone! URL: http://forum.audiogames.net/viewtopic.php?pid=260451#p260451 ___ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector