Opinion on Smart Windows

tonydt1g3r

New Member
I have only been programming in progress for less than a month and however I plan to start writing alot of GUI's. For my first large project I only used a regular window and not a smart window because I didnt know exactly how to work all the different object. I find creating a window is pretty easy but you miss out on some of the cooler design features of a smart window. So I wanted to convert what I did in a window to a smart window but I am running into difficulties. First of all the search I use to populate the temp table I display is not my code but written previously as with much of the code I will be working with. I thought it wouldnt be too hard to create a smart data object I would just cut and paste that code over but I found it quite difficult to achieve this. Alot of the sorts I do are quite specific and check alot of fields. So I thought maybe the free form query would work easier but it doesnt compile as I would expect it to. Whenever I use a smart window should I always create a smart data object to use with that window so that I can link all the objects together?
 
Hello,
Smart objects is the speedest programming way to create maintenance program for one or multiple tables. The use of smartobjects is very different in ADM1 and ADM2 (since V9). Then i think u've to make simple example with a smart object and smart links to understand the interest of smart objects on windows programming with progress.

Or ask u're manager about the utility of a formation on adm2. If u've to rewrite all the program u've build in two years because u didn't use ADM2 it will be also a good solution.
 
thanks for the reply, how could I convert this code into a SmartDataObject. I am not really sure how to go about converting old code into smart objects. Alot of these searches and such are older code that I am just cuting and pasting.

DEFINE INPUT PARAMETER t_strt_dt AS DATE FORMAT "99/99/9999".
DEFINE INPUT PARAMETER t_end_dt AS DATE FORMAT "99/99/9999".
DEFINE INPUT PARAMETER t_spec_act_no LIKE acctmstr.act_no.
DEFINE INPUT PARAMETER t_spec_sec_id LIKE secumstr.sec_id.
DEFINE INPUT PARAMETER t_spec_u_s_sec_id LIKE secumstr.U_SSECID.
DEFINE INPUT PARAMETER t_spec_u_s_CUSIP LIKE secumstr.CUSIP.
DEFINE INPUT PARAMETER t_spec_pair_clip LIKE secumstr.DTCC_REF_ENTITY_ID.
DEFINE INPUT PARAMETER t_part_corp_nme LIKE secumstr.SECDESC6 .
DEFINE INPUT PARAMETER t_part_cust_nme AS CHARACTER FORMAT "x(10)" INITIAL " " . .
DEFINE INPUT PARAMETER t_incl_cpn_p_and_i AS CHARACTER FORMAT "x(01)".
DEFINE INPUT PARAMETER t_incl_simon_stuff AS CHARACTER FORMAT "x(01)".

DEFINE OUTPUT PARAMETER TABLE FOR positions_rpt.
DEFINE OUTPUT PARAMETER totals AS INTEGER NO-UNDO.


DEFINE BUFFER t_secumstr FOR secumstr.

DEF VAR t_act LIKE acctmstr.act_no INITIAL "055157" .
DEF VAR t_desc26 LIKE secumstr.desc26 INITIAL " " .
DEF VAR t_cust_nme AS CHARACTER FORMAT "x(10)" INITIAL " " .
DEF VAR t_U_SSECID LIKE secumstr.U_SSECID INITIAL " " .
DEF VAR t_u_s_cusip LIKE secumstr.cusip INITIAL " " .
DEF VAR t_SECDESC6 LIKE secumstr.SECDESC6 INITIAL " " .
DEF VAR t_RESTRUCT_CD LIKE secumstr.RESTRUCT_CD INITIAL " " .
DEF VAR t_dtdac_dt LIKE secumstr.dtdac_dt INITIAL ? .
DEF VAR t_issue_dt LIKE secumstr.issue_dt INITIAL ? .
DEF VAR t_cntrct_sprd LIKE secumstr.cuflmrgn INITIAL 0 .
DEF VAR t_DTCC_REF_ENTITY_ID LIKE secumstr.DTCC_REF_ENTITY_ID INITIAL " ".
DEF VAR t_mat_dt LIKE secumstr.mat_dt INITIAL ? .

DEF VAR t_comp_cd LIKE acctmstr.comp_cd INITIAL " " .
DEF VAR T_RECOVERY_PERCENT LIKE SECUMSTR.RECOVERY_PERCENT INITIAL 0 .
DEF VAR T_RECOVERY_FG LIKE SECUMSTR.RECOVERY_FG INITIAL " " .

t_spec_act_no = STRING(INTEGER(t_spec_act_no),"999999").


FOR EACH positions_rpt.
DELETE positions_rpt .
END.


FOR EACH ACCTRPTS WHERE ( ACCTRPTS.ACCT_RPT_TYP EQ "CDS" ) NO-LOCK .
FOR EACH tddly_pl WHERE ( tddly_pl.pl_dt EQ t_end_dt ) AND
( tddly_pl.firm_act EQ acctrpts.act_no ) AND
( tddly_pl.dyopps NE 0 )
NO-LOCK .

t_desc26 = " ".
t_u_s_cusip = " ".
t_SECDESC6 = " ".
t_RESTRUCT_CD = " " .
t_dtdac_dt = ? .
t_issue_dt = ? .
t_cntrct_sprd = 0 .
t_DTCC_REF_ENTITY_ID = " ".
t_mat_dt = ? .
t_U_SSECID = " " .

