×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

printing graphic characters in foxpro 2.6 for windows, fixed font scr

printing graphic characters in foxpro 2.6 for windows, fixed font scr

printing graphic characters in foxpro 2.6 for windows, fixed font scr

(OP)
Q1) In DOS I was able to create graphic reports by using the CHR() function, but I am wondering if anybody knows of a way to print graphic chars in Windows (I do use the report writer, but sometimes I need to generate graphics in a .PRG). Q2) Does anybody know if one can use a fixed font when showing a popup...... Thank You.

RE: printing graphic characters in foxpro 2.6 for windows, fixed font scr

Question #1 - Never Tried it in Windows.

Question #2 - Here is a routine for you.
*/***************************************************************************
*/Program : function MSGWWAIT
*/System : Fox Library
*/Purpose : Displays Message window and waits for a key press
*/Returns : Integer - Number of lines needed to display the message
*/Syntax : = MsgWwait(Msg,Row,clr,name)
*/Parameter : String - Msg - Text to be displayed in the window
*/ : Integer - Row - Top screen row of message box
*/ : Integer - Clr - color scheme to use
*/ : String - Name- For personalized messages to the user
*/Default : Row = mid screen
*/Requires : Nothing
*/Changes : Nothing
*/Calls : Fillaray()
*/Version : 1.0
*/Dated : 28/05/1989
*/Written By: David W. Grewe
*/***************************************************************************
*& Message
*/***************************************************************************
*/ Record Of Change
*/
*/***************************************************************************
parameter P_MSG,P_PERSON,P_ROW,P_CLR,P_ICON
private P_MSG, P_ROW, P_CLR, L_PARA, L_PLACE, L_LEN, L_CLM, L_COUNT
*
* Parameter check
*
L_PARA = parameters()
if L_PARA < 1 .or. type("P_Msg") # "C"
wait window "First Parameter Passed to Function MsgWWait Is Not A String."
return 0
endif
if L_PARA < 3
P_ROW = -1
endif
if L_PARA < 4
P_CLR = 7
endif
if empty(P_PERSON)
P_PERSON=""
endif
if empty(P_ICON)
P_ICON=""
endif
*
* Main Part Of Function
*
private array LC_ARRAY(10)
dimension LC_ARRAY(10)
L_LEN = len(P_MSG)
lnCheck=at(chr(13),P_MSG)
if lnCheck > 0
L_TEMP=substr(P_MSG,1,lnCheck-1)
P_MSG=substr(P_MSG,lnCheck+1)
else
L_TEMP="Please Notice"
endif
L_LEN = iif(L_LEN>60, 65, iif(L_LEN<45 , 50, L_LEN+5))
L_COUNT = FILLARAY(P_MSG,"LC_ARRAY",L_LEN)
L_CLM=(scols()-L_LEN)/2
P_ROW=iif(P_ROW+L_COUNT+2 > srows(), srows()-2-L_COUNT, iif(P_ROW < 0, int((srows()-L_COUNT)/2), P_ROW))
*
if empty(P_ICON)
define window message at P_ROW,L_CLM size L_COUNT+4,L_LEN ;
in desktop system nozoom nogrow noclose float nomdi nominimize ;
title P_PERSON ;
font "FixedSys",9 ;
color scheme (P_CLR)
else
define window message at P_ROW,L_CLM size L_COUNT+4,L_LEN ;
in desktop system nozoom nogrow noclose float nomdi nominimize ;
title P_PERSON ;
font "FixedSys",9 ;
icon file (P_ICON) ;
color scheme (P_CLR)
endif
*
if P_ROW<0
move window MESSAGE center
endif
activate window message top
@ 0,0 say padc(L_TEMP,L_LEN)
@ 1,0 to 1,L_LEN
*
for L_LINE = 2 to L_COUNT+1
@ L_LINE,0 say padc(proper(LC_ARRAY[L_LINE-1]),L_LEN)
endfor
*
@ L_LINE,0 to L_LINE,L_LEN
@ L_LINE+1,0 say padc("Press A Key Or Mouse Button To Continue ",L_LEN)
set cursor off
on escape release window message
wait "" to NOTHING
*
* Clean Up The Enviroment
*
set cursor on
release window message
release LC_ARRAY
release P_MSG, P_ROW, P_CLR, P_PERSON, L_PARA, L_PLACE, L_LEN, L_CLM, NOTHING
return L_COUNT

*/***************************************************************************
*/Program : function FILLARAY
*/System :
*/Purpose : breaks up a string into an array
*/Syntax : = fillaray(string,array,size)
*/Returns : Integer - lines - number of lines required to fill the array
*/Parameter : String - string - the char string or database filed to break up
*/ : String - array - the name of the array to use
*/ : Integer - size - the length of the array strings to be returned
*/Changes : The array containing the string pieces
*/Requires : THE ARRAY MUST BE DECLARED IN THE CALLING PROGRAM
*/Calls :
*/Version : 1.0
*/Dated : 22 Nov 1993
*/Written By: David W. Grewe
*/***************************************************************************
*& Array Function
*/***************************************************************************
*/ Record Of Change
*/
*/***************************************************************************
parameters P_STR,P_ARRAY,P_SIZE
external array (P_ARRAY)
private P_STR, P_SIZE, P_ARRAY
P_STR = alltrim(P_STR)+" "
*
private L_COUNT, L_LEN, L_STR, L_PLACE
L_COUNT = 0 && number of array elements used
L_LEN = len(P_STR) && length of string to be worked on
L_STR = " " && swap var to hold a piece of P_STR
L_PLACE = 0 && where a blank space is
*
if len(P_STR) > P_SIZE
do while len(alltrim(P_STR)) > 1
L_COUNT = L_COUNT + 1
L_STR = substr(P_STR,1,P_SIZE)
L_PLACE = rat(" ",L_STR)
&P_ARRAY(L_COUNT) = alltrim(substr(P_STR,1,L_PLACE))
P_STR = substr(P_STR,L_PLACE)
enddo
else
L_COUNT = 1
&P_ARRAY(1) = P_STR
endif
return L_COUNT

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close