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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I am hard coding in Visual FoxPro 6 1

Status
Not open for further replies.

itc1

IS-IT--Management
Sep 18, 2003
65
US
I am hard coding in Visual FoxPro 6. I am having trouble having the output text bolded. What is the program code for specifying that the output text should appear in Bold.
Thanks.
 
ITC1

If I understand you correctly, you are creating your own reports instead of using the reports writer. If so, you are probably sending the output to a text file or directly to the printer. If this is true, you will I believe you need to refer to your printer manual to determine the escape codes for your specific printer. The printers operate under Printer Control Language (PCL) and the PCL commands can vary from printer to printer. It has been a while since I did anything like that, but if my memory is correct, it was not a pleasant experience.

Ps. are you affiliated with the Navy




Jim Osieczonek
Delta Business Group, LLC
 
In case you're just using @SAY the syntax is like:

@3,3 SAY 'hi' FONT 'arial' STYLE 'bold'


Jim
 
Hi Jim, thanks for the help. I just retired from the Navy. I was an Information Technology Chief. I work as an IT Manager at a publishing company. Let me give you a little more detail about my problem. I have a Visual FoxPro 6 program that does some manipulation and outputs the data into an email. It was requested that I put a copyright disclaimer in the email and make it bold. I was able to get the disclaimer in the program and it appeared in the output email but I can't bold the text. Can you help? I have never program in VFP before. Thanks
 
A lot will depend on the technique and format of the email messages you create. If you use "plain text", then there isn't much hope of bolding anything. If you create RTF or HTML messages, then it should be pretty straight forward. Are you using Outlook automation, CDO, MAPI, or even BLAT to "send" the messages? Some code is always the best place to start - it makes it easier to "fix" something.

Rick
 
itc1
I think your problem isn't really a foxpro problem. You have to decide whether you set up your email as plain text, rtf, or html. In html you can use html tags like <b> and </b>. So we need more information how you output the data into the email and which format it is.

hope this is a small step for you.

Georg Nickel
Software Development
Germany

 
Thanks for all the help so far. The output goes to Pegasus Mail in plain text. There are fwrite statements before the text that needs bolded. Here's what it looks like:

=fwrite(handle1,&quot;\plain\plain\f1\fs20\lang1033\f1 IT IS UNLAWFUL TO EMAIL THIS ISSUE OR AN ARTICLE TO ANYONE, TO PUT ALL OR PART OF THIS ISSUE ON YOUR INTRANET OR ON THE WEB, OR TO RE-DISTRIBUTE&quot;)
=fwrite(handle1,&quot;\par EMAIL OR PRINTED COPIES OF ANY PART OF ANY ISSUE. CONTACT SUSAN HASTY, PUBLISHER, NEWSRX, FOR LICENSE PRICING FOR REDISTRIBUTION OF THIS&quot;)
=fwrite(handle1,&quot;\par CONTENT. EMAIL HER AT SUSAN@NEWSRX.COM IF YOU KNOW OF SOMEONE UNLAWFULLY DISTRIBUTING THIS CONTENT INSIDE OR OUTSIDE YOUR ORGANIZATION. \plain\plain\f1\fs20\lang1033\f1 \par\par&quot;)
=FWRITE(handle1,&quot;\plain\plain\f1\fs20\lang1033\f1 Copyright 2003 NewsRx. All rights reserved. This information shall not, in whole or in part, be redistributed, reproduced, or put into a computer without prior written permission. Possession or distribution of an illegal&quot;)
=fwrite(handle1,&quot;\par photocopy of all or part of this information -even for internal use- is PROHIBITED BY LAW (17 U.S.C. 504) and will result in civil or crimminal prosecution. Report offenses to the publisher. \plain\plain\f1\fs20\lang1033\f1 \par&quot;)
=fclose(handle1)
 
This looks like RTF, try \b added to your format code

