A way to set a position in a string

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
albert_redditt
User
User
Posts: 14
Joined: Mon Jul 20, 2009 9:29 pm
Location: Santa Barbara California US

A way to set a position in a string

Post by albert_redditt »

I'm working on a calculator for long strings and i have to add the strings backwards and then loop through and reverse the string into another string.

a reverse string function would be nice also.
and a qbasic like mid$(string,position) = character or string would be nice.
User avatar
Demivec
Addict
Addict
Posts: 4260
Joined: Mon Jul 25, 2005 3:51 pm
Location: Utah, USA

Re: A way to set a position in a string

Post by Demivec »

albert_redditt wrote:...and a qbasic like mid$(string,position) = character or string would be nice.
If only in need of replacing portions of a string and not increasing or decreasing the length of a string, then the advance function CopyMemoryString() can be used.
albert_redditt
User
User
Posts: 14
Joined: Mon Jul 20, 2009 9:29 pm
Location: Santa Barbara California US

Thanks i guess??????

Post by albert_redditt »

I already got the mul procedure working

i just added the strings right to left and then reversed the string.

its not pretty code but on a 2GHz dual core it blazes.

I posted the mul procedure here on the boards somewhere.

its two topics above the tailbite forum.
User avatar
Michael Vogel
Addict
Addict
Posts: 2797
Joined: Thu Feb 09, 2006 11:27 pm
Contact:

Re: Thanks i guess??????

Post by Michael Vogel »

albert_redditt wrote:I already got the mul procedure working

i just added the strings right to left and then reversed the string.

its not pretty code but on a 2GHz dual core it blazes.

I posted the mul procedure here on the boards somewhere.

its two topics above the tailbite forum.
Nice start :!:
You may want to have a look at a thread called "Huge #'s" where some people also tried to write fast routines which handle huge numbers...

Michael
Post Reply