#90494 - 2002-12-11 10:48 AM
Re: PostPrep-Test Post , please ignore code
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#90503 - 2002-12-11 02:35 PM
Re: PostPrep-Test Post , please ignore code
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
ok, I'll give you an example. this is the code for, you know without word-wrap say how readable your posts are after this:
function existonpath($_file) dim $ for each $ in split(readvalue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment","path")+";"+readvalue("HKEY_CURRENT_USER\Environment","path"),";") if exist($+"\"+$_file) $existonpath=not 0 endif next endfunction
same but little smaller:
function existonpath($_file) dim $ for each $ in split(readvalue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment","path")+";"+readvalue("HKEY_CURRENT_USER\Environment","path"),";") if exist($+"\"+$_file) $existonpath=not 0 endif next endfunction
{edit} forgot the font tags... [ 11. December 2002, 14:44: Message edited by: Lonkero ]
_________________________
!download KiXnet
|
Top
|
|
|
|
#90504 - 2002-12-11 02:39 PM
Re: PostPrep-Test Post , please ignore code
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#90510 - 2002-12-18 08:48 PM
Re: PostPrep-Test Post , please ignore code
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
Well well well my friends,
You want to see the Code ? It's (still) Alpha code which I am not very proud of !
The story of the last days :
Shawn gave me the tip not to take the Output Textbox as buffer but a string variable ... That cut down the conversion time for the 600 lines (only strings and comments highlighted) from somewhat over 5 minutes down to 35 seconds (You never know how darn slow that COM business can be)
Then while pushing the code forward to convert also Commands, Functions, Macros (Operators left to do, plus double occurances of Keyword per line not handled) I decided to take an Array of strings as buffer, which increases performance once again (converted 650 lines in 12 seconds)
Now the actual code has got this ability but (by implementing commands, macros, functions) it slowed down to convert itself (821 lines) in 1 minute 20 seconds
I am not happy with it (especially that it needs 128 kb when saved as html file !)
Will spend some time at my In-Laws untill after 26th.
Hopefully I have some time afterwards for rebuilding the Conversion algorithm(or should I say 'routine' )
If you want the code, just send me an email, I'll see If I find the reply button
J. [ 18. December 2002, 20:49: Message edited by: jpols ]
_________________________
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 369 anonymous users online.
|
|
|