Dynamic extent fill-in

Posted by Jagxx on 30-Jun-2011 06:55

Hi,

How can I create dynamically an extent FILL-IN?

  DEFINE VARIABLE hFillIn AS HANDLE      NO-UNDO.


      create FILL-IN hFillIn
      assign
        frame    = frame {&frame-name}:handle
        name    = 'FIL-165'
        column  = 20
        row        = 2
        hidden    = NO
        sensitive = YES   

        extent    = 10    --> That's not possible   
        .

Thanks in advance.

Jag

All Replies

Posted by Admin on 30-Jun-2011 07:01

extent = 10* --> That's not possible

EXTENT is not a property of the FILL-IN widget.

Just create 10 fill-in widgets (and store the handles in an array if you like).

    

Posted by rohit.ramak on 30-Jun-2011 08:38

but we can set extent of a variable viewed as fill-in when static...right ?

DEFINE VARIABLE cName AS CHARACTER VIEW-AS FILL-IN EXTENT 4 NO-UNDO.
DISPLAY cName.

Posted by Admin on 30-Jun-2011 08:46

but we can set extent of a variable viewed as fill-in when static...right ?

 

Exactly - but it's variable viewed as 4 fill-in's, 4 different handles... not one handle with and array...

Posted by jmls on 30-Jun-2011 09:01

you can "fake" it by the following:

DEFINE VARIABLE hFillIn AS HANDLE EXTENT 10 NO-UNDO.

DEF VAR i AS INT NO-UNDO.

DO i = 1 TO EXTENT(hfillin):

create FILL-IN hFillIn[i]

assign

frame = frame {&frame-name}:handle

name = 'FIL-165'

column = 1

row = 2 + i

hidden = NO

sensitive = YES

.

END.

Posted by Admin on 30-Jun-2011 09:11

you can "fake" it by the following:

Like I said, store the handles in an array if you like.

Posted by Jagxx on 30-Jun-2011 10:52

Thanks a lot for your answers.

I have created FILL-IN dynamically with do i = 1 to extent() and stored the handle in an temp-table because the number of FILL-IN is not always the same depending on the configuration.

define temp-table ttWidget no-undo
  field cWidget    as character
  field iOrder     as integer
  field hWidget    as handle
  field cDataType  as character
  field cInitValue as character
  field iFunktion  as integer
  field lIsExtent  as logical
  field iIndex     as integer
  index Main is primary unique cWidget iIndex
  index Order iOrder ascending
  .

Jag

Posted by Admin on 30-Jun-2011 10:56

Not knowing your exact use case and Progress version, but a dynamically sized array might be more lightweight than a temp-table.

DEFINE VARIABLE hFillIns AS HANDLE EXTENT .

/* later */

EXTENT (hFillIns) = 42 .

This thread is closed