February 21, 2008, 08:28 AM
hammo1jSmartdates in dm
I have just been delivering training on dates to our coders and advanced users and have had the revelation that date processing could be considerably simplified if it was consistent in dialog manager and webfocus code.
With webfocus code you have smart dates, whereas with DM you have alpha dates and a whole series of legacy functions different to the smart functions.
A simple solution would be to introduce date typing for dm.
eg
&START_DATE/DMYY = '12/03/2006' ;
&END_DATE/DMYY = &START_DATE + 30 ;
Stored internally as a base date integer it is converted to date display format when the line of webfocus code is constructed.
In short legacy processing will always have to be retained where you have DM dates untyped resulting in extra complexity.
Interestingly the other pre-processor based language I worked with Pl/1 had the same pre-processor (DM) language as the main language which made for simplicity.
If no one has done this I will raise as NFR.
February 21, 2008, 09:02 AM
GamPIt would indeed be nice to have the same formats available in DM as we have in table (why limit ourselves to just integer and alpha and, in your suggestion, dates).
Wouldn't it be nice to be able to do decimal calculations in DM?
Would we also like to have edit options added to the DM-formats?
And do we all think that just DMYY format is enough? Or should it also be possible to have the YY and YYMD and MDYY and ... available?
This is just to indicate, that if you ask for one thing, there will always be somebody who is asking for more and is not really being happy with the (in his or her view) limited NFR.
But, by all means, please go ahead and submit the NFR, I'm with you.
February 21, 2008, 09:33 AM
Tony AGamP,
Try this code on your 7.6.n set-up -
SET DMPRECISION = 7
-RUN
-SET &Pi = 3.1415927;
-SET &Radius = 4;
-SET &Circum = 2 * &Pi * &Radius;
-TYPE &Circum
You should get an answer of 25.1327416
T
February 21, 2008, 10:18 AM
Francis MarianiJohn,
I expect you are aware that you can temporarily convert a Dialogue Manager alpha variable into a date variable, execute a function and then turn it back to an alpha variable.
-SET &REQUEST_TIME1 =
- DATECVT( DATEADD(DATECVT(&REQUEST_TIME,'I8YYMD','YYMD'),'D', 7),'YYMD','I8YYMD');
https://forums.informationbuilders.com/eve/forums/a/tpc/...931014162#9931014162 Francis
Give me code, or give me retirement. In FOCUS since 1991
Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server