Posts Tagged ‘Developer-Tools’

Statement Code Coverage Testing – Part 2

November 26, 2011 1 comment

Back in November 2009 I posted the “UniBasic Code Coverage” project as an open-source project. Back then it was stripped version based on one I set up for my then employer. The version for my employer used an in-house pre-processor that greatly simplified the work I needed to do for it work with our source files.

I have now released the v0.2 (update: v0.8) development version which has fixed several bugs, added the ability to specific a customer pre-process for those don’t use string UniBasic and provided improved the documentation on installing, using and contributing.

As you will already be aware, the source code for this is hosting on the UniBasic Code Coverage Project at SourceForge in a Subversion repository. If you have Subversion installed, you can checkout the code with the following command:

svn co ucov

If you are running UniData or UniVerse on Windows, I highly recommend you install Tortoise SVN as it greatly simplifies working with Subversion.

On the SourceForge site you will not only find the Subversion repository for all the code, but also ‘Tracker’ which will allow you to submit Feature and Bug tickets. If you need help with anything, you can submit a Support Request as well.

If you wish to contribute to the code or documentation, you can introduce yourself on the Developer Forum. The best way to submit code or doc is by generating a Diff of the changes, as well as what the behaviour was before the change and what it was after the change.

When you have used UBC, be sure to fill out a Review. All constructive input is welcome and appreciated!

Making Life Easier

Every developer worth their salt has little snippets of code that they use to make their life easier.

So today, I thought I’d share a little utility that I use all the time.

Readers, meet RL. RL, meet readers. RL (Run Line) allows you to run a single line of code to see what it does. Typically, I use this as a quick way to check out an OCONV express I haven’t used in a while or as a calc replacement if I don’t feel like tabbing out of the terminal. All you need to do is compile and catalog to enjoy its simpleness. RL supports 1 option, ‘-H’. This option allows you hide the compiler output if you wish.

To use RL, you can either enter the code as part of the command line arguments, or you can enter it as an input. Here is a screenshot of RL in action:

RL Utility

RL Utility


Disclaimer: I strongly recommend against implementing this on a production machine as it will allow arbitrary code execution. This code has only been tested on UniData 7.2.x. Feel free to use this code however you want. If you somehow turn this in to something profitable share the love and either buy me a beer or make a donation to an open source project.

Okay, so enough with the spiel. Here’s the code :
(Updated 2011-06-02 due to ‘<-1>’ being stripped)


EQU TempDir TO "_PH_"

OPEN TempDir TO FH.TempDir ELSE STOP "ERROR: Unable to open {":TempDir:"}"

* Determine if we should hide compiler output
* Also determine the start of any command line 'code'

   HideFlag = @TRUE
   CodeStart = COL2() + 1
   CodeStart = COL1()
   IF CodeStart = 0 THEN
      CodeStart = LEN(@SENTENCE) + 1 ;* Force it to the end
      CodeStart += 1 ;* Skip the Space

   HideFlag = @FALSE

* Get the code from the command line arguments, or
* Get the code from stdin

   Code = @SENTENCE[CodeStart, LEN(@SENTENCE) - CodeStart + 1]
   Code = TRIM(Code, " ", "B")
   PROMPT ''
   CRT "Enter Code: ":
   INPUT Code

* Compile, catalog and run the program
* We only catalog it so that @SENTENCE behaves as you would expect

WRITEU Code TO FH.TempDir, TempProg ON ERROR STOP "ERROR: Unable to write {":TempProg:"}"

Statement = "BASIC ":TempDir:" ":TempProg
Statement<-1> = "CATALOG ":TempDir:" ":TempProg:" FORCE"

IF HideFlag THEN
   EXECUTE Statement


* Clean up time

DecatStatement = "DELETE.CATALOG ":TempProg

DELETE FH.TempDir, "_"TempProg
DELETE FH.TempDir, TempProg


New Developer Zone – U2 PHP PDO Driver

March 2, 2011 1 comment

Rocket U2 Developer Zone


I spent last week at the U2 University in Sydney and had a great time. During the opening keynote speech, Rocket announced the new U2 Developer Zone.

Great news! Finally a public site for developers that links all the resources you would expect. White papers, podcasts, demos, links to manuals, personal editions of the database servers. Not just a public site, but a public site for developers from Rocket itself. That’s what we needed, strong, visible vendor support of the development community.

It is still a bit rough with a fair amount of content missing, but it has enough in there to make it worth signing up (free) to check it out.

