Day 007 - Numerics, dates, times, and upgrading to version 17

Resuming at page 60 of the tutorial, I had a look at currencies. 

WinDev has a Currency type, which appears to be a decimal type which is not subject to floating point rounding errors. Currency is the recommended type for any variables which you use to perform monetary calculations. 

Now, there's also a Numeric type, which is similar. Currency supports up to 23 significant digits; Numeric supports up to 38 significant digits. For Numerics those significant digits can be all integer or all decimal or any combination, but it appears from the help that Currency can have a maximum of 17 integer places and 6 decimal places:

The currency type is kept for backward compatibility. It is faster for the calculations that do not require a precision greater than 24 significant digits (up to 17 digits for the integer part and up to 6 digits for the decimal part).

And yet I also see on the Currency help page that the range appears to be a full 24 digits on the integer side. 

Seems to me that the safest option is simply to use Numerics.

As previously noted you can concatenate numbers and strings, and there's also a NumToString function for converting numbers using specific display formats.

 Wait a minute, I'm forgetting something. Oh yeah.

 WinDev 17!

I said last week that I'd be upgrading to WinDev 17 once the download was done. Well it is, so I'd better. 

As with my WinDev 16 install, I elected to put everything in a unique directory (that is, not under Program Files ...). I've always used Program Files (x86) with Clarion, so I'm not sure why I'm doing things differently with WinDev. Who knows, maybe I'll change my practice with Clarion too.

During the setup process I came across the Control Centers window. This defaulted to my WinDev 16 location. Which made me wonder - can I share project data between WD 16 and 17? I have no idea, but as I don't have much in WD 16 I decided to change the directory to one under my WD 17 tree. 

The installer started chugging away, and to keep me amused it displayed some of the "917 new features" including the org chart, ribbon control, rating control, scheduler control, funnel charts, automatic schedule printing, Unicode support, UI improvements, the profiler, in-memory image manipulation, Google translation support, and report sequencing.

I got WD 16 late in the product cycle so my USB keys all begin with <product letter>17, indicating they already support version 17 and no upgrade is needed. 

After the install completed I was asked to set up an SCM database. I'd previously created one for WD 16, so I selected that option. 

For any kind of team development I expect the wise thing to do is to use a shared HyperFileSQL database instead of a network share. 

Back to the tutorial

I fired up the WD Get Familiar sample project (in Tutorial\Answers\WD Get Familiar) and had a look at the various examples of handling numerics, dates, times etc. 

I like the duration controls, which can be used to specify a duration of days as well as hours, minutes, seconds, and hundredths of a second. 

Inadvertently (thinking another app had focus) I pressed the PgDn key while in the WinDev editor. A number appeared in the upper right hand corner of the editor window, and every time I pressed PgDn the number increased, and decreased when I pressed PgUp. A duration control I'd placed only displayed when I was on "page" 4, whatever that meant. I also noticed that content in a text box changed for each page, corresponding to what would be displayed when a specific button was pressed (at runtime, not in the editor).

This is something called "plane mode". As near as I can tell, a plane is much like a sheet control, except that there isn't (or perhaps isn't necessarily) any displayed control associated with the different planes. A control can be on no plane (meaning it is always visible) or on a specified plane.

Q&A

There's a Q&A section at the end of the lesson which reviews the concepts covered. I found it quite helpful; among other things I'd missed that F2 can be used to jump to a control's code, which somewhat confusingly is called the control's "process". PC Soft has done a good job with the English version of the documentation, but occasionally the terminology betrays the product's origin in another language and culture. 

I'm out of time again, but at least I've made it through Part 1. Part 2, starting tomorrow, is all about using databases.