Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
create a function...
#1
Create a function with the following specifications:

*It checks for the existence of any of a set of strings inside one position of a string.
*It takes this form:

INSTRMULTI%(startlocation%, stringarray$(), stringtosearch$)

1) startlocation% is the starting search location inside stringtosearch$.
2) stringarray$() are the strings to search.
3) Two values result:
INSTRMULTI%, the search location.
stringindexfound%, the index position of the first string found. Strings should be sorted alphabetically, A-Z, and on size, smallest first.

Optional:
Make stringindexfound%() an array, so that if there is more than one string found at the first location, the array gives all the index values of all the strings found.

*********
Important
*********

This wouldn't be much of a challenge if you only used INSTR and compared the results inside the function. That's inefficient. The function should not search the same character in a string twice or more!

*******
Prizes
*******

Satisfaction that you created a good time-saving function...
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."

Visit www.neobasic.net to see rubbish in all its finest.
Reply


Messages In This Thread
create a function... - by Agamemnus - 10-12-2005, 08:15 PM
create a function... - by Antoni Gual - 10-13-2005, 03:20 PM
create a function... - by Antoni Gual - 10-13-2005, 04:50 PM
create a function... - by Agamemnus - 10-13-2005, 11:22 PM
create a function... - by Antoni Gual - 10-14-2005, 12:37 AM
create a function... - by Agamemnus - 10-14-2005, 02:07 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)