Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

The 20 Line Challenge / [DBP] Fast string concatenation (requires Matrix1Utils)

Author
Message
Bored of the Rings
13
Years of Service
User Offline
Joined: 25th Feb 2005
Location: Middle Earth
Posted: 9th May 2018 07:24 Edited at: 1st Jul 2018 10:22
Here is a cut-down version of my fast string concatenation functions which I used in developing my DBO to X exporter program. You can edit the strings, add as many as you like as long as you call ParseString(s$) after each string initialisation. You can of course just have 1 string and set the iter variable to whatever you want to repeat the same string over and over. Managed to get this all in 14 lines.
Oh almost forgot to mention that the code produces a debugfile.text file for you to view the time it took and the concatenated string. On my PC/laptop, normal string concatenation using for .... s$=s$+"text...." next etc, can take up to 44 secs based on the same number of iterations.

The expanded version can now be viewed again on the code snippets board.

[updated 01Jul2018 - removed CalcTotalBytes function. ParseString function returns length of each parsed string]
Professional Programmer, languages: SAS, C++, SQL, PL-SQL, DBPro, Purebasic, JavaScript, others

Login to post a reply

Server time is: 2018-09-23 09:14:58
Your offset time is: 2018-09-23 09:14:58