Larry

In 7.5 this would be very easy to do, because in a form you now can press
F3, and one of the options is "Form COmponent IDs".  You could click on all
of them click on OK and you'd get in your editor a string of all of them.
Then you could

(I haven't tested this code - but you get the id)

SET VAR eCompString = (CTXT('(') + 'the string of compids'+CTXT(')'))
SET VAR eCounter = 0
SET VAR eComponentID TEXT = NULL
WHILE #PI > 0 THEN
  SET VAR eCounter = (.eCounter + 1)
  SET VAR eComponentID = (SSUB(.eCompString,.eCounter))
  IF eComponentID IS NULL THEN
    BREAK
  ENDIF
  PROPERTY .eComponentID READ_ONLY 'TRUE'
ENDWHILE



David Blocker
[EMAIL PROTECTED]
781-784-1919
Fax: 781-784-1860
Cell: 339-206-0261
----- Original Message -----
From: "Lawrence Lustig" <[EMAIL PROTECTED]>
To: "RBG7-L Mailing List" <[email protected]>
Sent: Thursday, June 02, 2005 5:21 PM
Subject: [RBG7-L] - Re: Form Questions...


> > You are correct Larry, I am trying to save coding work by placing the
> > decision of whether the form is accessed in the EDIT or BROWSE modes
inside
> > the form rather that have to code everywhere the form is called.
>
> Right now, the only way I can think of doing this is to individually set
each
> control to read only.  This is tedious, but you don't have to write a
separate
> property command for each control -- just store a list of controls in a
comma
> delimited string and iterate over it with SSUB and WHILE.  You still have
to
> maintain that string, however, whenever you add controls.
>
> You could also write some code that would parse the contents of the
> sys_form_data column in the forms table and extract all the control names.
>
> Here are three separate enhancements I can think of that would make things
> easier:
>
> 1. A form level READ-ONLY property that would change the property for all
> controls on the form (similar to the ENABLED property currently available,
but
> without the problems you encountered).
>
> 2. A table level READ-ONLY property.  You would still have to apply this
> separately to each table on your form, but it would give you the
substantial
> advantage that you could now have additional levels of security that would
make
> one table on the form editable while the others would be read only.
>
> 3. A form level variable RBTI_FORM_CONTROLS that would give you the comma
> separated list of form controls that you could iterate over.  This would
allow
> you to do anything you want with the controls.  It would probably be
slower
> (since you would have to iterate over all the controls) and you might run
into
> a problem if you had lots of controls with long names since even NOTE
variables
> are limited to 4K of length.
>
> --
> Larry
>
>

Reply via email to