Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable Columns in FORM HEADER

Status
Not open for further replies.

gregor weertman

Programmer
Sep 29, 2000
195
NL
Hello,

def var l_col as int init 1.

FORM HEADER
"Country" AT l_col
WITH WIDTH 132 PAGE-TOP FRAME ccc.

Is it somehow possible to use a variable for column?

Regards Gregor
Gregor.Weertman@mailcity.com
 
Short answer: No

Long answer, according to Jedi Master John Campbell of White Star Software:

Code:
     "A frame in Progress is a static layout whose configuration is determined at the time a program is compiled.  It is a memory structure that is composted of text, labels, and data elements.  The rules determining frame layout are contained in the Progress routine called the Frame Manager...  Since all of the elements of a frame are known at the time a program is compiled, the Frame Manager is able to assemble them and determine the exact layout of the frame before the program is executed.  Although the size and contents are known at compile time, the location of the frame can be determined at any time, since the Frame Manager can locate the 'structure' anywhere."*

You can, using include files and passed parameters, set up a form definition so the layout of a frame could appear slightly different in two different programs -- as long as the layout can be determined by the Frame Manager at compile time (no variables).

You also can, using hides and overlays with multiple frames, "help" Frame Manager to achieve the desired effect by laying out different elements in different frames then placing those frame structures where you want using variables at run time -- but this gets messy in a hurry.

I hope this helps...
sshowers

*Quoted from "Programmer's Progress", Copyright 1991 White Star Software
 
Thank you for your responce sshowers.

I only want to use it to change my program more easily.

I just want to know how to do this.

{1} in an include file did not work and there seem
to be no widget for column in a "form header" like in
a normal "form".

regards Gregor
Gregor.Weertman@mailcity.com
 
Gregor:

I do not currently have access to the UIB to test this out in GUI but I know the following works in 8.3C CHUI:

File 1: frame.i
Code:
form header
   "Country"  at  {1}
   with width 40 page-top column {2} frame ccc.

File 2: prog.p
Code:
{frame.i 1 10}
view frame ccc.

Changing the first parameter moves "Country" within the frame and changing the second moves the frame around.

I hope this helps,
sshowers

 
I want this:

File 1: frame.i
form header
"Country" at {1}
with width 40 page-top column {2} frame ccc.


def var i1 as int init 1.
def var i2 as int init 10.
{frame.i i1 i2}
view frame ccc.

Progress does not understand this.

Gregor Gregor.Weertman@mailcity.com
 
The problem in your scenario is "{1}". Because a Progress frame is a static layout the Frame Manager needs to know -- at compile time -- where all of the elements go. A variable, by definition, varies and is therefore not static. The following, however, will work:

File 1: frame.i
Code:
form header
   "Country" at {1}
   with width 40 row {2} column {3} frame ccc.

File 2: prog.p
Code:
def var i-col as int  init 10 no-undo.
def var i-row as int  init 1 no-undo.

{frame.i 1 i-row i-col}
view frame ccc.

Because "{1}" is static the Frame Manager can lay the frame out at compile time and, using i-col and i-row with view frame and hide frame statements, you can move the frame around wherever you want at runtime.

I know it's not what you want but it seems to me, with some programming creativity, you could lay out your frame then make the row/column convention work by moving it around...

--sshowers

 
Thats is what I wanted to know.

I changed the program.
now it does not use frame headers any more.
It has variable column labels.


regards Gregor Gregor.Weertman@mailcity.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top