Showing posts from August, 2020

PowerBuilder Code Beautifier / Formatter

 A new code beautifier for PowerBuilder (PowerScript) code has been added to NotepadPB: This is the first and initial version which uses a very simple approach to formatting the code. NotepadPB will use multiple passes to adjust spacing, casing, and indenting of the script. The process works as follows: Start by tokenizing the script by splitting everything into words or characters (characters for things like quotes). We then loop through each token and determine if it's a keyword, datatype, quote, comment, carriage return, or user defined text (like variable names). We change the case on keywords and datatypes, and track indent level if the keyword is an indent-able keyword (e.g. IF, FOR, CHOOSE, etc). Comments and quoted text are ignored, we don't want to modify them. At the end, we reassemble our script. In our second pass, we parse our script by line. We will apply some formatting on a line by line bases. The second pass is meant

Develop a web browser in PowerBuilder.

The inclusion of the new Chromium Web Browser control in PowerBuilder 2019R2 gave us the possibility to develop our own web browser in PowerBuilder. We could have done this already with the MS Web Browser control but we would have had to accept the limitation of IE. With the new PowerBuilder control, we know that we'll have maximum compatibility with the most up to date web sites. Microsoft even accepts this after converting Edge to use Chromium.  So the big question, why? The short answer to that is... to learn something new. I've been developing software for 20 years. In those years I've developed countless of useless applications just for the sake of learning (I once developed a fully functional version of Mine Sweeper in Silverlight). Below is what we'll create. We'll use the PB Chromium Web Browser control with the Ultimate Suite for PowerBuilder Tabbed Caption window. Some things we'll accept right away; 1) This browser is extremely basic so we won't