t_cust_nme = " " .
t_comp_cd = " " .

T_RECOVERY_PERCENT = 0 .
T_RECOVERY_FG = " " .


FIND FIRST acctmstr WHERE ( acctmstr.act_no EQ tddly_pl.firm_act ) NO-LOCK NO-ERROR .
IF AVAILABLE acctmstr
THEN DO:
t_comp_cd = acctmstr.comp_cd.
END.

FIND FIRST secumstr WHERE ( secumstr.sec_id EQ tddly_pl.sec_id ) NO-LOCK NO-ERROR.
IF AVAILABLE secumstr
THEN DO:

t_desc26 = secumstr.desc26 .
t_RESTRUCT_CD = secumstr.RESTRUCT_CD .
t_dtdac_dt = secumstr.dtdac_dt .
t_issue_dt = secumstr.issue_dt .
t_cntrct_sprd = secumstr.cuflmrgn .
t_mat_dt = secumstr.mat_dt .
t_U_SSECID = secumstr.U_SSECID .

T_RECOVERY_PERCENT = SECUMSTR.RECOVERY_PERCENT .
T_RECOVERY_FG = SECUMSTR.RECOVERY_FG .
T_RESTRUCT_CD = SECUMSTR.RESTRUCT_CD .

END.

IF ( t_U_SSECID NE " " )
THEN DO:

FIND FIRST t_secumstr WHERE ( t_secumstr.sec_id EQ t_U_SSECID ) NO-LOCK NO-ERROR.
IF AVAILABLE t_secumstr
THEN DO:

t_u_s_cusip = t_secumstr.cusip .
IF ( t_secumstr.SECDESC6 ) NE " "
THEN t_secdesc6 = t_secumstr.SECDESC6 .
ELSE t_secdesc6 = t_secumstr.desc26 .

t_DTCC_REF_ENTITY_ID = t_secumstr.DTCC_REF_ENTITY_ID .

END.
END.


IF ( ( t_spec_act_no EQ "000000" ) OR
( t_spec_act_no EQ tddly_pl.firm_act )
)
AND
( ( t_spec_sec_id EQ " " ) OR ( t_spec_sec_id EQ tddly_pl.sec_id ) )
AND
( ( t_spec_u_s_sec_id EQ " " ) OR ( t_spec_u_s_sec_id EQ t_U_SSECID ) )
AND
( ( t_spec_u_s_CUSIP EQ " " ) OR ( t_spec_u_s_CUSIP EQ t_U_S_CUSIP ) )
AND
( ( t_spec_pair_clip EQ " " ) OR ( t_spec_pair_clip EQ t_DTCC_REF_ENTITY_ID ) )
AND
( ( t_part_corp_nme EQ " " ) OR ( t_secdesc6 BEGINS t_part_corp_nme ) )
AND
( ( t_part_cust_nme EQ " " ) OR ( t_cust_nme BEGINS t_part_cust_nme ) )

THEN DO:
CREATE positions_rpt.

positions_rpt.fcomp_cd = t_comp_cd .
positions_rpt.firm_act = tddly_pl.firm_act.
positions_rpt.dyopps = tddly_pl.dyopps .
positions_rpt.sec_id = tddly_pl.sec_id.
positions_rpt.t_desc26 = t_desc26.
positions_rpt.t_U_SSECID = t_U_SSECID.
positions_rpt.t_u_s_cusip = t_u_s_cusip.
positions_rpt.t_secdesc6 = t_secdesc6.
positions_rpt.t_RESTRUCT_CD = t_RESTRUCT_CD.
positions_rpt.t_dtdac_dt = t_dtdac_dt.
positions_rpt.t_issue_dt = t_issue_dt.
positions_rpt.t_cntrct_sprd = t_cntrct_sprd.
positions_rpt.recovery_percent = T_RECOVERY_PERCENT.
positions_rpt.recovery_fg = T_RECOVERY_FG.
positions_rpt.t_DTCC_REF_ENTITY_ID = t_DTCC_REF_ENTITY_ID .
positions_rpt.t_mat_dt = t_mat_dt.
.
totals = totals + 1.
END.
END.
END.

END PROCEDURE.
 
Hello,
In u're example, u've only a creation of temp-table to do what ? edition or just display ?. The use of smart-object is a choice, sometimes u don't need to use it and sometime yes. It depend of what u want to do with. Smart object let u many possibilities to send information or command from one object to other by one command. If u have a simple search window with a browse and a validation button, i think u will create a window in wich u will insert a browse and not a smart browse.
 
Tony,

ADM2 should definitely be on your 'things to look at' list for the future, but I would strongly advise you to master the basics of Progress first, before you look at the various 'add-ons'.

If you do this, you will find your progress in ADM2 much quicker in the long run.

The basic 4GL is relatively easy to understand, but SmartObjects have quite a steep learning curve which will be lessened the more you know about the nuts and bolts.

In short, learn to walk before you try to run. :)

Regards,

Lee (still learning after several years in Progress)
 
Back
Top