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.

Code Snippets / right justify text

Author
Message
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 19th Mar 2004 11:19
simple aint it



"eureka" - Archimedes
zircher
21
Years of Service
User Offline
Joined: 27th Dec 2002
Location: Oklahoma
Posted: 19th Mar 2004 19:18 Edited at: 19th Mar 2004 19:20
Nifty, I can see some uses for that. I was playing with Mojo World Transporter and during initialization it used a right justified HUD like scrolling window for the system messages.
--
TAZ

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 24th Mar 2004 14:57
Even simpler ...



*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 24th Mar 2004 16:54
oooo, a space$() command. I didn't know that was there. But what if you wanted to fill the space in with a different character?

"eureka" - Archimedes
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 26th Mar 2004 23:44
Dunno - let me play a while

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 27th Mar 2004 00:18 Edited at: 27th Mar 2004 00:19
Well, first I tried this



Result? Abysmal speed

Next, I tried to see what effect the windows message checking had on the speed by changing the while loop into a for loop.



Then I decided to skip all that crap ...



Build a string the fast way (using space$) and then blat the right characters over the top.

The timing results on my PC for building 1000 strings of 100000 characters in length ...

1 - 6310 ms
2 - 5167 ms
3 - 931 ms

[EDIT]The last one needs my Utility plug-in[/EDIT]

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Mar 2004 00:08
i was gonna say, whats that fill memory? I thin i got your plugin.

"eureka" - Archimedes
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Mar 2004 13:56
FILL MEMORY is a standard DBPro command. You just need my plug-in to get the address of the string in memory (get string ptr).

*** Coming soon - Network Plug-in - Check my site for info ***
For free Plug-ins, source and the Interface library for Visual C++ 6, .NET and now for Dev-C++ http://www.matrix1.demon.co.uk

Login to post a reply

Server time is: 2024-05-12 20:12:34
Your offset time is: 2024-05-12 20:12:34