Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

In a comment to the Day 4 installment, Richard Rose pointed out that WD17 is in fact out of beta. I need to crawl out from under my rock more often. Thanks Richard! I'm downloading the update now, but today's hour will still be with WD16.

...

As you can see from the screen shot, I rewrote my code to use the Length() function and that worked. Here are the results of the procedure call:

Automated testing

I don't want to have to run manual tests all the time. But as I've previously noted, it's easy to create automated tests. Again, from the Project Explorer I added a new test:

...

This suggests to me that strings in WinDev are more like .NET strings than like Clarion strings. In .NET, strings are immutable, meaning you can't change them; when you make what appears to be a change to an existing string, you're actually creating a new string to contain the result. I'm thinking a similar process is at work in the W language. 

Resume your normal (string) route

As much as I like unit testing, I'm going to leave that for now and go back to the tutorial, which on page 57 is still on the subject of strings.

WinDev has the usual complement of string handling functions, including Upper(), Lower(), Left(), Right(), Length() etc. Trimming space characters is often important: the equivalent to a Clarion Clip(Left()) is NoSpace() which removes leading and trailing spaces. The string handling library is extensive - you can find a complete listing of functions here

Handling numeric values

Numeric values are assigned using the usual operators, and you can also concatenate strings and numerics directly without having to cast the numeric values. Since + is both the concatenation and the addition operator, if you want to do addition instead of concatenation you should enclose the operation in parentheses. 

...

And just like that, I'm out of time again. Friday is my regular day off in this series, so I'll back on Monday on page 60, and I hope not to stay on track for at least a couple of days!, this is the Victoria Day long weekend here in Canada, and we're off camping until Tuesday, so the next installment will be on Wednesday May 23.