Interactive PowerBasic Forum

IT-Consultant: Charles Pegge => OxygenBasic => Topic started by: Pierre Bellisle on February 02, 2023, 08:18:12 AM

Title: Kick - o2 precompiler
Post by: Pierre Bellisle on February 02, 2023, 08:18:12 AM
If anybody is interested in a precompiler utility, here is Kick.
It serve as an interface between an editor and co2.exe.
Editor that have a jump to line / column option when a coding error is detected are: UltraEdit, PsPad, and NotePad++.
Some may be added in the future if any request.
Kick offer multiples possibilities, from Kick.zip, read KickHelp.rtf

Kick.zip MD-5 checksum: C32A532BE74EFD24D14917A448E5F423

About KicK precompiler  by Pierre Bellisle.

Kick.exe is a precompiler program that stand between a code editor like UltraEdit or NotePad++ and Charles Pegge's Oxygen o2 Just-in-time compiler. The editor call Kick with a command line, and Kick call the compiler with an often reworked command line.
Kick is aware of the GoRC resource compiler and can call it to create a .res from a .rc.
Kick get most of is directives from the main .o2bas file wich is convenient.
It will propose to end active exe that stop the compiler to create new .exe/.dll. It will do a sound or shake the Editor window to confirm that a compilation was successful if no run command is given, this is less intrusive than a MessageBox. You may disable sound and shake by editing Kick.ini and set SoundEnable and/or ShakeEnable to zero.
You may also disable the splashscreen by editing Kick.ini and set the milisecond SplashTime to 0.
Source .o2bas files may be ANSI Code Page, UTF8, UTF16LittleEndian.
Kick.exe might be compress with Markus Oberhumer, Laszlo Molnar & John Reiser UPX.

Directive from the editor:
Usually the easiest way is to have the editor give the .o2bas or .bi, or .rc filename none or a few switch.
For example the "Compile32" command line from the editor: -32 "D:\O2\SomeCode.o2bas"
All fileNames must be between double-quotes. Full path is strongly suggested. Switches may be anywhere and space are optionnal.

Switches are:
-mem32 (-m) {Run in memory as 32bit, no switch at all give same result}
-32    (-3) {Compile 32 bit to file}
-64    (-6) {Compile 64 bit to file}
-run   (-r) {Run compiled exe}
-dll   (-d) {Compile a DLL}
(-a, -b, -c, and -i are ignored, original -m is managed by Kick)
Switches are not case sensitive.

FileNames:
.o2bas, .bi, .rc .inc {Main full filename to work on, or secondary if (KickUseDirectivesFrom) redirection is used}
.exe                  {Optional alternative exe full filename}
.res                  {Optional .res resource file}
If full filename are not given, Kick may complete with the informations it have)

Redirection:
The Kick directives are usually in the main .o2bas file. You may use (KickUseDirectivesFrom) redirection in many case. The advantage is that you do not have to switch the Editor from file to file to compile your project.
Example, in a .rc or .inc or .bi you could have the line: // KickUseDirectivesFrom "D:\O2\SomeCode.o2bas". This will cause Kick to stop reading this file and read SomeCode.o2bas for compilation directives. This way you concentrate on coding, not switching files in the Editor.