It breaks the site down into 4 key areas.

  • Ignite
  • Launch
  • Accelerate
  • Dock

Ignite is aimed at new players and features explanations of what Multi-Value Databases are, some information about U2 as well as summaries of the Developer & Admin tools available for download.

Launch works on getting a developer up and running as quickly as possible with instructions and links for downloading and installing both the UniVerse/UniData servers, as well as their 4GL tool – SB/XA. A bonus is some professional looking video tutorials for getting them up and running.

Accelerate is focused more on in-depth content of the system with various articles and tutorials that have been produced by Rocket as well as some community figures as well.

Dock appears to be aimed at the forming a community/developer collaboration. It has links to U2UG as well as Rocket U2 on Facebook and Twitter (even though the twitter link is missing on the site at the moment). It also has a message board, but this appears to be one of those unfinished features for the time being.

One point of disappointment at the moment is ‘The Wall’ it throws up to get any content. It requires you to sign-up and log in before you can actually access the content. While I can appreciate their probable reasonings for this and appreciate it is still free, I believe this is one of those things that will prevent those who stop by from search results/ideal curiosity from actually getting involved.

By throwing up a wall, instead of openly allowing read-only access, it has a 2 fold effect. First, google (and other search engines) will not be able to correctly index the content. In an age where > 90% of website traffic generally comes from search engines, this is definitely not ideal. The other negative effect is that the bounce rate of people not currently involved will surely be higher.

Hopefully they will review this decision and decided upon a more open and effective path.


U2 PHP PDO Driver


So, my title indicated something about a U2 PHP PDO Driver and you were not mislead. While at the U2U Conference I had the pleasure of, among others, speaking with Jackie from Rocket Software. At one point the conversation turned towards dynamic languages and in particular, PHP. I was told that some tutorials had actually been written on getting PHP to natively connect to U2 and should be able to be found on the new developer site. Bingo!

After some quick searching on the site, I present you 2 links so you can build your own native connector between PHP and U2:

Hopefully you find this useful!

Cheat Sheet: UniBasic Debugger

October 30, 2010 Leave a comment

I’ve just completed the first release version of a small cheat sheet for using the UniBasic Debugger in UniData. Please give feedback if you find any typo’s, misinformation or just if you find it helpful and what to let me know. :)

Preview - Debugger Cheat Sheet

Preview - Debugger Cheat Sheet

Click below to go to the page with the PDF available for download:

UniBasic Debugger Cheat Sheet v1.0.0

I’m currently making a few others, so if you like the idea, stay tuned over the next couple of months.

Open Source: Some Positive News

August 12, 2010 Leave a comment

In case you haven’t noticed, open source has exploded into the mainstream and the profitable band-wagon that has built up revolves around “setup & support”, “customisation” and “enhanced enterprise editions”.

Yes, a lot of those companies do not solely handle FOSS projects, but it is a valuable part of their business.

The best part of FOSS is that because it is free and readily available, the potential people who will be exposed to the product is greatly increased. With MV-style databases largely unknown (and not understood), having more people aware of the technology can only improve the scene for us that work with it. The more companies using it means more jobs. Who can argue that against that?

That’s why Brian Leach’s announcement at the end of July is such a positive step for the community at large.

mvScan was originally a tool that I had developed for my use, to document a UniVerse system by iterating through the account and file structures, building impact maps and filling out tables with information culled from the entries found to make it easier for someone to search through their system.

So I’ve decided the best way forward is for me to open it up. That way, people who want to run it on their systems can do so and feed back any updates and changes that result from applying it to their specific structure and code organization.

So watch this space for announcements. If this goes well, there’s plenty of other stuff I want to open source.

You can read more on mvScan at Brian’s site.

I don’t know about you, but I’m looking forward to the release.

Statement Code Coverage Testing

November 27, 2009 1 comment

On the right-hand side you will see a link to the “Unibasic Code Coverage” project on sourceforge. This tool will enable you to perform statement level code coverage tests on UniData code. The results are then tabulated and saved as a colour coded HTML file.

This is based on the original prototype I wrote before further developing it for my current employer. Although this open source version is relatively simplistic, I will be progressing it by back-porting features as well as trialling new ideas.

If you try it out, leave a comment or send me an email and let me know how it went. If you are interested in helping with the development of it, or making the minor changes needed to port it to UniVerse then get in touch!

%d bloggers like this: