02-23-2005, 09:53 PM
This may have already been done and I haven't seen it (if it has let me know where).....
One thought might be to put a sticky post on the forum for each catagory of routines (String Manip, Math, Sound, etc) and let people post their routines for others to cut-n-paste. This idea came to me as I was doing a Replace function for a math parser I'm working on.
Just a thought
One thought might be to put a sticky post on the forum for each catagory of routines (String Manip, Math, Sound, etc) and let people post their routines for others to cut-n-paste. This idea came to me as I was doing a Replace function for a math parser I'm working on.
Just a thought
Code:
Function Replace(Expression as string, Find as string, WithWhat as String) as string
dim FirstHalf as string
dim SecondHalf As String
dim Length as integer
dim TExpression as string
dim Where as integer
Length = Len(Find)
TExpression = Expression
Where = instr(TExpression,Find)
do while Where <> 0
FirstHalf = left$(TExpression,Where-1)
SecondHalf = Right$(TExpression,len(TExpression)-(Where+Length-1))
TExpression = FirstHalf + WithWhat + SecondHalf
Where = instr(TExpression,Find)
loop
Replace = TExpression
end function