Page 1 of 2 12>
Topic Options
#206691 - 2013-02-17 12:30 AM New Forum Member needs help on using postprep
applitude Offline
Fresh Scripter

Registered: 2013-02-14
Posts: 18
Loc: Cologne, Germany
Hello,

my name is Andre and i'm a new member of this forum. I've been using KiXtart for more than 10 years for a lot of administrative tasks.

Now i want to submit some UDF's to the UDF Scripting Forum. I've read the Guidelines and download ppcl.kix (2.1.0.2). After this, i've converted my UDF into html by using postprep. BTW, seems to me that ppcl.kix (2.1.0.2) does not run with KiXtart 4.63. ppcl.kix starts but never ends (hang) with this KiXtart Version.

Now i've tried to create a new Post in the UDF Forum. I use the code-Tags and put the html-code between them. Then i choose "using HTML and UBBCode" as Markup. To ensure that i've made no mistakes, i press the "Preview Post"-Button. But the preview always shows the native html-code.

What did i wrong?

TIA
--
Andre
_________________________
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. (Bertrand Russell)

Top
#206692 - 2013-02-17 01:27 AM Re: New Forum Member needs help on using postprep [Re: applitude]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
the preview rarely works right.
for a simple test I just made, the preview showed wrong with HTML but right with UBB+HTML.

I wouldn't worry about the postprep anyways, as:
a) the board is better with code tags nowadays
b) the udf-site http://www.kixtart.org/udf works perfect, even if the board fails
c) korg has coloring with the code-tags enhancement, if you want colors. inside code-tags insert [postprep] tag as well, and your code will be pimped out
_________________________
!

download KiXnet

Top
#206693 - 2013-02-17 03:28 AM Re: New Forum Member needs help on using postprep [Re: Lonkero]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Andre,

PPCL.KIX is PostPrep for Command Line, PostPrep.kxw is the GUI.

Posting of PostPrepped code should be done in HTML Only mode to avoid any issues. DO NOT use code tags - just paste the HTML directly into the posting window. If you want any text before your post, you will need to format it with HTML tags, not BBCode.

If you don't have .KIX registered with Kix32, run the following, starting with nothing but a command-prompt open on your desktop (all other windows minimized):
 Code:
kix32 ppcl.kix -s:myscript.kix -o:myscript.htm
On my system, using the ppcl.kix command as "myscript", the task took 5.33 seconds to process using 4.62. It does hang with 4.63 - this is the first time it's been reported as such - I'll look into the issue.

If you use the -c option, PPCL will load the HTM content into the clipboard for pasting directly into a KORG post. This requires IE to be configured to allow external apps to use the clipboard function. If you don't allow this, a dialog box may appear asking you to allow the copy operation. By running with all other windows minimized, you have a better chance of seeing this prompt. You may need to move your command window to see it.

You can allow this automatically by opening IE properties and editing the appropriate security setting: Scripting / Allow Programmatic Clipboard Access - ENABLED.

The PostPrep.kxw file is a Kix script usually run with WKix32 and is a GUI-based tool - you can load/past a script, see a preview, and copy the HTML content for pasting into a post. The latest version restricts the size of the preview. Save the file as HTML and open in IE to see the full display.

PPCL is designed for automation. For example, I run a PPCL command via scheduled task on my primary web server. It has 2 parameters in the PostPrep.ini file that define the location of all the UDFs and the destination for all the post-prepped output. This generates PostPrepped content of my entire Kix UDF library every night for use on my web site. It runs every night at 10pm (EST).

For now, run PPCL or PostPrep with Kix version 4.62.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206696 - 2013-02-17 06:56 PM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
applitude Offline
Fresh Scripter

Registered: 2013-02-14
Posts: 18
Loc: Cologne, Germany
Glenn,

