MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Center alignment of a message in a Panel

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Feb 04, 2003 4:47 am    Post subject: Reply with quote

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
View user's profile Send private message
CaptBill
Beginner


Joined: 02 Dec 2002
Posts: 100
Topics: 2
Location: Pasadena, California, USA

PostPosted: Tue Feb 04, 2003 1:00 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Tue Feb 04, 2003 5:22 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mike
Beginner


Joined: 03 Dec 2002
Posts: 114
Topics: 0
Location: Sydney, Australia

PostPosted: Tue Feb 04, 2003 6:34 pm    Post subject: Reply with quote

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
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 702
Topics: 64
Location: USA

PostPosted: Mon Feb 16, 2004 7:26 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Mon Feb 16, 2004 4:49 pm    Post subject: Reply with quote

Diba,

Please show us the whole panel.
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Maton_Man
Beginner


Joined: 30 Jan 2004
Posts: 123
Topics: 0

PostPosted: Mon Feb 16, 2004 7:15 pm    Post subject: Reply with quote

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
View user's profile Send private message
warp5
Intermediate


Joined: 02 Dec 2002
Posts: 429
Topics: 18
Location: Germany

PostPosted: Tue Feb 17, 2004 1:58 am    Post subject: Reply with quote

Make sure you have not used the | for something (like attrib) before.
Back to top
View user's profile Send private message Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 702
Topics: 64
Location: USA

PostPosted: Tue Feb 17, 2004 3:18 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group