I did some playing around with this and was surprised at what I found.
First I would have assumed that any error messages would have been returned as
part of the command.Response
But they aren't.
So I tried setting up a simple program to execute a command line, capture the
output and CRT it.
crt 'start'
get(ARG.) xqt else return
crt 'before'
execute xqt,OUT>rslt,STATUS>st
crt 'after'
crt '[':rslt:'][':st:']'
crt 'done'
This works fine as long as there is no error in the EXECUTED command.
LIST VOC WITH @ID LIKE 'A...' SAMPLE 1
Console output :
start
before
after
[þ1 record(s) selected to SELECT list #0.þ][1]
done
UO command.Response contains:
start
before
after
[þ1 record(s) selected to SELECT list #0.þ][1]
done
however with an error
LIST VOC WITH BadField LIKE 'A...' SAMPLE 1
Console output :
start
before
after
[Retrieve syntax error. Unexpected explicit item. Token was
'BadField'.þ Scanned command was LIST VOC WITH 'BadField' þ3][-1]
done
UO command.Response contains:
start
before
after
[][-1]
Done
So it seems that any error messages are eaten - the really bad thing about this
is that if you have a program that handles this type of error - it won't work
because it will never see the error and that's pretty BOGUS !!!
Gerry
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of David Wolverton
Sent: February 19, 2010 09:49 AM
To: 'U2 Users List'
Subject: [U2] UniObjects 'Exec'
We are using a product and just found out that one of the reasons we're
having some difficulties on an installation was that one of my dictionaries
was not defined at a new site. This caused a 'Exec' of a "SELECT" to fail,
but here's the kicker -- in BASIC, we could have 'seen' the error with
CAPTURING and RETURNING -- but I'm told the interface to UniObjects does not
return this diagnostic information on the 'Exec'...
So in BASIC, I would have
EXECUTE 'SELECT FILENAME WITH DICTITEM = "A"' CAPTURING THIS RETURNING THAT
And I could 'query' what is in THIS and THAT to decide if there is a problem
if the "DICTITEM" didn't exist for some reason.
I'm told that the product we're using cannot do this same thing -- there is
no way to 'know' the message 'select criteria DICTITEM is not a field' was
returned from the 'Exec' as we could have seen in the BASIC EXECUTE.
Is there no way to get back this same REALLY valuable feedback in
UniObjects? How do you code for this issue in UO?
This would not be big deal if we had source code or a 'log' of what was
happening -- we just had a screen that didn't come up, and with dozens of
fields, it's not obvious what the issue was -- until we found it! But the
failure of the 'SELECT' command causes the 4GL based on UO to just 'die' I
don't want to be stung another time with this, and am never afraid to ask
for thoughts or ideas!! If there is a way to handle this, I want to find it
and get the idea into their head so I never have a 'lost day' trying to hunt
down this kind of issue...
TIA!!
David Wolverton
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users