Redirections may be up to 15 level, Example:
SomeCode15.o2bas redirect to SomeCode14.o2bas, (// KickUseDirectivesFrom "D:\o2\SomeCode14.o2bas" // Optional comment)
SomeCode14.o2bas redirect to SomeCode13.o2bas, (// KickUseDirectivesFrom "D:\o2\SomeCode13.o2bas" // Optional comment)
...
SomeCode02.o2bas redirect to SomeCode01.o2bas, (// KickUseDirectivesFrom "D:\o2\SomeCode01.o2bas" // Optional comment)

Directives:
The directives start with double-slash and have the "Kick" prefix.
You may add comments after a second double-slash on the same line.

Kick directives examples:
// KickCompiler "D:\o2Old\co2.exe" // Use another Compiler/Folder, like for another o2 version
// KickResource "SomeFile.res" // Integrate this resource file in compilation
// KickExeFileName "SomeCodeToTry.exe" // Optional exe/dll FileName
// KickSwitch -mem32 -32 -64 -run -dll  // See switch above (No switch mean -mem32)
// KickExeArgument "SomeArgCommandLine" // Command line to give to starting .exe
// KickLog // Log from Kick.exe for debug purpose
// KickHelp // Show this help
// KickOxyLog // Show Oxy text log
// KickUseDirectivesFrom "D:\Dev\o2\SomeOtherFile.o2bas" // Tell Kick to use directives from another file.
// KickEnd // To save time, Kick will not search Kick info passed this point
   .rc file only support KickUseDirectivesFrom and KickEnd.

.rc and .res compilation
If you compile a .rc, result will be .res file.
If you compile a .o2bas with an .res in // KickResource, then the exe will be compiled including the .res
If you compile a .o2bas with an .rc in // KickResource, the .res file will be compiled, and then the exe will be compiled including the .res.

Bitness feature:
If Pause key is down or Scroll-Lock is on when calling Kick, then the bitness of the exe/dll will be changed.
Aka: if a -32 swicth is found, 64bit will be used and vice-versa
This feature may be removed in the future.

O2 compiler directive:
Kick will respect the next directives
$ dll               
$ FileName "D:\o2\SomeCode.exe" 
#file "D:\o2\SomeCode.exe"
include "RTL32.inc"
include "RTL64.inc"

TextViewer.exe is used to show log and this help, it should be kept in the Kick folder.

Special keys
From your IDE, if you hold the PAUSE or the Left-WINDOW key down
while clicking your compile or compile/run button then the bitness will be flipped,
meaning, 32 bit option will become 64 and vice-versa.
Same effect if SCROLL-LOCK is on.
SHIFT key down force a run in memory 32

Splash screen
You may right click on the splash screen to keep it running or left click to end it.
To change the timeout, edit the Kick.ini [Properties] miliseconds SplashTime field.
Zero (0) mean no splash screen, maximum value is 10,000  for 10 seconds.

Freeze
You may put a shortcut to Kick.exe on the desktop.
In certain case, if Kick freeze the editor, then starting it again it will try to auto terminate.
--------------------------------------------
Title: Re: Kick - o2 precompiler
Post by: Theo Gottwald on February 11, 2023, 08:00:13 PM
This looks like it should be added to the Compiler.
Unless you want to enhace it to a Preprocessor that will also make changes in the code.
Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on February 21, 2023, 07:01:29 AM
Hi Theo,

Can you elaborate on "enhance it to a Preprocessor that will also make changes in the code."
What do you mean precisely?
Title: Re: Kick - o2 precompiler
Post by: Theo Gottwald on February 25, 2023, 02:12:43 PM
Hahaa
Anybody has a unique idea of Commands and improvements he would like to add to any Compiler out there.

Me for example have a long liust of stuff i would like to aadd to Powerbasic, for example an optional
"INIT and Destroy" option for Variables, Procedures and this is just one thing.

This can be added in the compiler, but a lot of stuff can also be done by an intelligent pre-processor, which can first "Pre-Process" the code and then write the final to to be compiled.

If you have an own Editor you can even give this new language a new name and Filetype.
That would be the next step ... if you are so far :-)

Then you can start and make your own enhancements.
Then the question is, which enhancements you would like.

If you have your own Editor "On Top of (whatever)" you can make your own enhancements using a Pre-Processor.
Take the "Initialisation" and "Destruction" of Variables just as a Sample.
Other Stuff would be to be able to call a (Debug?)-Subprogramm whenever a variable is touched by the System.
Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on February 28, 2023, 04:41:40 AM
Guten Tag Theo,

I see. My view is that writing an editor/IDE is not an easy task. There is a lot of good ones out there. The better I found is UltraEdit, I work with it for years and the only editors I found that was close but not better was Visual-Studio-Code and Sublime-Text.

I know Aurel, José Roca, Jürgen Kühlwein, and Paul Squires, and some others wrote their own. I really do not want to offend anybody here, but for me the best is still UltraEdit by far. (I hope you will forgive me Aurel!)

Multi caret, vertical and block selection, vertical edit and insertion, powerful search, highlight all occurrences of a chosen word, customization syntax highlight, word-auto-complete, auto-brace, many configurable buttons, hex-edit, etc, etc, etc. (See on YouTube)

So my reasoning is to not write an editor or IDE,  instead, pick the best one and build utilitys around it. UltraEdit are polishing their product for 25 years.

With PreCompiler and even PrePreCompiler in my case I can have an Oxygen .o2bas file, a PowerBASIC file, a FreeBASIC file, and a PureBASIC file all opened in the editor and all I have is one Compile button, one Compile & Run button, and one Run button. The compilation options are in the file if any are needed other than default.

For example, destruction of a variables, as you wrote, could be done simply by an utility called from UltraEdit. This is the way I like.

This said, I totally respect those other that write their own editor or IDE. Choice is a gift.
Title: Re: Kick - o2 precompiler
Post by: Theo Gottwald on March 08, 2023, 07:46:24 AM
How do you customize UltraEdit for Powerbasic?
Is it included in the Package or do yo uuse own "Template"?
I know Ultraedit for long Years, maybe its worth a closer Look then.
Which commercial version do you recommend for PB Users?
In my case i will still use JK-Edit, but if i have multiple large Projects open at the same Time,
i can not handle it easily in JK-Edit. So i use JK-Edit and the PB-Editor "Side by side".
Maybe UEdit would be an Option if it can be customized for PB.

Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on March 09, 2023, 05:32:56 AM
I use my own config files.
Use the latest version, you can download a one month free demo at
https://www.ultraedit.com/downloads/ultraedit-download-thank-you/

I will prepare you a package with what I got for PowerBASIC.
Including a little "How to..."
I might do it tomorrow if I got time, I hope...

Added: Almost finish, will be back tomorrow...
Title: Re: Kick - o2 precompiler
Post by: Theo Gottwald on March 10, 2023, 02:43:15 PM
Hallo Pierre,
the most easy way to explain it, would be if you can make a Youtube Video that shows your system.
I see that the pricing with $150 is the same like in earlier time and looks ok for me.
So lets see your package. If i understand it, its maybe interesting.
To post that stuff, maybe you can open a new post in "3rd Party" so anybody can see it.
Title: Re: Kick - o2 precompiler
Post by: Zlatko Vid on March 10, 2023, 06:34:47 PM
$150 ...ughhh

thank you very much but NO  ;D
Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on March 11, 2023, 09:35:06 AM
Hi Aurel,
yep, the price is really high for an editor, even it it is real good.
This is a major concern.
Around $40~$50 would have been more fair in my opinion.

Hi Theo,
I will think about the video, it's a good idea.
In the mean time, remember that there are many already on Youtube.
Title: Re: Kick - o2 precompiler
Post by: Bernard Kunzy on March 11, 2023, 03:23:29 PM
I have been using UltraEdit for years (version 15.10.0.1018), for me it is the best to edit binary files, and it is able to manage very very large files.
Title: Re: Kick - o2 precompiler
Post by: Theo Gottwald on March 13, 2023, 11:43:45 AM
Quote from: Pierre Bellisle on March 11, 2023, 09:35:06 AM
Hi Theo,
I will think about the video, it's a good idea.
In the mean time, remember that there are many already on Youtube.
Hallo Pierre,
For Me counts, "How you work with it doing Powerbasic".
I doubt that there are such videos on YT. Unless you made them.
The best Program for making such Explanation Videos is "Camtasia".
I think its $199 or like that :-).

The Point is that i know Ultraedit for Years, i had an very old version long time ago.
So i know its really fast, and that helps when programming.
I guess there are really experienced ASM Programmers behind.
They can take what they want, because for long Time Users there are no Alternatives to UEdit.
However it must be customized to support PB specific functions like Debugging or Compiling, open folder etc.
Otherwise it will not be as fast as it can be. So I would like to see how you do it.
Aside from the price, "Know How" is most important.
Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on March 15, 2023, 08:49:46 AM
I will se if I can do something, give me a little time,
I hope that Joel or Ethan Coen could help me...
Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on March 28, 2023, 06:49:35 AM
Well, finally I had a little time to finish this.
It's kind of a 17 minutes horror movie. Don't expect much.
First part is to show UE possibilities, second part is more on Kick for O2,
witch have a PowerBASIC counterpart UePb that do almost the same things in a less sophisticated way.

For those who are interested, login to your Google account and go The code, the editor, and the compiler (https://drive.google.com/file/d/1RZJjd_cDtCg74X-aH0oL8ezv7d_-lFzs/view)
Title: Re: Kick - o2 precompiler
Post by: Johan Klassen on March 28, 2023, 08:45:01 AM
hello Pierre Bellisle
I get an access denied, I am logged into my Google account
Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on March 28, 2023, 09:02:59 AM
I will double check right now...

Johan, please retry, I think it should work now...  The code, the editor, and the compiler (https://drive.google.com/file/d/1RZJjd_cDtCg74X-aH0oL8ezv7d_-lFzs/view?usp=sharing)
Title: Re: Kick - o2 precompiler
Post by: Theo Gottwald on March 28, 2023, 09:25:29 AM
I can see the Video, however the Quality is "nearly unreadable". It looks a bit like adventure game from 1990's :-).
I can see the Compile and Debug Buttons.
And then there are soo many Utilities included that its amazing.
Can you make a package for us with the complete set of utilities in there :-)?
The Preview on the right side is a good feature in UEdit. Noone elese has this possibly.
Also the Pixel-Scrolling in UEdit is unique.
After all this System is so highly specialized and optimzied that it may need some week of introduction to know all possible features.
Title: Re: Kick - o2 precompiler
Post by: Johan Klassen on March 28, 2023, 03:13:06 PM
thanks Pierre Bellisle, it works now  :)
Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on March 29, 2023, 01:02:14 AM
Bernard,
Agreed, UE is real nice
________________________________________________

Johan,
Great to see it work!
________________________________________________

Theo,
Yes the quality is real bad. Like there no aliasing.
I did record with the following parameters.

Base (Canvas) Resolution: 1280x1024 - Aspect Ratio 5:4 (Full screen of my small monitor)
Output (Scaled) Resolution 1280x1024 - Aspect Ratio 5:4
Recording Quality: High Quality, Medium File Size 3
Recording Format: .mkv files
Encoder: Software (x264)
Downscale Filter: [Resolutions match, no downscaling required]
Common FPS Values: 60

I did not want to spend money for Camtasia, it might be my first and last video.
I used OBS and OpenShot.
I suspect the Software encoder x264.
OBS tell me that my GTX 950 video card does not support hardware encoding?
On my side it look a little bit better with VLC.
This is where an expert like Patrice would be appreciated.
If anybody knows how to correct this, please do tell.
In the mean time I will check on the net to find a solution.

For the utilities package, I will see later,
one thing for sure, it will require time to prepare and free time is rare for many of us...

:-)


