| View previous topic :: View next topic |
| Author |
Message |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Tue Feb 04, 2003 4:47 am Post subject: |
|
|
Ravi,
I had the same problem. But as far as I know there is no way to align the message at CENTER in a PANEL Directly.
But there is a alternative solution to this. In the PANEL Field definition use JUST(ASIS) first. This will not strip the leading blanks in the message.
| Code: |
? TYPE(OUTPUT) INTENS(HIGH) JUST(ASIS)
|
Then before displaying the panel, include these lines in your REXX routine.
| Code: |
TEXTLINE = STRIP(TEXT)
TEXTLINE = CENTER(TEXTLINE, 75, ' ')
|
This will pad necessary blanks on both sides of the text. (75 is the screen width. Use 80 if you need so). so TEXTLINE variable contains the actual Centered text, Move this field to the panel field and display the panel.
This is the way I did it. |
|
| Back to top |
|
 |
CaptBill Beginner
Joined: 02 Dec 2002 Posts: 100 Topics: 2 Location: Pasadena, California, USA
|
Posted: Tue Feb 04, 2003 1:00 pm Post subject: |
|
|
In the Panel )ATTR section I define this:
% TYPE(TEXT)
Then in the first two lines of the )BODY I code this:
| Code: |
)BODY EXPAND(||)
% | | any text you want centered | |
|
and that does what I think you want. No need for REXX coding. |
|
| Back to top |
|
 |
Mervyn Moderator

Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Tue Feb 04, 2003 5:22 pm Post subject: |
|
|
Of course, CaptBill's solution has the advantage of working for any screen width.
Cheers,
Merv _________________ The day you stop learning the dinosaur becomes extinct |
|
| Back to top |
|
 |
Mike Beginner

Joined: 03 Dec 2002 Posts: 114 Topics: 0 Location: Sydney, Australia
|
Posted: Tue Feb 04, 2003 6:34 pm Post subject: |
|
|
There is an annoying problem with using EXPAND, in that it appears to centre based upon the unresolved data encoded within the expand characters. That is if you encode a variable within the expand characters (e.g. / /&message/ / in the following code), the message ends up being displayed to the right of centre. So centreing via Rexx might end up being less of a pain.
e.g. the following panel coding :-
[code:1:8321785619]
)BODY EXPAND(\\)
+---------- _________________ Regards,
Mike. |
|
| Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 702 Topics: 64 Location: USA
|
Posted: Mon Feb 16, 2004 7:26 am Post subject: |
|
|
I am new to this panel stuff. When I try this panel I get error -
| Code: |
ISPP122
Panel 'TEMPY' error
Invalid statement or keyword on )BODY heading statement.
Panel line where error was detected:
)BODY EXPAND(||)
|
Here is the code I used to test the Panel -
| Code: |
/* REXX to display Compile Panel
"control errors return"
*/
$panlib$ = 'lc.dib9065.rexxii'
address ispexec
"libdef ispplib dataset id('"$panlib$"')"
"display panel(tempy)"
if rc > 0 then nop
say rc
exit
|
I have tried using previously tested code but evrytime I am getting similar error.
Thanks,
Diba. |
|
| Back to top |
|
 |
Mervyn Moderator

Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Mon Feb 16, 2004 4:49 pm Post subject: |
|
|
Diba,
Please show us the whole panel. _________________ The day you stop learning the dinosaur becomes extinct |
|
| Back to top |
|
 |
Maton_Man Beginner

Joined: 30 Jan 2004 Posts: 123 Topics: 0
|
Posted: Mon Feb 16, 2004 7:15 pm Post subject: |
|
|
Diba,
Turn your numbering off.
Mike,
Did some of your panel coding get chopped off? It won't work as you have shown it. You need an )END statement. _________________ My opinions are exactly that. |
|
| Back to top |
|
 |
warp5 Intermediate

Joined: 02 Dec 2002 Posts: 429 Topics: 18 Location: Germany
|
Posted: Tue Feb 17, 2004 1:58 am Post subject: |
|
|
| Make sure you have not used the | for something (like attrib) before. |
|
| Back to top |
|
 |
Dibakar Advanced

Joined: 02 Dec 2002 Posts: 702 Topics: 64 Location: USA
|
Posted: Tue Feb 17, 2004 3:18 am Post subject: |
|
|
Maton Man,
NUM OFF and )END solved the problem.
Merv,
The Panel is exactly what you had provided, with \ changed to |. And I have added )END now.
Thanks,
Diba. |
|
| Back to top |
|
 |
|
|
|