Read .w and .p file and get their objects defined in frame...

rcgomez11

Member
Progress Version : 10.1C
Platform: Windows 7 Professional 64Bit

Good day ProgressTalkers,

It's good to be back...
I'm trying to build a module that can create an html form from a .w and .p defined frame. I got these codes:

Code:
[COLOR=#333333]DEF VAR L-uno AS INT.[/COLOR]
[COLOR=#333333]DEF VAR L-dos AS DEC.[/COLOR]
[COLOR=#333333]DEF VAR L-tres AS LOG.[/COLOR]
[COLOR=#333333]DEF VAR L-padre AS WIDGET-HANDLE.[/COLOR]
[COLOR=#333333]DEF VAR L-hijo AS WIDGET-HANDLE.[/COLOR]
[COLOR=#333333]DEF VAR L-ciclo AS INT.[/COLOR]
[COLOR=#333333]DEFINE FRAME Marco[/COLOR]
[COLOR=#333333]L-uno[/COLOR]
[COLOR=#333333]L-dos[/COLOR]
[COLOR=#333333]L-tres[/COLOR]
[COLOR=#333333]WITH ROW 1 CENTERED OVERLAY.[/COLOR]

[COLOR=#333333]/* first you get the handle to the frame */[/COLOR]
[COLOR=#333333]L-padre = FRAME Marco:FIRST-CHILD.[/COLOR]
[COLOR=#333333]/* later you get the handle to the first widget in the frame */[/COLOR]
[COLOR=#333333]L-hijo = L-padre:FIRST-CHILD.[/COLOR]
[COLOR=#333333]/* loop through all the widgets in the frame */[/COLOR]
[COLOR=#333333]REPEAT WHILE VALID-HANDLE(L-hijo):[/COLOR]
[COLOR=#333333]/* display widget name, format and data-type */[/COLOR]
[COLOR=#333333]DISPLAY L-hijo:NAME L-hijo:FORMAT L-hijo[/COLOR]:D[COLOR=#333333]ATA-TYPE.[/COLOR]
[COLOR=#333333]/* get handle for next widget in the frame */[/COLOR]
[COLOR=#333333]L-hijo = L-hijo:NEXT-SIBLING.[/COLOR]
[COLOR=#333333]END. /* REPEAT WHILE VALID-HANDLE(L-hijo): */[/COLOR]

from plus_marca of this link http://www.progresstalk.com/showthr...jects-in-a-given-frame&highlight=list+objects and it gives me an idea on how to start the module. This is good but I want the frame to be dynamic like I will upload a .w or a .p to my module and searched for the frames then I'll apply the codes above to gather the objects defined inside that frame for me to convert that objects into html inputs.
I just wanted to know or just please lighten me up on how can I read a .w or .p file from an upload so I can make these wonderful lines of codes fitted to my requirements.
I hope I made myself clear to you guys and thanks in advance.

Sincerely,
Romel C. Gomez
 

Marian EDU

Member
The code you posted will work if you need 'frame/screen' information at run-time, meaning for a .w/.p you'll actually have to run that code and once the screen is visible you can use that code to walk through the widgets-tree.

If you need to get that info from the source code then a code parser is needed, take a look at proparse for that.
 
Top