Page 3 of 6 <12345>Last »
Topic Options
#90511 - 2002-12-20 03:26 AM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
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 [Razz]
_________________________
!

download KiXnet

Top
#90512 - 2002-12-20 02:28 PM Re: PostPrep-Test Post , please ignore code
Kdyer Offline
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
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#90513 - 2002-12-21 09:17 AM Re: PostPrep-Test Post , please ignore code
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Kent,

Sure thing that it failed !

This was one of the reasons I didn't make it public yet : It uses intrinsic 4.20 Alpha ascan() ...

The development is somehow stopped until after 26th of december as I am about to leave to visit my Mother-in-law with the family ...

Please expect the following modifications in the first Beta release of UBB PostPrep :

-> Optional colorizing for defined Keyword families (Just like Shawn did only specified a 'color' for Commands and Functions, but the others were in fact colored 'black' -> this will be skipped as selected in next release)

-> Option page for Output, like 'Horizontal Line?' , Font , Fontsize etc ...

Now for the last Time : Have a nice Christmas my friends ! Be careful when driving (especially you Jooel [Wink] ), hope to see you all back then

Jochen
_________________________



Top
#90514 - 2002-12-21 09:18 AM Re: PostPrep-Test Post , please ignore code
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Jooel,

I will definitely have a look on the open thing (after Christmas of course ... I don't think that it'd be a good Idea too take my Notebook with me [Roll Eyes] [Eek!] [Frown] )
_________________________



Top
#90515 - 2002-12-31 03:20 AM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
j, you still living in the kixmas? it's over, if you didn't know [Razz]
_________________________
!

download KiXnet

Top
#90516 - 2002-12-31 03:25 AM Re: PostPrep-Test Post , please ignore code
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Guess that'd depend on whether one follows the Gregorian or Julian calendar...
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#90517 - 2002-12-31 01:43 PM Re: PostPrep-Test Post , please ignore code
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Nah,

The Julian is out of date ... we all live (except maybe in regions I don't know) after the Gregorian one [Wink]

Yeah, KiXmas is over (Thank God for that)

But now it's Sylvester time ...

be back in 2003 [Roll Eyes]

J.

btw.: I didn't even manage to have a look on it [Frown]
_________________________



Top
#90518 - 2003-01-03 06:03 PM Re: PostPrep-Test Post , please ignore code
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Jooel,

In reply to your readfile snippet above:

In the mean time I had the same speed increases by just preventing to use the TextBox as Read buffer (yeah , same old story with slow COM [Roll Eyes] )

J.
_________________________



Top
#90519 - 2003-01-19 07:49 AM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, I could not make any sense of your code so, I did my own.
hope you will be some day awake at the same time so could check these.
surely, as you colorize all those control chars too, the size of file increases...
anyway, here is something.
currently only colors vars, comments and text.

{edit}
surely board screwed everything up...

[ 19. January 2003, 07:50: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#90520 - 2003-01-19 07:54 AM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, other style abandoned too...

this board seems to dislike me...
_________________________
!

download KiXnet

Top
#90521 - 2003-01-19 01:48 PM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
ok, newist shit.
time is increasing what more I add there.
still lacks coloring on functions and commands...
I decided also to skip colorizing the operands as that would double the size once again.
{edit} j, what was the issue with this line spacing ???? {/edit}
can't post that code which ran for 4s as it's not public.
anyway, this 5,9k file took les than second:

{edit 2}
removed the code to fasten up the load of the page.

[ 20. January 2003, 04:17: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#90522 - 2003-01-19 01:50 PM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, it seems pretty much ok...
that bloody line-spacing gets me [Mad]

also better colors could do [Wink]
_________________________
!

download KiXnet

Top
#90523 - 2003-01-20 02:55 AM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
k, jochen... ran my udf against postprep:
quote:
start size:38343
html size:154219
execution time:03:54:51 - 03:54:56

it is not inbuild currently, just made it work as standalone udf.

{edit}
removed the code to fasten up the load of the page.

[ 20. January 2003, 03:54: Message edited by: Lonkero ]
_________________________
!

download KiXnet

Top
#90524 - 2003-01-20 02:56 AM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
bad colors I have used...
and seems that there might still be a bug or 2...
_________________________
!

download KiXnet

Top
#90525 - 2003-01-20 03:41 AM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
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],"&lt;") $data[$][$c]=join(split($data[$][$c],"&lt;"),"<") endif
       if instr($data[$][$c],"&gt;") $data[$][$c]=join(split($data[$][$c],"&gt;"),">") endif
       if instr($data[$][$c],"&quot;") $data[$][$c]=join(split($data[$][$c],"&quot;"),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
#90526 - 2003-01-20 04:26 AM Re: PostPrep-Test Post , please ignore code
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
wow - all that took less than a second to colorize ?
Top
#90527 - 2003-01-20 06:54 AM Re: PostPrep-Test Post , please ignore code
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11623
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
#90528 - 2003-01-20 07:01 AM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
you mean the bbcodeparser?

not sure it even has a working code [Razz]

just found one script that was long enough for testing and used it [Wink]

please see topic.

what comes to codeparser, it is seriously in need of re-writing.
wrote a new version some months ago but no one knows does it even work with current board software...
_________________________
!

download KiXnet

Top
#90529 - 2003-01-20 08:05 AM Re: PostPrep-Test Post , please ignore code
Jochen Administrator Offline
KiX Supporter
*****

Registered: 2000-03-17
Posts: 6380
Loc: Stuttgart, Germany
Lonk ,

where have you been the whole Saturday ?
Anyway, seems to happen that it was a good choice to send the stuff to ya [Eek!]

Why did you colorize $vars ?? That is something I won't do (ok, I am a bit hooked to the colorize in my uedit [Wink] )

What did you change anyway ? Send the crap back please !

[Big Grin]

J.
_________________________



Top
#90530 - 2003-01-20 08:18 AM Re: PostPrep-Test Post , please ignore code
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
I just somehow passed out... weird effect with that vodka.

your code actually was so hard for me to understand that re-wrote the kix2html-converter totally.

will send it you at once as these network problems stop and I get a change.
_________________________
!

download KiXnet

Top
Page 3 of 6 <12345>Last »


Moderator:  Shawn, ShaneEP, Ruud van Velsen, Arend_, Jochen, Radimus, Glenn Barnas, Allen, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 557 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.09 seconds in which 0.041 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org