Frames

manujmathew

New Member
Hi,this is a code

[FONT='Arial','sans-serif']define var aa as char init "abc".[/FONT]
[FONT='Arial','sans-serif']define var bb as char init "bbb".[/FONT]
[FONT='Arial','sans-serif']define var cnt as int.[/FONT]
[FONT='Arial','sans-serif']cnt = 0.[/FONT]
[FONT='Arial','sans-serif']for each pt_mstr where pt_part > "0006050000" no-lock with frame a:[/FONT]
[FONT='Arial','sans-serif']disp pt_part .[/FONT]
[FONT='Arial','sans-serif']if cnt = 1 then[/FONT]
[FONT='Arial','sans-serif']disp aa colon 1 with no-label.[/FONT]
[FONT='Arial','sans-serif']end.[/FONT]
[FONT='Arial','sans-serif'][/FONT]
[FONT='Arial','sans-serif']i want the o/p in this way[/FONT]
[FONT='Arial','sans-serif']when cnt = 0 then o/p shoild be without spaces in between that is continously after 003126 there should be no space ,003604 should come in the next line itself[/FONT]
[FONT='Arial','sans-serif'][/FONT]
[FONT='Arial','sans-serif']ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³003126 ³
³ ³
³003604 ³
³ ³
³003616 ³
³ ³
³003624 ³
³ ³
³003630 ³
³ ³
³003634 ³
³ ³
³003644 ³
³ ³
³003692 ³
³ ³
³003694 ³
³
when cnt = 1 then o/p is this which is correctly coming
[/FONT]
[FONT='Arial','sans-serif']ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³003126 ³
³abc ³
³003604 ³
³abc ³
³003616 ³
³abc ³
³003624 ³
³abc ³
³003630 ³
³abc ³
³003634 ³
³abc ³
³003644 ³
³abc ³
³003692 ³
³abc ³
³003694 ³
³abc ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
[/FONT]
manu
 
Thanks for the info :awink: But I think it is obviously that this is a code. Maybe you can enlighten us a little and tell us what you wanted to ask about this code.
 
Without the font stuff it is something like below.
Although I'm still not clear on the problem,output and question in general.:

Hi,this is a code
Code:
[FONT=Arial][SIZE=2]define var aa as char init "abc".[/SIZE][/FONT]
[FONT=Arial][SIZE=2]define var bb as char init "bbb".[/SIZE][/FONT]
[FONT=Arial][SIZE=2]define var cnt as int.[/SIZE][/FONT]
[FONT=Arial][SIZE=2]cnt = 0.[/SIZE][/FONT]
[FONT=Arial][SIZE=2]for each pt_mstr where pt_part > "0006050000" no-lock with frame a:[/SIZE][/FONT]
[FONT=Arial][SIZE=2]disp pt_part .[/SIZE][/FONT]
[FONT=Arial][SIZE=2]if cnt = 1 then[/SIZE][/FONT]
[FONT=Arial][SIZE=2]disp aa colon 1 with no-label.[/SIZE][/FONT]
[FONT=Arial][SIZE=2]end.[/SIZE][/FONT]
i want the o/p in this way shoild be without spaces in between that is continously after 003126 there should be no space ,003604 should come in the next line itself:

³003126 ³
³ ³
³003604 ³
³ ³
³003616 ³
³ ³
³003624 ³
³ ³
³003630 ³
³ ³
³003634 ³
³ ³
³003644 ³
³ ³
³003692 ³
³ ³
³003694 ³
³
when cnt = 1 then o/p is this which is correctly coming:

³003126 ³
³abc ³
³003604 ³
³abc ³
³003616 ³
³abc ³
³003624 ³
³abc ³
³003630 ³
³abc ³
³003634 ³
³abc ³
³003644 ³
³abc ³
³003692 ³
³abc ³
³003694 ³
³abc ³

manu

Casper
 
The problem is caused by variable aa being put at col 1 in frame a.

Because you are using "with frame a" in the for each loop all display references in that loop that don't specify a frame use frame a.

This means that your frame is implicitly the same as:
form pt_part skip aa at col 1 with frame a.
This puts the variable aa on the next line and seems to display pt_part on alternate lines.

I prefer to explicitly state the frame in display statements and to define the frame beforehand where possible, but this is merely personal preference. In generally only use WITH FRAME when I am using widgets.

There are several ways of fixing this but this is probably the easiest:

Code:
define var aa as char init "abc".
define var bb as char init "bbb".
define var cnt as int.
 
FORM pt_mstr.pt_part aa NO-LABEL WITH FRAME a.
cnt = 0.
for each pt_mstr WHERE pt_mstr.pt_part > 0006050000 NO-LOCK:
disp pt_mstr.pt_part aa WHEN cnt = 1 WITH FRAME a DOWN.
DOWN WITH FRAME a.
end.

Actually, this doesn't really give you what you want. Try using 2 frames:

Code:
define var aa as char init "abc".
define var bb as char init "bbb".
define var cnt as int.
FORM pt_mstr.pt_part aa NO-LABEL WITH FRAME a.
FORM pt_mstr.pt_part aa AT 1 NO-LABEL WITH FRAME aa.
PAUSE 0 BEFORE-HIDE.
cnt = 0.
RUN p_display.
cnt = 1.
RUN p_display.
 
PROCEDURE p_display:
for each pt_mstr WHERE pt_mstr.pt_part > "0006050000" NO-LOCK:
CASE cnt:
WHEN 1 THEN do:
disp pt_mstr.pt_part aa WITH FRAME aa DOWN.
DOWN WITH FRAME aa.
END.
OTHERWISE do:
disp pt_mstr.pt_part WITH FRAME a DOWN.
DOWN WITH FRAME a.
END.
END CASE.
DOWN WITH FRAME a.
end.
END PROCEDURE.
 
Back
Top