Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open a text file
Message
From
12/12/2003 16:02:29
 
 
To
12/12/2003 15:28:25
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00858757
Message ID:
00858776
Views:
21
Another option is to use a text viewer from FFCs:
oForm=CREATEOBJECT("MyTextEditor",GETFILE(),"Watching this file",2)
oForm.SHow(1)

DEFINE CLASS myTextEditor as _showtext OF (HOME(1)+"ffc\_reports.vcx")

  PROCEDURE INIT
    LPARAMETERS tcSourceFile,; && Path of the file
                tcCaption,;    && Title of the Windo 
                tnWindowState  && Normal = 0, Minimized = 1 , Maximized =2
    DODEFAULT(tcSourceFile)
    WITH This
      .Caption = IIF(VARTYPE(tcCaption)='C' AND !EMPTY(tcCaption),tcCaption,"Text Viewer")
      .WindowState=IIF(VARTYPE(tnWindowState)='N' AND INLIST(tnWindowState,0,1,2),tnWindowState,0)
    ENDWITH  
  ENDPROC  
   PROCEDURE Activate
       This.Resize() 
       DODEFAULT()
   ENDPROC  
ENDDEFINE 
HTH
Hi,

>I would like to be able to open up a text file from a Visual FoxPro 7 form. I'm able to do so using this code:
LOCAL lcFile

lcFile = THIS.txtResults.Value

IF !EMPTY(lcFile) AND FILE(lcFile) AND UPPER(JUSTEXT(lcFile)) == "TXT"
  lcFile = "notepad " + lcFile
  RUN &lcFile
ENDIF 
>However, when the above code is run you get the text file opened in notepad but you can see a DOS window in the background until you close the file. Is there any way you can do this without showing the DOS window?
Apoya a Visual FoxPro usandolo legalmente
--
¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º¤ø,¸¸,ø¤º°`°º
Espartaco Palma Martínez
SysOp PortalFox
http://www.portalfox.com
esparta@portalfox.com
Previous
Reply
Map
View

Click here to load this message in the networking platform