Giving up the will to live

Cringer

ProgressTalk.com Moderator
Staff member
Just come across this code...
Code:
DEFINE VARIABLE lv-String AS CHARACTER NO-UNDO.

FIND FIRST ICMAS._file WHERE icmas._File._file-name = "FrontEndSpecificationRule" NO-LOCK NO-ERROR.
     
IF AVAILABLE icmas._file THEN
DO lv-i = 1 TO 3:

   FIND FIRST icmas._field OF icmas._file WHERE icmas._field._field-name = IF lv-i = 1 THEN 
                                                            "FerFunctionalArea"
                                                         ELSE
                                                         IF lv-i = 2 THEN
                                                            "FerMeaningType"
                                                         ELSE
                                                            "FerDataType" NO-LOCK NO-ERROR.
   IF AVAILABLE icmas._field THEN
      ASSIGN lv-String = REPLACE(ICMAS._field._view-as,"VIEW-AS COMBO-BOX LIST-ITEM-PAIRS ","")
             lv-String = SUBSTRING(lv-String,1,INDEX(lv-String," SIZE") - 1)
             lv-String = REPLACE(lv-String,"VIEW-AS RADIO-SET","") 
             lv-String = REPLACE(lv-String,"RADIO-BUTTONS","")            
             lv-String = TRIM(lv-String).

   DO lv-j = 1 TO NUM-ENTRIES(lv-String) / 2:
      IF lv-i = 1 THEN
         ASSIGN lv-PermittedValuesArea = lv-PermittedValuesArea + 
                                         TRIM(ENTRY(lv-j + lv-j - 1,lv-String),"~"") + "," +
                                         TRIM(ENTRY(lv-j + lv-j,lv-String),"~"") +
                                         IF lv-j NE NUM-ENTRIES(lv-String) / 2 THEN "," ELSE "" NO-ERROR.
      ELSE
      IF lv-i = 2 THEN
         ASSIGN lv-PermittedValuesType = lv-PermittedValuesType + 
                                         TRIM(ENTRY(lv-j + lv-j - 1,lv-String),"~"") + "," +
                                         TRIM(ENTRY(lv-j + lv-j,lv-String),"~"") +
                                         IF lv-j NE NUM-ENTRIES(lv-String) / 2 THEN "," ELSE "" NO-ERROR.
      ELSE
         ASSIGN lv-PermittedDataType  = lv-PermittedDataType + 
                                         TRIM(ENTRY(lv-j + lv-j - 1,lv-String),"~"") + "," +
                                         TRIM(ENTRY(lv-j + lv-j,lv-String),"~"") +
                                         IF lv-j NE NUM-ENTRIES(lv-String) / 2 THEN "," ELSE "" NO-ERROR.

   END.

END. /* DO lv-i = 1 TO 3 */

So you mean to say, to add a permitted value I have to make a database change? Whoop dee doo.
 

GregTomkins

Active Member
Our shop has a strong aversion to database (schema) changes (in some cases for good reasons, in others maybe not so much).

So, basically, I sympathize ;)

But I guess if it's just you and a Procedure Editor, or you have developed a good way of efficiently controlling and propagating schema changes, this might be a realistic way of doing things.
 

Cringer

ProgressTalk.com Moderator
Staff member
Schema changes aren't too much of an issue but it does require a full system rebuild. We do one of those approximately every 6 weeks. In the meantime I have a reasonably urgent request due to new business which means I'm going to have to implement the change that should have been made, and propagate it through all places that refer to the schema for this table.
 
Top