=FWRITE(handle1,&quot;\plain\plain\f1\fs20\lang1033\f1\b Copyright 2003 NewsRx

Attitude is Everything
 
Thank you very much danceman. That worked. Imagine I had been working on this for hours and all I had to do was put the \b at the end. Thanks again.
 
Gee, I didn't get back into the thread, but that's okay it looks like your problem is solved.

Likewise, I am a former ITC in the Navy Reserves, but I still claim to be a DPC <g>. I spent 10 years on active duty and 10 years as a reservist.



Jim Osieczonek
Delta Business Group, LLC
 
Danceman, just one more thing. The bold now works when the output is sent to Pegasus Mail, however when I forward the email to my AOL account or to Outlook, the text is not bolded. Also the format of the text is different. There are breaks or blank lines where there should not be. I wanted an standard format no matter what email is used to open the message. When using Pegasus the format is exactly the way it should be and it's bolded. Here is some of the code again: Thanks for any help

=fwrite(handle1,&quot;{\stylesheet{\fs20\cf2\cb1 Normal;}{\cs1\cf2\cb1 Default Paragraph Font;}}&quot;)
=fwrite(handle1,chr(13)+chr(10))
=fwrite(handle1,&quot;\paperw12240\paperh15840\margl2919\margr2919\margt1440\margb1440\headery720\footery720\deftab680\formshade\aendnotes\aftnnrlc\pgbrdrhead\pgbrdrfoot&quot;)
=fwrite(handle1,chr(13)+chr(10))
=fwrite(handle1,&quot;\sectd\pgwsxn12240\pghsxn15840\marglsxn2919\margrsxn2919\margtsxn1440\margbsxn1440\headery720\footery720\sbkpage\pgncont\pgndec&quot;)
=fwrite(handle1,chr(13)+chr(10))
=fwrite(handle1,&quot;Attached is your &quot;+thistitle+&quot; &quot;+filetype+&quot; file for the week of &quot;+isdate1+&quot;.\par\par&quot;)
=fwrite(handle1,&quot;\par \par Regards, \par \par Chantay Jones\par IT Manager\par NewsRx \plain\plain\f1\fs20\lang1033\f1 \par\par &quot;)
=fwrite(handle1,&quot;\rtf\rtf\f1\fs20\lang1033\f1\b IT IS UNLAWFUL TO EMAIL THIS ISSUE OR AN ARTICLE TO ANYONE, TO PUT ALL OR PART OF THIS ISSUE ON YOUR INTRANET OR ON THE WEB, OR TO RE-DISTRIBUTE EMAIL OR&quot;)
=fwrite(handle1,&quot;\par PRINTED COPIES OF ANY PART OF ANY ISSUE. CONTACT SUSAN HASTY, PUBLISHER, NEWSRX, FOR LICENSE PRICING FOR REDISTRIBUTION OF THIS CONTENT.&quot;)
=fwrite(handle1,&quot;\par EMAIL HER AT SUSAN NEWSRX.COM IF YOU KNOW OF SOMEONE UNLAWFULLY DISTRIBUTING THIS CONTENT INSIDE OR OUTSIDE YOUR ORGANIZATION. \rtf\rtf\f1\fs20\lang1033\f1\b \par\par&quot;))
=fwrite(handle1,&quot;\rtf\rtf\f1\fs20\lang1033\f1\b Copyright 2003 NewsRx. All rights reserved. This information shall not, in whole or in part, be redistributed, reproduced, or put into a computer without prior written permission.&quot;)
=fwrite(handle1,&quot;\Possession or distribution of an illegal of all or part of this information -even for internal use- is PROHIBITED BY LAW (17 U.S.C. 504) and will result in civil or crimminal prosecution.&quot;)
=fwrite(handle1,&quot;Report offenses to the publisher. \rtf\rtf\f1\fs20\lang1033\f1\b \par&quot;)
=fclose(handle1)
 
hi jimmo, I called myself a DPC for the longest time. My dress blues still have the DP rating. When they tried to call us RM's I was angry and told everyone that I was no RM that I was a DP. But when they came to their senses and made us IT's, I decided I could now call myself an IT. Hopefully, I can get some help with Visual FoxPro in the futre. Thanks.
 
I am using the report writer; I am having difficulty getting the total amount field to show the dollar amount in the correct format. For example: $42,348 shows on the report as $42348.0000 I need it to show as $42,348 on the report with the commas in the correct place. Can anyone help me. Thanks in advance.
 
Put a format in the field:

99,999,999.99

That should take care if it.



Side note - I still have my dress blues and they also have the DP rating on it.

Jim Osieczonek
Delta Business Group, LLC
 
Regarding getting it to be bold no matter what client:

Different email clients handle stuff differently; some only handle plain text, so this is an impossible ideal.


However, I think that html is a more widely supported format than RTF, so if you can figure how to use that in your current situation, it may have better results.
 
I am trying to check for the presence of no Tabs in a file.
When I use the following code, it gives me all the records that have tabs. How can I specify to show me records with no Tabs. Thanks in advance.

lbrack = CHR(13)
CNT = OCCURS(lbrack,s)
cntx=MOD(CNT, 2)
IF cntx>0
SET ALTERNATE ON
SET TALK ON
?reccnt
??&quot; - Tabs Are Present&quot;
SET ALTERNATE OFF
ENDIF
 
* if I am following you correctly - this should do it.

lnTabs = 0
lnNoTabs = 0
lbrack = CHR(13)

SCAN
IF OCCURS(lbrack,s) = 0
lnNoTabs = lnNoTabs + 1
ELSE
lnTabs = lnTabs + 1
ENDIF
ENDSCAN

SET ALTERNATE ON
SET TALK ON
?reccnt
??&quot; - Tabs Are Present&quot;
SET ALTERNATE OFF





Jim Osieczonek
Delta Business Group, LLC
 
thanks so much jimmo, it looks like it finds the first story without a tab and stops. I need it to continue looking at the whole story and give me the record number of the story that don't have tabs. It printed out: 1 - Tabs are not present on the computer screen which is what I want. thanks so much for your help
 
jimmo, it looks like the code finds the first record and stops there. Also the first paragraph of each story in the database should not have a tab. However the remaining paragraphs should have tabs. I want to be able to see the records where paragraphs in the remaining stories(except the first paragraph) don't have tabs. I also want to see each record number of the records I need to add tabs displayed on my monitor. Thanks so much for your help.
 
I must admit, I am confused. Can you try to type a sample bit of what your data looks like and elaborate.

Example

blah blah balh. blah blah balh. blah blah balh. blah blah balh. blah blah balh. blah blah balh. blah blah balh. blah blah balh.

{TAB}blah blah balh. blah blah balh. blah blah balh. blah blah balh. blah blah balh. blah blah balh.

OR whatever it looks like.

Also, you may wish to make this a new post in order to generate attention from others.



Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top