Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 22 JUN 2005 10:05:57AM B Cameron wrote:

What is the best way to get a list of the bound controls on a form without starting the window so that I can get the dict item name from the control as well as the table name.

I know I can use the CTRLMAP but I do not want to start the window. I would rather select all SYSREPOSWINS that match a table and then read that record.


At 22 JUN 2005 11:52AM Bruce Cameron wrote:

Ok, I get it… sometimes I have to ask the question in fairness to the client I am working for to get something done quick so I came to this well first, but… anyway here is what I did… any comments, pot shots, bugs feel free…

From system editor exec line

RUN FIND_MISSING_DICTITEMS "YOURAPP","ATABLE"

Function Find_Missing_DictItems(AppId,Table)

*

* B. Cameron.

* Function to locate any form bound dict items missing in system.

*

Declare Function Get.Reccount

*

If Assigned(AppId) Else AppId=" ; If AppId=" Then AppId=@APPID

If Assigned(Table) Else Table=" ; If Table=" Then Call Send_Dyn("Need table var.") ; Return ""

*

Open "SYSREPOSWINS" to SWFile Else Call Send_Dyn("Could not open SYSREPOSWINS.") ; Return 0

*

For x=0 to 8 ; ClearSelect x ; Next x

Totsw=Get.RecCount(SWFile,Flag,0)

*

ValidCtrls=EDITFIELD EDITTABLE LISTBOX COMBOBOX RADIOBUTTON CHECKBOX VSCROLLBAR HSCROLLBAR"

*

Select SwFile

Eoj=0

Cnt=1

DList="

Loop

 ReadNext Id Else Eoj=1

Until Eoj=1 Do

 Call Send_Info(Cnt:" of ":Totsw:"  -  ":Id) ; Cnt += 1      
 App=Field(Id,"*",1)
 WinId=Field(Id,"*",3)
 If App=AppId Then
    Read SWItem from SWFile,Id Then
       If index(SWItem,Table,1) Then
          TotR=count(SWItem,@FM) + (SWItem # "")
          TotRx= TotR - 2
          For Val=4 to TotRx
             If index(ValidCtrls,SWItem,1) Then
                tbls="
                tbls=SWItem
                tbls=SWItem
                convert char(251) To @VM in tbls
                TotC=count(tbls,@VM) + (tbls # "")
                For valc=1 to TotC
                   tname=tbls
                   ditem=tbls
                   chk=xlate("DICT.":tname,ditem,"","X")
                   if chk=" then
                      locate ditem in dlist using @FM setting pos else
                         dlist=ditem
                         dlist=tname
                         dlist=winid
                      end
                   end
                Next Valc
             End
          Next Val
       end
    end
 End

Repeat

totd=count(dlist,@VM) + (dlist # "")

For row=1 to totd

 call send_dyn(fmt(dlist,"L#30"):" ":fmt(dlist,"L#20"):" ":dlist)

next row

*

RETURN ""

Could be modified for more robust purposes but for a start will list items.


At 22 JUN 2005 11:56AM Bruce Cameron wrote:

The line

locate ditem in dlist using @FM setting pos else

should be @VM not @FM.

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/4b03ff4037e4373d85257028004d733a.txt
  • Last modified: 2023/12/30 11:57
  • by 127.0.0.1