newest version, which has problem with quote-marks.
As I understood, it's not execute() but kixforms listbox'es additem()-related failure.BB didn't accept it so added it here as text:
;
; BBCodeParser.kix - KiXtart Bulleting Board Code Parser version 2.0 beta2
;
; Dependencies:
; KiXtart 4.01 or later
; KiXForms (build 4)
; Winhttp SDK 5.0
;
; -Lonkero
;
$ = setconsole("hide")
break on
del "%temp%\*.bbcp"
go "%systemdrive%"
cd "\"
gosub "question"
$form = createobject("kixtart.form")
$form.caption = "BBCodeParser 2.0 by Lonkero"
$form.width = $form.screenwidth - 100
$form.height = $form.screenheight - 200
$form.left = 50
$form.top = 30
$form.fontsize = 10
$form.moveto(10,10)
$form.print("Code's Retrieved from topic:")
$form.fontbold = 1
$form.moveto(200,10)
$form.print("$page")
$saveb = $form.commandbutton(150,$form.height-70,150,25,"SAVE this one")
$printb = $form.commandbutton($form.width -300,$form.height-70,150,25,"PRINT this one")
$form.fontbold = 0
$form.fontname = "Arial Black"
$index = $form.listbox(5,40,100,$form.height - 110,"")
$form.fontsize = 8
$form.fontname = "Arial"
gosub "retrieve"
$this = 0
$code0.visible = 1
$form.visible = 1
while $ = $form.getevent()
select
case $index.click
$ = execute('$$code$this.visible = 0')
$this = val(substr($index.text,6,1))-1
$ = execute('$$code$this.visible = 1')
case $printb.click
gosub "print"
case $saveb.click
gosub "save"
endselect
loop
del "%temp%\*.bbcp"
exit
:question
$formQ = createobject("kixtart.form")
$formQ.caption = "BBCodeParser 2.0 by Lonkero"
$formQ.width = 450
$formQ.height = 100
$formQ.left = 100
$formQ.top = 100
$formQ.moveto(10,0)
$formQ.fontbold = 1
$formQ.print("Place Here the URL of the page you want to retrieve code from")
$formQ.fontbold = 0
$pageQ = $formQ.textbox(10,20,350,20,"")
$formQ.fontbold = 1
$buttonQ = $formQ.commandbutton(370,20,50,20,"Get It!")
$formQ.moveto(10,50)
$formQ.fontbold = 0
$formQ.print("Tip: easily done with cut© from your webbrowser's addressbar")
$formQ.visible = 1
do $ = $formQ.getevent() until $buttonQ.click()
$page = $pageQ.caption
$formQ.visible = 0
$formQ = 1
if not instr($page,"http://kixtart.org/cgi-bin/ultimatebb.cgi?")
$ = messagebox("You didn't give kixBB url-address. This script supports only BB found at kixtart.org!","Usage error",48) exit
endif
return
:retrieve
$formr = createobject("kixtart.form")
$formr.caption = "BBCodeParser 2.0 by Lonkero"
$formr.width = 300
$formr.height = 150
$formr.left = ($formr.screenwidth - $formr.width)/2
$formr.top = ($formr.screenheight - $formr.height)/2
$formr.fontsize = 8
$formr.fontbold = 0
$formr.visible = 1
$formr.moveto(10,0)
$formr.print("page Retrieval...")
$formr.fontsize = 10
$formr.fontbold = 1
$formr.moveto(30,20)
$formr.print("Starting Winhttp...")
$httpObj = createobject("winhttp.winhttprequest.5")
if vartype($httpObj) <> 9 ? $ = messagebox("failed to start Winhttp, quitting...","Subsystem Error",16) exit else $formr.moveto(50,40) $formr.print("WinHTTP Started") endif
$httpObj.open("GET",$page)
? if @error $ = messagebox("failed to Initialize Winhttp ( error:@serror ), quitting...","Subsystem Error",16) exit else $formr.moveto(50,60) $formr.print("WinHTTP initialized") endif
$httpObj.send()
$crlf = chr(13)+chr(10) $i=0
$data = $httpObj.Responsetext
$formr.moveto(30,80) $formr.print("Page Transferred")
$formr.moveto(10,100) $formr.print("Parsing Data...")
$x = instr($data,">code:</font><HR><pre>")
while $x <> 0
$data = substr($data,$x+22,len($data)-($x+21))
$x = instr($data,"</pre>") - 1
$post = substr($data,1,$x)
$index.additem("code "+($i+1),$i)
$ = open(1,"%temp%\code "+($i+1)+".bbcp",5) $ = writeline(1,"$page"+$crlf+$crlf)
$ = execute('$$code$i = $$form.listbox(110,40,$$form.width - 120,$$form.height - 60,"")')
$ = execute('$$code$i.visible = 0')
$c=0
for each $section in split($post,"<P>")
for each $line in split($section,"<BR>")
do
$che = ""
if instr($line,"<") $p = instr($line,"<") $line = substr($line,1,$p-1)+"<"+substr($line,$p+4,len($line)-($p+3))
else $che = $che+"1"
endif
if instr($line,">") $p = instr($line,">") $line = substr($line,1,$p-1)+">"+substr($line,$p+4,len($line)-($p+3))
else $che = $che+"1"
endif
until $che = "11"
$ = execute('$$code$i'+'.additem("$line",$c)')
$ = writeline(1,"$line"+$crlf)
$c=$c+1
next
next
$ = writeline(1,""+$crlf+"By BBCodeParser 2.0"+$crlf)
$ = close(1)
$x = instr($data,">code:</font><HR><pre>")
$i=$i+1
loop
$formr.moveto(120,100) $formr.print("Done") sleep 1 $formr.visible = 0 $formr = 1
return
:save
$formQ = createobject("kixtart.form")
$formQ.caption = "BBCodeParser 2.0 by Lonkero"
$formQ.width = 450
$formQ.height = 100
$formQ.left = 100
$formQ.top = 100
$formQ.moveto(10,0)
$formQ.fontbold = 1
$formQ.print("Give path (optional) and filename for this script")
$formQ.fontbold = 0
$fileQ = $formQ.textbox(10,20,350,20,"")
$formQ.fontbold = 1
$buttonQ = $formQ.commandbutton(370,20,50,20,"Save It!")
$formQ.moveto(10,50)
$formQ.fontbold = 0
$formQ.print("note: Omitting the path will save file in %systemdrive%\")
$formQ.visible = 1
$close = 0
while $formQ.getevent() and $close = 0
if $buttonQ.click() copy "%temp%\code "+($this+1)+".bbcp" "$fileQ.caption" $close = 1 endif
loop
$formQ.visible = 0
$formQ = 1
return
:print
$formi = createobject("kixtart.form")
$formi.caption = "BBCodeParser 2.0 by Lonkero"
$formi.width = 450
$formi.height = 100
$formi.left = ($formi.screenwidth - 450)/2
$formi.top = ($formi.screenheight - 100)/2
$formi.moveto(100,45)
$formi.fontbold = 1
$formi.print("Printing in Progress...")
$formi.visible = 1
sleep 1
shell "notepad /p %temp%\code "+($this+1)+".bbcp"
$formi.visible = 0
$formi = 1
return
[ 09 January 2002: Message edited by: Lonkero ]