#90511 - 2002-12-20 03:26 AM
Re: PostPrep-Test Post , please ignore code
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
j, I'm not sure how much this will save time on your tests but on my code, which still is 76k in size, it saved 20seconds of processor time.
so, this change does not speed up the conversion, just the load. I did some speeding thingies for conversion too but their benefit was not so huge.
anyway, openclick with this code did wonders. readfile() is directly from udf-library.
code:
function btnOpen_Click() dim $FileName, $nl $FileName = $frm.FileOpenDialog("Open",$PathOpen,, "KiX Files|*.kix;*.udf;*.k2k;*.udf|All Files|*.*",1) if $FileName $frm.MousePointer = 11 $lblStatus1.Caption = "" $btnCopy.Enabled = 0 $btnSave.Enabled = 0 $btnClear.Enabled = 0 $txtTarget.Text = "" $txtSource.Text = "" $txtSource.BeginUpdate $txtSource.Text=readfile($Filename,@crlf) if not @error $PathOpen = substr($FileName,1,instrrev($FileName,'\')-1) $ = writeprofilestring($Wordfile,"Global","PathOpen",$PathOpen) $txtSource.EndUpdate $frm.MousePointer = 0 $lblStatus1.Caption = " " + $FileName if $txtSource.Text $btnConvert.Enabled = 1 else $btnConvert.Enabled = 0 endif endif endif endfunction
sorry for exposing part of the code but this seemed to be best way to get the message to you
_________________________
!download KiXnet
|
Top
|
|
|
|
#90512 - 2002-12-20 02:28 PM
Re: PostPrep-Test Post , please ignore code
|
Kdyer
KiX Supporter
Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
|
Mind if I chime in here?
I am getting the following errors:
Converting code: quote:
C:\DOCUME~1\Kent\!KIX>kix32 postprep Script error: expected expression! if ascan($NumFlagChars, $char) > -1
Selecting the color chart: quote:
C:\DOCUME~1\Kent\!KIX>kix32 postprep Script error: expected expression! $e = ascan($CTable, $Colors[$index])
An idea for this on a later implementation -
Have a "recently used" file list for people to go back and grab recent files.
Thanks,
Kent
|
Top
|
|
|
|
#90514 - 2002-12-21 09:18 AM
Re: PostPrep-Test Post , please ignore code
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#90517 - 2002-12-31 01:43 PM
Re: PostPrep-Test Post , please ignore code
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
#90525 - 2003-01-20 03:41 AM
Re: PostPrep-Test Post , please ignore code
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
WORKING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
man I'm happy. wasted the weekend on this but it was worth it... I quess...
it does not understand UDFs yet, so it marks them as unkown (bold operator color)
also, it was a horror to work with ascan and think it has to be fixed to work same way as normal kix functions.
the "stats": quote:
script size: 6010 html size: 22820 execution time: 04:47:21.225 - 04:47:21.736
{edit} due to a request by shawn and les, enabled word-wrap {/edit} and the code:
; ; BBCodeParser - KiXtart Bulleting Board Code Parser ; ; Dependencies: ; Wkix32 - KiXtart 4.12 ; kixforms.dll - KiXForms (version 2.1.1) ; ; -Lonkero ; ; 3.1.1.4 main improvements: ; removed the winhttp from dependencies ; improved parsing ; removed the status display ; $VERSION = "3.1.1.7" $CRLF = @crlf
$form = createobject("kixtart.form") $form.caption = "BBCodeParser" $form.width = $form.screen.width-100 $form.height = 530 $form.center $form.font.name = "arial" $form.font.size = 20 $form.forecolor = $form.rgb(200,200,200) $form.printxy(8,6,"BBCodeParser") $form.forecolor = $form.rgb(51,153,255) $form.printxy(6,4,"BBCodeParser") $form.font.size = 10 $form.font.bold = 1 $form.printxy(185,6,"$VERSION") $form.font.name = "arial" $form.font.size = 10 $form.forecolor = 0 $form.font.bold = 0 $form.printxy(8,48,"Topic:")
$address = $form.textbox $address.top = 45 $address.left = 55 $address.width = $form.width-250 $address.height = 20 $address.text = ""
$download = $form.commandbutton $download.caption = "Download!" $download.top = 42 $download.left = $form.width-175 $download.width = 75 $download.height = 25 $download.onclick = '$$=download() $$edit.text="Choose the script from left panel." $$save.enabled=1 $$print.enabled=1' $download.fontbold = 0 $download.default = 1
$edit = $form.textbox $edit.multiline = 1 $edit.scrollbars=3 $edit.wordwrap=0 $edit.top = 85 $edit.left = 215 $edit.width = $form.width - 220 $edit.height = 365 $edit.text = "Enter the URL of the page you want to retrieve code from to topic field and click download@crlfhint: easiest way is to cut'n paste it from your webbrowser!"
$index = $form.listbox $index.top = 85 $index.left = 5 $index.width = 200 $index.height = $form.height - 120 $index.onclick = '$$edit.text = $$code[$$index.listindex]'
$save = $form.commandbutton $save.top = 465 $save.left = 215 $save.width = 75 $save.height = 25 $save.caption = "Save" $save.onclick = "$$=save($$form.filesavedialog)" $save.enabled = 0
$print = $form.commandbutton $print.top = 465 $print.left = 310 $print.width = 75 $print.height = 25 $print.caption = "Print" $print.onclick = "$$=print()" $print.enabled = 0
$about = $form.commandbutton $about.top = 465 $about.left = $form.width-270 $about.width = 75 $about.height = 25 $about.caption = "About" $about.onclick = "$$=TkAboutBox($$VERSION)"
$exit = $form.commandbutton $exit.top = 465 $exit.left = $form.width-175 $exit.width = 75 $exit.height = 25 $exit.caption = "Exit" $exit.onclick = "$$form.visible=0" $exit.cancel = 1
$form.show while $form.visible $=execute($form.doevents) loop
exit 1
function download() dim $data,$,$c,$httpObj if not instr($address.text,"kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic") $ = messagebox("You didn't give kixBB url-address. This script supports only BB found at kixtart.org!","Usage error",48) return else $page="http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=print_topic"+substr($address.text,instr($address.text,"?ubb=")+14) endif
$httpObj = createobject("microsoft.xmlhttp") $httpObj.open("GET",$page,not 1) $httpObj.send() $data=$httpObj.Responsetext $data=split($data,'<hr />Posted by <b>') for $=0 to ubound($data) $data[$]=split($data[$],'>code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">') if ubound($data[$]) $data[$][0]=left($data[$][0],instr($data[$][0],"</b>")-1) for $c=1 to ubound($data[$]) $index.additem($data[$][0]+" (post #"+$+")") $data[$][$c]=left($data[$][$c],instr($data[$][$c],"</pre><hr />")-1) if instr($data[$][$c],"<") $data[$][$c]=join(split($data[$][$c],"<"),"<") endif if instr($data[$][$c],">") $data[$][$c]=join(split($data[$][$c],">"),">") endif if instr($data[$][$c],""") $data[$][$c]=join(split($data[$][$c],"""),chr(32)) endif if instr($data[$][$c],"<br />") $data[$][$c]=join(split($data[$][$c],"<br />"),@crlf) endif $code=$code+$data[$][$c]+chr(7) next endif next $code=split($code,chr(7)) endfunction
Function TkAboutBox($Version) $former = createobject("kixtart.form") $former.scalewidth = 500 $former.scaleheight = 180 $former.center $former.caption = "About "+$name $former.fontname = "times new roman" $former.fontsize = 14 $former.fontbold = 1 $former.printxy(10,20,"BBCodeParser") $former.fontsize = 8 $former.fontbold = 0 $former.printxy(10,40,"version "+$Version) $former.fontsize = 12 $former.fontbold = 1 $former.printxy(10,60,"created and authored since 2001 By Lonkero") $former.fontsize = 10 $former.fontbold = 0 $former.printxy(20,100,"Special thanks of bringing us kixforms and of great help to Shawn.") $former.printxy(40,120,"Thanks to also Ruud who has given us kiXtart!") $oker = $former.commandbutton $oker.onclick = "$$former.visible=0" $oker.center $oker.top = 150 $oker.left = 400 $oker.width = 75 $oker.height = 25 $oker.caption = "OK" $former.visible=1 while $former.doevents = 1 loop $former=0 EndFunction
function save($file) dim $ if len($file) del $file $=open(1,$file,5) $=writeline(1,"; "+$index.text+" from topic "+$address.text+@crlf+@crlf) $=writeline(1,$edit.text) $=writeline(1,"@crlf@crlf; brought to you by BBCodeParser "+$VERSION+@crlf) $=close(1) $= $$form.msgbox("Code saved In:@crlf"+$file,"note",64) endif endfunction
function print() dim $formi,$ $formi = createobject("kixtart.form") $formi.caption = "BBCodeParser"+$VERSION+" by Lonkero" $formi.width = 450 $formi.height = 100 $formi.center $formi.fontbold = 1 $formi.printxy(10,10,"Printing in Progress...") $formi.visible = 1 sleep 1 $=open(1,"%temp%\BBCodeParser "+$VERSION,5) $=writeline(1,"code:"+$index.text+" from topic "+$address.text+@crlf+@crlf) $=writeline(1,$line) $=close(1) shell "notepad /p %temp%\BBCodeParser "+$VERSION sleep 1 del "%temp%\BBCodeParser "+$VERSION endfunction
[ 20. January 2003, 05:29: Message edited by: Lonkero ]
_________________________
!download KiXnet
|
Top
|
|
|
|
#90527 - 2003-01-20 06:54 AM
Re: PostPrep-Test Post , please ignore code
|
NTDOC
Administrator
Registered: 2000-07-28
Posts: 11624
Loc: CA
|
Okay.. I have a question!
How do you use it? Every page I post into the address bar comes back with an error that it only supports the KiXart BBS.
Here is an example of the URL I posted into it.
http://www.kixtart.org/board/ultimatebb.php?ubb=forum;f=2
Have tried UDFs, other KORG links and they all give the same error.
So... what am I doing wrong?
|
Top
|
|
|
|
#90529 - 2003-01-20 08:05 AM
Re: PostPrep-Test Post , please ignore code
|
Jochen
KiX Supporter
Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
|
|
Top
|
|
|
|
Moderator: Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart
|
0 registered
and 369 anonymous users online.
|
|
|