Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!nic.csu.net!beach.csulb.edu!ericp From: ericp@beach.csulb.edu (Eric Pederson CSE) Newsgroups: comp.databases Subject: Re: Clipper SETPRC() function question Message-ID: <1990Dec4.021934.6857@beach.csulb.edu> Date: 4 Dec 90 02:19:34 GMT References: <2758@dsacg2.dsac.dla.mil> <1990Nov29.020747.22995@xenitec.on.ca> Organization: Cal State Long Beach Lines: 35 <2758@dsacg2.dsac.dla.mil> nam2254@dsacg2.dsac.dla.mil (Tom Ohmer) writes: >An application that I have been tasked to modify uses the SETPRC() >function in a few places. The use of and need for this function >is not obviously clear to me. I am familiar with using @...SAY >commands to print text and have read the manual and Straley's book, >but would appreciate an experienced guru's explanation. Many thanks >in advance. It's usually handy if you are sending control character sequences (eg. underline on/off, etc) that bump the internal prow()/pcol() values but don't actually move the printhead. Say for example you want a report heading to contain actual printer underlines (not just dashes on the next line). Say that the report contains two columns, one starting in print position 10, the next in print position 25. In operation, if you @ SAY things in consecutive columns, xBASE outputs the appropriate amount of spaces to get to the next column by using it's internal pcol() counter. However, if the strings you send to turn underlining on and off contain a total of say 6 characters, xBASE will think the printhead is over 6 more columns than it acutually is. You set the internal column pointers to the correct positions using setprc(). @ LROW, 10 SAY UNDERLINEON+LHEADING1+UNDERLINEOFF SETPRC(LROW,10+LEN(LHEADING)) @ LROW, 25 SAY UNDERLINEON+LHEADING2+UNDERLINEOFF LROW = LROW + 1 This is a contrived example, but in complicated reports, setprc() does come in handy. SETPRCing the row value is handy if you send a form-feedish character to the printer that you want to let xBASE know about. Eric Pederson - CSULB ericp@beach.csulb.edu Brought to you by Super Global Mega Corp .com