> I have code that uses this structure: IF NOT(NUM(ICONV(AMT,'MR')))
> THEN
>
> This works because if some enters F for amount, D3 will return F and
> the above logic will work fine.
>
> However, on QM, a null is returned and the code will not perform as
> expected.
>
> I had to change my code so that it is IF ICONV(AMT,"MR")="" THEN
As I have indicated in an off-list response to Eugene, this was changed to
work this way back in 2003 at the request of a user migrating from D3. This
makes me wonder if D3's behaviour has changed or is configurable.
We could always add yet another QM option if necessary.
Martin Phillips
Ladybridge Systems Ltd
17b Coldstream Lane, Hardingstone, Northampton, NN4 6DB
+44-(0)1604-709200
"If there are some numeric digits at the front of the value, then
these will be taken as the number, and the rest of the value will
be thrown away... If the first character of the specified value
is not numeric, then the value string will be taken without
modification."
This definition was lost in the AP Ref and subsequent revisions
of the D3 Ref but it will be back in there soon.
My recommendation would be to ensure that QM behaves to-spec,
regardless of release-specific behaviours in D3.
CRT \"\ : ICONV( "F123", "MR" ) : \"\
CRT \"\ : ICONV( "123F456", "MR" ) : \"\
D3 v7.5 Output (to-spec)
"F123"
"123"
(Unidata and Universe agree. I didn't check others)
QM 2.9-2 Output (not to-spec)
""
"123"
HTH
Tony Gravagno
Nebula Research and Development
TG@ remove.pleaseNebula-RnD.com
remove.pleaseNebula-RnD.com/blog
Visit PickWiki.com! Contribute!
From: Martin Phillips
Hi Tony,> My recommendation would be to ensure that QM behaves to-spec,
> regardless of release-specific behaviours in D3.
>
> CRT \"\ : ICONV( "F123", "MR" ) : \"\
> CRT \"\ : ICONV( "123F456", "MR" ) : \"\
>
> D3 v7.5 Output (to-spec)
> "F123"
> "123"
> (Unidata and Universe agree. I didn't check others)My UniVerse system certainly does NOT do this. I get the original data returned with ML and MR but a null string with MD. I haven't tried Unidata.
To return 123 when the user types 123F456, accidentally inserting a non-numeric character seems crazy. It is an error and in my opinion QM should continute to treat it as such.
Way back in September 2003, the late Bruce Nichol said in an email....Don't know if this one's a bug or a feature, but...
We often use a line of code:
0386: IF NOT(OCONV(ICONV(INV.DATE,DATE.MASK),DATE.MASK) = INV.DATE) THEN ....
which, in the old days was quick way of ensuring that the input matched the given mask. Failed ICONVs returned null.
This appears not to work similarly under QM. [QM returned the original data at this error]
Question: Under vanilla Pick and UniVerse, if an ICONV doesn't work, null is returned. Are you trying to tell me that this is not the case with QM?This is diametrically opposite to what is being suggested by this new thread. As a result of this email, we modified ICONV() to return null for failed conversions. Of course, Bruce's example is with a date conversion, not MR but he does make the general point that failed conversions should return null.So, which is right?
Incidentally, QM follows the Information style model where the "correct" way to test whether an ICONV() worked is to check the value of the STATUS() function. A non-zero STATUS() indicates failure.
There are two things going on here.
1) Disagreement with the way specific functions work in D3.
2) Keeping D3 migrations easy and low-cost.
Opinions should influence future development, and options can be
added so that people can choose how their code _will_ behave.
You can't stand on principles when it comes to migrations. This
is a very black and white issue. Does the platform support a
competitor's feature? If not, if only in part, or if just
differently, then the answer is "no". The bottom line is: what
will the cost be to VARs and end-users to re-code to make the
software work as it always has? If Ladybridge wants to get more
migrations from D3, the process needs to be as smooth as possible
with as few hidden migration costs as possible. It doesn't
matter if you agree or disagree with R83 functionality. If this
functionality is not replicated, then QM has a known issue which
increases the time=cost of migrations. This has nothing to do
with how a specific feature "should" work.
Is the migration process an opportunity to fix/improve code?
Sure, but anyone faced with the costs of doing a migration just
wants to get it done. They aren't looking for "opportunities"
now, they're looking to get away from their old vendor and to cut
costs. When that process is complete, they can better afford the
luxury of making code changes to suit personal preferences, to
get better performance, new features, or whatever they wish.
As to examples of valid applications for ("123-456" "MR")="123"
(which QM supports BTW), personally I've seen this used in
inventory apps where there are a variable number of digits and
perhaps variable delimiters, but the developer knows that the
first digits represent a part number and the remaining data has
to do with vendor IDs, lot numbers, etc. You have to remember
that part numbers aren't always determined by IT people.
I wanted to see how other platforms interpreted MR/MD/ML codes
and I'm amazed at the disparity in this market for such a
fundamental function. As I look at the results of my tests, I
see QM does something that other platforms don't. It's trying to
be nice by converting data into numbers. From everything I've
seen and read, this is not correct behaviour. When we mask text,
we choose a justification, either right or left. We're masking
text, not numbers. I hope that subtlety doesn't get lost.
Developers will use this as a means of right justifing text to
strip off some number of characters. We do Not want the DBMS to
do us a favor and remove other characters which may be
significant like plus signs, or dollar signs.
As an example, QM converts trailing CR and DB, both to imply
negative numbers (that by itself is arguable). Unidata and Caché
also do this but no other MV DBMS that I tested does. D3 strips
the CR and DB from the back end of the numbers because that is
alpha text. D3 does not interpret that as being a part of the
number. Over the years, developers have written code for
R83/AP/D3 to process data as text, stripping +/- signs, CR/DB,
parentheses, etc. If a different platform starts treating text
like numbers, this parsing code will break. As a perfect
example, D3 sees ("123CR" "MR") as "123", not numeric, but text
with alpha chars truncated. The resulting text will be
interpreted by code as positive number, and some developers will
choose to negate the results. But QM sees the "number" as
negative ("123CR" "MR" = "-123") and ("123DB" "MR" = "-123").
This is a fundamental corruption which can affect accounting
packages.
Any DBMS company that changes functionality like this is simply
expressing an opinion and not setting industry standards or
making the world a better place in any way. Expressing an
opinion that breaks legacy code imposes unwarranted costs in the
market and affects their positioning amongst competitors.
You can download the code I used for testing, and an Excel file
which shows the results of all platforms:
http://drop.io/MultiValueIConv
If you're not familiar with Drop.io, it's a free service for file
sharing. You can add files, comment on the files that are there,
and there are lots of other options. I blogged about it here:
nospamNebula-RnD.com/blog/drop-io/2009/01/dropio-intro.html
Feel free to run the code and comment on the results. Note that
due to Excel tendencies to convert data that looks numeric into
numbers, there are embedded spaces in the data. If you change
the data Excel will render it differently. Let's not get caught
up in Excel nuances.
If you find errors in the data or would like the spreadsheet
updated, I'll be happy to make corrections. Based on responses
here, I'll forward this info to other MV DBMS providers for
comment.
Tony Gravagno
Nebula Research and Development
TG@ remove.pleaseNebula-RnD.com
We're not talking about style here (or shouldn't be anyway). The
real issue is not that Eugene was using MR as a redundant check
for a numeric. I think we can all agree that the specific
example was over-coded. The point is that his example revealed a
fundamental compatibility problem in MR itself, one that can
affect some very well written code.
A problem according to whose spec? Well, Prime Information was a
competitive reverse-engineering product based on Microdata.
Whose fault is it that they didn't read R83 documentation to
create an accurate emulation? (Doing so might have gotten them
sued at the time.) What I want to know is, at what point did
Reality deviate from the Microdata=Pick spec? (See my Excel doc,
Reality doesn't agree with D3 or QM.)
I actually don't care if QM supports documented D3 behaviours or
not - this one or any of them. If you look at the spreadsheet
you'll see other platforms have similar issues. But this is a
competitive market. Failure of any platform to agree to baseline
standards simply costs end-users and developers money.
So, in support of QM and Ladybridge, I hope that Martin creates a
flag that allows QM to interpret MR and other processor codes
just like D3. This can reduce migration costs, thus providing
more incentive for migrations of Pick-like platforms to QM.
If there is no flag, I'm afraid this is just one of those hidden
costs associated with migration that people may discover
(apparently on all MV platforms) after they've already paid their
money. C'est la vie. In support of anyone contemplating
migration, I just hope issues like this are better documented so
that people can find problems and decide what they want to do
before they spend their money.
In the back of my mind, my beef with this whole thing is that
this discussion is at a level far lower than we should ever go.
We shouldn't need to be discussing the nuances of data masking
anymore. We should be discussing how to remain competitive in a
market dominated by other models. Does the phrase "adjusting the
deck chairs on the Titanic" mean anything to anyone here?
T
> A problem according to whose spec? Well, Prime Information was a
> competitive reverse-engineering product based on Microdata.
> Whose fault is it that they didn't read R83 documentation to
> create an accurate emulation? (Doing so might have gotten them
> sued at the time.) What I want to know is, at what point did
> Reality deviate from the Microdata=Pick spec? (See my Excel doc,
> Reality doesn't agree with D3 or QM.)
>
> I actually don't care if QM supports documented D3 behaviours or
> not - this one or any of them. If you look at the spreadsheet
> you'll see other platforms have similar issues. But this is a
> competitive market. Failure of any platform to agree to baseline
> standards simply costs end-users and developers money.
>
>
And as more and more platforms support the idiosyncrasies that divide
them, where do we all end up? A flavor of MV that doesn't know what
flavor it is until you tell it? We both agree that making it easy to
move the code is better for the developer and customer, right now. How
many developers are going to migrate 30K+ lines of code and then go back
and rewrite the "bad" bits the QM-way? I'm not sure if being a "swiss
army knife" is a great thing or not. It helps sales or I doubt that
Ladybridge would be playing along with this discussion. Are those
migrations really going to take advantage of things like QMOO which can
help change the way applications are thought about, files are designed,
and code is written? It might be better to have an application that can
scan code from a specific flavor of MV and point out known compatibility
problems and recommend alternate code structures for specific lines of
code. If a porting app can change the code for the bulk of those known
problems, then where is harm in making the code more QMBASIC instead of
PickBASIC? I know there is no such thing, but maybe the focus should
really be on the code conversion and not the compiler modes?
> So, in support of QM and Ladybridge, I hope that Martin creates a
> flag that allows QM to interpret MR and other processor codes
> just like D3. This can reduce migration costs, thus providing
> more incentive for migrations of Pick-like platforms to QM.
>
> If there is no flag, I'm afraid this is just one of those hidden
> costs associated with migration that people may discover
> (apparently on all MV platforms) after they've already paid their
> money. C'est la vie. In support of anyone contemplating
> migration, I just hope issues like this are better documented so
> that people can find problems and decide what they want to do
> before they spend their money.
>
>
A code migration scanner would be a nice free download (without the
registration and such!). I would agree that, for the sake of developer
sanity, the conversion masks should operate similarly for various
flavors. I imagine that will be a bit of code work.
> In the back of my mind, my beef with this whole thing is that
> this discussion is at a level far lower than we should ever go.
> We shouldn't need to be discussing the nuances of data masking
> anymore. We should be discussing how to remain competitive in a
> market dominated by other models. Does the phrase "adjusting the
> deck chairs on the Titanic" mean anything to anyone here?
>
> T
>
>
>
Speaking of other models, I'm pondering a QMOO article for Spectrum.
The Apache+FC article for this month's issue is a bit of a stretch for
MV, but I wanted to get the idea of the solution out there. I though
about following up with something more MV-oriented. Should this be
something that has Ladybridge as the author or would it have more impact
if a real-world example was documented in print by a developer with code
demonstration. The open-source dictionary-oriented data access class,
for example, that Gary is expanding and debugging for his ISAM
conversion is a great demonstration of QMOO. Most developers should be
able to grasp the concepts of the methods deployed. I could throw some
classes together and make a solution for the article if there are other
suggestions.
GlenB
LOL... reminds me of a line from Bill Maher recently: "I agree
with what I said on the Chris Matthews show the other day..."
> I would be fascinated to hear (briefly!) what Tony
> makes of the way Microsoft keep changing VB. I was
> astounded recently by the effort needed to take a tiny
> VB5 program forwards to VB .Net. Just about everything
> has changed right down to the sizes of Integer, Long,
> etc. This makes the differences in MR between D3 and
> QM look trivial.
I'll just echo Simon's comments: VB.NET is a completely different
technology from VB. However, for anyone considering MV
migration, QM is exactly the same as D3 or other platforms. In
Microsoft's case, they have already sold people on the platform
and ongoing evolution - unfortunately, yes, that evolution is
often radical. In your case you're trying to get people to
change platforms, and in order to do this you need to first
facilitate migrations, then you can get them to use your
value-add nuances.
> QM is taking multivalue forwards into new areas such
> as OO programming. Along the way, we need to drop some
> of the stranger nuances of some functions. So long as
> it is clearly documented and doesn't require major
> rewrites to applications, this should be ok. Tony, no
> doubt, will disagree.
IMO, the migration process is simply the wrong venue to wage a
war of wits through forced code re-writes. Get your new clients
migrated and then help them to improve their code. To keep it
fair and easy for everyone I'd be happy if there were just good
documentation (no code parser required) to help people to find
code that will cause their application to behave in a
fundamentally different manner. Now that I think about it, this
thread all by itself should serve nicely as long as newcomers are
referred to it.
T
IMO, the migration process is simply the wrong venue to wage a
war of wits through forced code re-writes. Get your new clients
migrated and then help them to improve their code. To keep it
fair and easy for everyone I'd be happy if there were just good
documentation (no code parser required) to help people to find
code that will cause their application to behave in a
fundamentally different manner. Now that I think about it, this
thread all by itself should serve nicely as long as newcomers are
referred to it.
T
Side note which I'll share with our colleagues: You're not alone,
Simon. I'm still working with .NET 2.0 and I was a late adopter
from 1.1. IMO, the biggest benefit is generics, and I can't code
without them now. I've worked on books for .NET 3 and 3.5
(nospamNebula-RnD.com/articles/index.htm) but I still haven't
made the jump to use the latest release for my own development.
It's getting tougher every day to not use the latest tools.
Maybe after I do jump I'll say something like "I dunno how I
could ever code without LINQ or Lambdas or anonymous methods",
but right now I see some of that as being just "change", not
"improvement". And now we have C#4, MVC, Mesh, Azure, and other
stuff in play - I might just skip a generation, jump to VS2010,
and get on the bleeding edge. Yes, it's sometimes tough to keep
up with Microsoft, but at least they're evolving. I think
Microsoft moves too fast for my Pick-nik preferences, but the MV
market moves way too slow. YMMV
Tony Gravagno
Nebula Research and Development
TG@ remove.pleaseNebula-RnD.com
Nebula R&D sells mv.NET worldwide
I think Kevin's quote put in my mind what seems the best in my mind. Rather
than have all these switches, fully documenting the "nuances" of differences
would go a long way. Rather than make a switch, fully document the needed
application code change. All of these switches just seem like a disaster
looming. If a new QM coder came in to an unknown system, how much time (and
potential errors) would be induced by having to check and verify what each
switch does. If the new coder came from a McD world, but the switches were
D3, would he even fully understand the usage? Or a D3 guy looking at
Universe switches. I think you get my point.
I believe having "standard" QM code would be the easiest in the long run,
and the added time in the conversion would outweigh the potential future
problems.
Just my 2 cents.
Jeff
.......Nah......
T
> From: Simon Verona
> I think it's known as a "wiki" :)
However, one not-so-painful way to do this just occurred to me:
Modify the compiler so that when a specific flag is used and
specific tokens are generated, a log is written if the code
relates to known trouble spots. Parsing source code is a real
pain but the compiler already does it. This should also be added
to the runtime, again, where a log is written only if the code is
run with a specific mode/option active.
Why do it like that? Consider this:
MASK="MR"
IVAL = ICONV(OVAL,MASK)
Code that scans the source wouldn't be able to catch that, and
neither could the compiler (without warning you that every ICONV
in the system could be a trouble spot), but the runtime should be
able to catch the problem (depends on how BASIC passes info to
the conversion processor). So anyone migrating needs to port
their code, run through all possible code paths, then check the
log.
This would be a great initiative for the FOSS project... Oh
well...
T