Added MKV format...  The code, the editor, and the compiler (MKV) (https://drive.google.com/file/d/1PMjJfZ6E0CQzffBFEyDRTtg4sAjZq7Ty/view)  
From my side, it look as bad as the other one,
Maybe you can download and try with VLC, it is around 500mb.



Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on March 31, 2023, 06:59:29 AM
Well, it seems I got much to learn in video editting.
500mb MKV was bad
525mb MP4 was bad
8.5mb WEBM was bad, yes, no typo, 8.5mb
85mb AVI is the best by far. -->  Video0008avi.avi (https://drive.google.com/file/d/1bQhpeTAcDFaXC_3r35bEk4Ez41Jx8ywV/view?usp=sharing) , still 6 times smaller than the MKV.
Thank to VideoToVideoConverter (https://www.videotovideo.org/) a real nice portable freeware.

I hope it will now be readable for you...
Title: Re: Kick - o2 precompiler
Post by: Bernard Kunzy on March 31, 2023, 09:44:56 AM
Pierre

The webm format is the way to go, however you must start first using a good video catcher, then convert it to webm.
nVidia or even Windows have good free video graber utilities.
FFmpeg could be also a good alternative (this is the one that VLC was built on).

The best format to grab the video is mp4, then webm reduce the size drasctically to post on the internet (this is what is done by Youtube or Behance).

Title: Re: Kick - o2 precompiler
Post by: Nicola on March 31, 2023, 07:05:19 PM
Hi,
I use VCT program to compress my videos.
I use H265 codec and it's really great.
I attach the link.

Cheers

https://sourceforge.net/projects/videoconvertertranscoder/
Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on April 01, 2023, 04:08:45 AM
Hi, Bernard, Nicola,

Thank for the comment and the link.
It seems that there are many good recording format.
Any one must achieve better result than what I got.

On my side, I'm now sure that my problem came from my GTX 950 video card drivers, even if they where suppose to be up to date, OBS couldn't get hardware H.264 nor H.265 codec access under Windows 7. So I recorded with H.264 software codec. From there all went wrong, loading my H.264(Soft) video and saving to different formats like mp4, webm, flv, wtv, mov, mpg, and wmv gave me bad results. .Avi was the best I could get without re-doing all the video from scratch, which I didn't want to do. Booting Windows 10, my video driver are alright, and I found some driver that should do for my Windows 7 partition. Hopefully, this problem belong to the past...

Still, an old and good way to learn.  :-)

Now, for those ones who are interested, we can go back to Kick...
Title: Re: Kick - o2 precompiler
Post by: Zlatko Vid on April 01, 2023, 08:43:24 AM
well i tried some of them and end result is not very good
it looks that depends on your video card (in my case old Radeon)
Title: Re: Kick - o2 precompiler
Post by: Theo Gottwald on April 01, 2023, 09:41:20 AM
@Pierre
don't let it be the end. Take it as a start.

We would like to see more videos from you.
About PB-Coding, about the town you are living ...
whatever keep them coming.

PS: OBS should normally work fine (https://www.youtube.com/watch?v=QKmrDUJFRkM), but there are many free solutions also.
 (https://www.youtube.com/watch?v=nCNri04lHaI)
Title: Re: Kick - o2 precompiler
Post by: Pierre Bellisle on April 04, 2023, 03:52:55 AM
Aurel, 
even the .avi from post #19 is still real bad and unreadable?

Theo,
One thing for sure, making video is not my best shot, one positive point is I got better GPU Windows drivers now.
For the rest, I like it here and hope to become more active...
Just after finishing my thousand project that are on the back burner...
Life is too short, 24 hours a day is not enough...
Title: Re: Kick - o2 precompiler
Post by: Theo Gottwald on April 04, 2023, 08:34:40 PM
@Pierre
How about we start a OCR-DLL Project here?
I have some unready code that i could send you.