PFPOSTPRINT question

Bob Stockler bob at trebor.iglou.com
Thu Jun 24 08:22:07 PDT 2004


On Thu, Jun 24, 2004 at 09:31:58AM -0400, Don Coleman wrote:

Your problem is caused by your trying to display the contents
of PFPOSTPRINT in the environment using MSGBOX.  It led you to
think you had to escape backslashes when you assigned a value
to it as you put it in your environment.  You want to escape
the backslashes only to display something in filePro - you do
NOT want them in what you assign to the environmental variable.

I have a subroutine (DXlate) I use to prepare strings I want
to display when they contain backslashes (it escapes any of
the backslashes in it).  

Here is a table I used to demonstrate how you can get what you
want into the environment, then check to see what you got:

    1  Then: end
@MENU    If:
    2  Then:
    3  Then: HY = "A"
    4  Then: putenv "PFPOSTPRINT","C:\PRINTWIZ\PRINTWIZ.EXE /PI-4308" { HY <
             "C:\PRINTWIZ\HARDCOPY.TXT"
    5  Then: HP(70,*)=getenv("PFPOSTPRINT")
    6  Then: Misc = HP ; gosub DXlate
    7  Then: msgbox "\r HP=" { Misc
    8  Then: exit
DXlate   If:
    9  Then: ' Escape backslash characters with a backslash for display
   10  Then: BackSlash = chr("92")
   11  Then: Misc1 = Misc { "" ; Misc = "" ; cnt = "1"
DXlate1  If:
   12  Then: Misc = Misc & mid(Misc1,cnt,"1")
         If: mid(Misc1,cnt,"1") eq BackSlash
   13  Then: Misc = Misc { BackSlash
         If: cnt lt len(Misc1)
   14  Then: cnt = cnt + "1" ; goto DXlate1
   15  Then: return
   16  Then: declare Misc ; declare Misc1 ; declare cnt(8,.0) ; declare
             BackSlash(1)

Bob (who also wouldn't assign a length/edit to the dummy variable HP)

PS - Please note how, using my PPRC program to document the
     table, it's so much easier to read that what you posted
     to illustrate your problem.  Even using the [S] option
     to the dcabe "Hardcopy?" prompt would be better.

PPS - Here is my table in filePro format so it can easily be
      cut and pasted into a table to test:

::end:
@MENU:::
::HY = "A":
::putenv "PFPOSTPRINT","C\PRINTWIZ\PRINTWIZ.EXE /PI-4308" { HY < "C\PRINTWIZ\HARDCOPY.TXT":
::HP(70,*)=getenv("PFPOSTPRINT"):
::Misc = HP ; gosub DXlate:
::msgbox "\r HP=" { Misc:
::exit:
DXlate::' Escape backslash characters with a backslash for display:
::BackSlash = chr("92"):
::Misc1 = Misc { "" ; Misc = "" ; cnt = "1":
DXlate1::Misc = Misc & mid(Misc1,cnt,"1"):
:mid(Misc1,cnt,"1") eq BackSlash:Misc = Misc { BackSlash:
:cnt lt len(Misc1):cnt = cnt + "1" ; goto DXlate1:
::return:
::declare Misc ; declare Misc1 ; declare cnt(8,.0) ; declare BackSlash(1):

-- 
Bob Stockler - bob at trebor.iglou.com
Author: MENU EDIT II - The BEST Creator/Editor/Manager for filePro User Menus.
Fully functional (time-limited) demos available by email request (specify OS).


More information about the Filepro-list mailing list