thanks for your quick and detailed answer! Maybe my English is too bad, but i had no problems in using ppcl.kix (except, that it won't run with 4.63 :-)

After reading Lonkero's answer, i decided to use only code-tags to publish my UDF's. My mistake was, that i thought, that only postprep-prepared code will be colorized if someone clicks the postpop-icon.

Nevertheless, your answer was helpful. Now i understand the main purpose of ppcl.kix much more better. I think i will use it the same way as you: preparing my scripts before publishing them on my own website.

So i've already made some tests with the ppcl.kix. By doing this, i may detect another small bug. After changing some colors and attributes in the postprep.ini, i saw that the operators are not formated in any way. May i'm wrong, but the KiXtart Documentation defines operators as "+", "-", ..., "and", "or", etc.

Regards
--
Andre
_________________________
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. (Bertrand Russell)

Top
#206697 - 2013-02-17 08:19 PM Re: New Forum Member needs help on using postprep [Re: applitude]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
I understood you OK - its just that not everyone is aware of PPCL. Most people are more familiar with the PostPrep GUI tool.

I actually have a newer version of postprep internally. I'll look at the issues with 4.63 and the operator tagging today. I'll post an update as soon as I can resolve the issues.

The one major difference between using code tags and PostPrepped code in HTML postings is that code tags will require you to scroll the code window rather than the entire browser window.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206698 - 2013-02-17 08:41 PM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
applitude Offline
Fresh Scripter

Registered: 2013-02-14
Posts: 18
Loc: Cologne, Germany
 Quote:
I actually have a newer version of postprep internally. I'll look at the issues with 4.63 and the operator tagging today. I'll post an update as soon as I can resolve the issues.

That would be great! Thanks Glenn!

Andre
_________________________
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. (Bertrand Russell)

Top
#206699 - 2013-02-17 09:12 PM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Just a quick update from my notes - even though Operator format tags can be specified, my notes indicate that such support was dropped because certain characters had to be filtered due to HTML conflicts. I'll revisit this when I have time, but for right now, no operator colorizing is possible.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206700 - 2013-02-17 10:06 PM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Andre

Please download the updated PostPrep.kix file from my web site. Let me know if it works for you. If it does, I'll upload it to KORG and replace the current version.

I'll give some thought to handling the operators...

Thanks!

Glenn

PS - not sure if it was an error with earlier versions or the new version is just more strict, but with Kix 4.63, the Do / Until was looping forever because it did not find the end of line char. I updated each of the detectors to use a combination - If Instr() Or $Cp >= $Ll
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206701 - 2013-02-17 10:47 PM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
applitude Offline
Fresh Scripter

Registered: 2013-02-14
Posts: 18
Loc: Cologne, Germany
Glenn,

Wow, that's what i call a "quick" response! The new version works fine with KiXtart 4.63. I've converted 4 scripts into html-code without any problems.
 Quote:
... my notes indicate that such support was dropped because certain characters had to be filtered due to HTML conflicts.
Well, i think that's really a problem! There are a lot of operators that require a special script handling (<>&=)! So don't hurry! The operator handling would be nice, but it's not really important.

Greetings from Germany
--
Andre
_________________________
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. (Bertrand Russell)

Top
#206702 - 2013-02-17 10:54 PM Re: New Forum Member needs help on using postprep [Re: applitude]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Thanks - I've tested it with 4.62 and 4.63 and get the same output now.

The <. >, and & are the real problems as they are significant to the HTML that we are converting to. I might have a way around that since I am filtering them out of the source, but will need to tinker for a bit.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206703 - 2013-02-18 01:17 AM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Actually, I found a problem.. the end of clauses aren't being highlighted (else, endif, etc..) and the last char of highlighted tokens at the end of a line are omitted from highlighting. This needs a tad more work...
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206704 - 2013-02-18 01:47 AM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
applitude Offline
Fresh Scripter

Registered: 2013-02-14
Posts: 18
Loc: Cologne, Germany
 Quote:
...the end of clauses aren't being highlighted (else, endif, etc..)
Oops, you're right. Didn't see this! Next time i'll have to test the output more carefully, sorry.

Andre
_________________________
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. (Bertrand Russell)

Top
#206705 - 2013-02-18 02:22 AM Re: New Forum Member needs help on using postprep [Re: applitude]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Andre,

OK - it's fixed, AND the operators are now supported! \:\)

The problem came down to > vs >=

I updated the link on my web site with the latest version. The following operators are supported for highlighting: "+ - * / & < = > And Or Not Mod"

Give it another whirl and let me know. I tested this by editing the postprep.ini file, setting the background to white, and setting all attributes to black (#000000). Then I set one attribute to a bright color and ran PPCL. I was able to confirm that all of the targeted objects were highlighted. I repeated this by setting the attribute color for each object in sequence, overwriting the htm file that was generated. A simple refresh in the browser showed the differences. I'm pretty comfortable that all objects are supported and the PostPrep command works with all current versions of Kixtart.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206708 - 2013-02-18 03:32 AM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
applitude Offline
Fresh Scripter

Registered: 2013-02-14
Posts: 18
Loc: Cologne, Germany
Glenn,

i've tested the new ppcl.kix the same way as you did, by changing the color attributes successively. Here are what i found out:
  • Numerics in Hex-Notation are not formated correctly
  • Of course, you did not list them, but the "|", "~" and "^" are not formated as bitwise operators. Any reason for this? You've done it for the more complicated bitwise "&" ;\)
All others code parts are formated exactly as expected. Well done!

Andre
_________________________
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. (Bertrand Russell)

Top
#206709 - 2013-02-18 05:09 AM Re: New Forum Member needs help on using postprep [Re: applitude]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
"|", "~" and "^" ??? I just forgot about those. they should be easy enough to add to your code to verify. Look for the $Ops string definition and add them to the list. The resulting string should look like this:
 Code:
$Ops = "-+*/=~^|" + $1 + $2 + $3
It's right near the top of the Kix2Htm function. I've updated the function in the library.

I'll look at the Hex number format tomorrow - it's late now. I'll probably need to add a complete processing section to identify the start of a hex value and read it through to a termination char, much like how the Macros are processed. Should be ready tomorrow.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206711 - 2013-02-18 05:28 AM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
OK - I need some ideas..

"&" is a bitwise operator and as such is in the $Ops list. It is also the tag for a hex value.

Can I be sure that bitwise comparisons require spaces around the operator? In testing, "3 & 6" properly results in "2", while "3&6" results in "36", which I did not expect. Is the latter actually evaluated as "3" followed by "&6"?

So - if I parse this as "&" followed by space is an operator, but followed by 0-9,a-f is hex - is this a reasonable assumption?

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206713 - 2013-02-18 05:56 AM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
Lonkero Administrator Offline
KiX Master Guru
*****

Registered: 2001-06-05
Posts: 22346
Loc: OK
indeed that is exactly it.
_________________________
!

download KiXnet

Top
#206714 - 2013-02-18 06:49 AM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
applitude Offline
Fresh Scripter

Registered: 2013-02-14
Posts: 18
Loc: Cologne, Germany
Sorry Glenn,

but it seems that changing the line to
 Code:
$Ops = "-+*/=~^|" + $1 + $2 + $3
in the Kix2HTM Function will not mark the ~^| as operators.

Andre
_________________________
The trouble with the world is that the stupid are cocksure and the intelligent are full of doubt. (Bertrand Russell)

Top
#206719 - 2013-02-18 04:41 PM Re: New Forum Member needs help on using postprep [Re: applitude]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
OK - a new day and freshly charged brain cells has helped!

Adding those characters to the $Ops string was only part of the process. They needed to be added to the two termination strings as well ($T1 & $T2) as well.

With the newest code, all of the operators are now colorized as expected. Further, treating the "& " sequence as a bitwise operator allowed me to process the "&" character that is followed immediately by non-space chars as a number lead-in. Both numbers and Hex values are displayed using the number format attributes. Note that actual checking of hex values is NOT performed, and "&FunnyStuff" would be formatted as a hex number. This ain't the Sanity function after all. ;\)

Latest ZIP is on the web site as before. I used the following simple but nonsensical Kix script to validate the attribute processing:
 Code:
; sample file to test PostPrep

Quit 0	; don't allow this to actually run!

Break On

; numbers and variables
; logic operators
If $A > 2 Or $A < 5 And Not $A = 3
; bitwise operators
  $A = $A & 5 | 1
  $A = $A ^ 2
  $A = $A ~ 2
EndIf

; commands and functions with single and double-quoted strings
If Exist('file')
  "found!"
Else
  $ = RedirectOutput('file')
  "No longer an empty file!" + @CRLF
  $ = RedirectOutput('')
EndIf

; numbers, math operators, & Mod
$A = 3 + 5 - 2 * 4 / 7
$A = $A Mod 5

/*
Block
comment
*/

; Hex values
$A = &C7

; Macros
@TIME ?
The latest Kix2Htm should be published on our web site's UFL library after 10pm EST today.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#206720 - 2013-02-18 04:45 PM Re: New Forum Member needs help on using postprep [Re: Glenn Barnas]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
BTW - Andre...

10 years using Kix and you just joined us this week??? You have a LOT of catching-up to do! \:D

Welcome to KORG!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
Page 1 of 2 12>


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

Who's Online
1 registered (mole) and 1300 anonymous users online.
Newest Members
Viginette, ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder
17888 Registered Users

Generated in 0.08 seconds in which 0.032 seconds were spent on a total of 14 queries. Zlib compression enabled.

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