Source Code Problem: Loop true all controls on a window 
Author Message
 Source Code Problem: Loop true all controls on a window

Dear people,

I'm trying to find out how many controls there are located on a window or
report,  so I can loop true all controls. Now this code works:

    settarget(Report)                                     ! Select the
report insteat of the progress window
    Loop i# = 1 to ?ds_RegisteredCompany  ! ?ds_Registered Company is the
last controll
         hide(i#)                                               ! Hide the
controll
    end
    settarget()                                                ! select the
progress window

But the problem is that it only works for this specific report. There's got
to be a way to replace the last controll equate with a property like
window{prop:ControlCount} or something.



Mon, 08 Aug 2005 22:13:59 GMT  
 Source Code Problem: Loop true all controls on a window
Won't firstfield() and lastfield() work?

                            -Ray.


Quote:
> Dear people,

> I'm trying to find out how many controls there are located on a window or
> report,  so I can loop true all controls. Now this code works:

>     settarget(Report)                                     ! Select the
> report insteat of the progress window
>     Loop i# = 1 to ?ds_RegisteredCompany  ! ?ds_Registered Company is the
> last controll
>          hide(i#)                                               ! Hide the
> controll
>     end
>     settarget()                                                ! select the
> progress window

> But the problem is that it only works for this specific report. There's got
> to be a way to replace the last controll equate with a property like
> window{prop:ControlCount} or something.



Mon, 08 Aug 2005 22:30:25 GMT  
 Source Code Problem: Loop true all controls on a window
Thanks it works forgot had tried it but I forgot the () behind it.


Quote:
> Won't firstfield() and lastfield() work?

>                             -Ray.



> > Dear people,

> > I'm trying to find out how many controls there are located on a window
or
> > report,  so I can loop true all controls. Now this code works:

> >     settarget(Report)                                     ! Select the
> > report insteat of the progress window
> >     Loop i# = 1 to ?ds_RegisteredCompany  ! ?ds_Registered Company is
the
> > last controll
> >          hide(i#)                                               ! Hide
the
> > controll
> >     end
> >     settarget()                                                ! select
the
> > progress window

> > But the problem is that it only works for this specific report. There's
got
> > to be a way to replace the last controll equate with a property like
> > window{prop:ControlCount} or something.



Mon, 08 Aug 2005 23:33:34 GMT  
 Source Code Problem: Loop true all controls on a window

Quote:
> > I'm trying to find out how many controls there are located on a window
or
> > report,  so I can loop true all controls. Now this code works:

> >     settarget(Report)                                     ! Select the
> > report insteat of the progress window
> >     Loop i# = 1 to ?ds_RegisteredCompany  ! ?ds_Registered Company is
the
> > last controll
> >          hide(i#)                                               ! Hide
the
> > controll
> >     end
> >     settarget()                                                ! select
the
> > progress window

> > But the problem is that it only works for this specific report. There's
got
> > to be a way to replace the last controll equate with a property like
> > window{prop:ControlCount} or something.

Try this:

settarget(report) !for report

CurControl = 0  !long
i#=0

LOOP
    CurControl = TARGET{PROP:NextField, CurControl}
   i# +=1
   ! IF CurControl AND (CurControl{PROP:Type} = CREATE:line)
   !    CurControl{PROP:Color} = color:line
   ! END
WHILE CurControl



Mon, 08 Aug 2005 23:37:20 GMT  
 Source Code Problem: Loop true all controls on a window

Quote:
> I'm trying to find out how many controls there are located on a window or
> report,  so I can loop true all controls. Now this code works:

>     settarget(Report)                                     ! Select the
> report insteat of the progress window
>     Loop i# = 1 to ?ds_RegisteredCompany  ! ?ds_Registered Company is the
> last controll
>          hide(i#)                                               ! Hide the
> controll
>     end
>     settarget()                                                ! select the
> progress window

> But the problem is that it only works for this specific report. There's got
> to be a way to replace the last controll equate with a property like
> window{prop:ControlCount} or something.

LASTFIELD( )

HTH

Jules
--
Julian Martin, Action Data Systems



Mon, 08 Aug 2005 22:53:44 GMT  
 Source Code Problem: Loop true all controls on a window
Hi A,

On Thu, 20 Feb 2003 15:13:59 +0100, "A. Zuidgeest"

Quote:

>But the problem is that it only works for this specific report. There's got
>to be a way to replace the last controll equate with a property like
>window{prop:ControlCount} or something.

There are two ways:

Loop I = FirstField() to LastField()

This works on all windows and reports, but it has a limitation:  It
will NOT include toolbar controls or menu controls and it will NOT
include control created at runtime.  For that you will need:

Loop
  I = Window{Prop:NextField,I}
  If Not I
    Break
  End
End

I always use the Prop:NextField method as then I'm sure I get all
controls, no matter where they are.

Best regards,

Arnr Baldvinsson
Icetips Software        
San Antonio, Texas, USA
www.icetips.com

ICQ:  113314380

Subscribe to information from Icetips.com:
http://www.icetips.com/getnotificationinfo.htm



Tue, 09 Aug 2005 03:37:16 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Source Code Control problem

2. Source Code Control - Check in problems

3. It’s me again with Source Code Control problems....

4. Problems with true control position

5. Source code control for VisualWorks ?

6. Source Code Control With RealBasic

7. Digitalk's Team/V for Source Code Control

8. Source Code Control system wanted

9. Source code for CW Stock Control

10. Source code control in Eiffel

11. Best source code control program

12. LINUX - Source Code Control with Perforce doesn't register

 

 
Powered by phpBB® Forum Software