Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Command Button stops working - only on development machi
Message
 
À
10/01/2000 11:46:47
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00315521
Message ID:
00315617
Vues:
41
Below is the code for the two cmdbtns in question.....
****file selector click
LOCAL l_cLocation,l_cfolder

DO CASE
CASE THIS.PARENT.cboProcType.VALUE="RAW MATERIAL"
	l_cfolder="\LEVEL3\RMC"
CASE THIS.PARENT.cboProcType.VALUE="CHEM LAB"
	l_cfolder="\LEVEL3\CHEMLAB"
CASE THIS.PARENT.cboProcType.VALUE="FORM"
	l_cfolder="\LEVEL3\FORMS"
CASE THIS.PARENT.cboProcType.VALUE="METAL NUMBER"
	l_cfolder="\LEVEL3\METALNOS"
CASE THIS.PARENT.cboProcType.VALUE="PRODUCT DATA"
	l_cfolder="\LEVEL3\PDS"
CASE THIS.PARENT.cboProcType.VALUE="MSDS"
	l_cfolder="\LEVEL3\MSDS"
CASE THIS.PARENT.cboProcType.VALUE="PRODUCT TESTING"
	l_cfolder="\LEVEL3\PTP"
OTHERWISE
	l_cfolder=""
ENDCASE

SET DEFAULT TO D_SERVER+D_APPDIR+"isodocs"+l_cfolder

l_cLocation=GETFILE("Envoy documents:evy;Acrobat documents:pdf","File Name:", "Select",0,"Locate the document")

IF !EMPTY(l_cLocation)
	THISFORM.pgfDocs.PAGE1.txtFname.VALUE=l_cLocation
ENDIF
SET DEFAULT TO
RETURN
and....
***View Document Click
LOCAL l_csubname, l_ccheck1

****FOR DOCUMENTS WITH AN EMPTY LINK FIELD
IF EMPTY(DOCUMENT.fname) AND (DOCUMENT.STATUS <> "OBSOLETE" AND DOCUMENT.STATUS <>"WRITING")
	MESSAGEBOX("No document link has been defined."+CHR(13)+"Contact Quality Assurance.",d_nOKbutton+d_nexclamation,"No Link")
	RETURN
ENDIF
****FOR OBSOLETE DOCUMENTS
IF EMPTY(DOCUMENT.fname) AND DOCUMENT.STATUS = "OBSOLETE"
	MESSAGEBOX("This is an obsolete document."+CHR(13)+"Contact Quality Assurance.",d_nOKbutton+d_nexclamation,"Obsolete Document")
	RETURN
ENDIF
****FOR DOCUEMENTS UNDER CONSTRUCTION
IF EMPTY(DOCUMENT.fname) AND DOCUMENT.STATUS = "WRITING"
	MESSAGEBOX("This document is being written."+CHR(13)+"Contact Quality Assurance.",d_nOKbutton+d_nexclamation,"Document Under Construction")
	RETURN
ENDIF

****VIEW THE DOCUMENTS
l_csubname=ALLTRIM(THISFORM.pgfDocs.PAGE1.txtFname.VALUE)
l_ccheck1=UPPER(JUSTEXT(l_csubname))

DO CASE
	****IF IT IS AN ENVOY FILENAME
CASE l_ccheck1='EVY'
	***Check for Envoy in three locations

	DO CASE
		***32 BIT IN NEW COREL DIRECTORY, view the document
	CASE FILE('C:\COREL\OFFICE7\ENVOY7\ENVOY7.EXE')
		RUN /N1 C:\corel\office7\envoy7\envoy7.EXE "&l_csubname"
		RETURN
	CASE FILE('D:\COREL\OFFICE7\ENVOY7\ENVOY7.EXE')
		RUN /N1 D:\corel\office7\envoy7\envoy7.EXE "&l_csubname"
		RETURN
		***16 bit Envoy Viewer, view the file
	CASE FILE('C:\OFFICE\ENVOY\ENVOY7S.EXE')
		RUN /N1 C:\office\envoy\envoy7s.EXE "&l_csubname"
		RETURN
		***32 BIT IN OLD OFFICE DIRECTORY, view the file
	CASE FILE('C:\OFFICE\ENVOY\ENVOY7.EXE')
		RUN /N1 C:\office\envoy\envoy7.EXE "&l_csubname"
		RETURN

		***If Envoy doesn't exist on the drive
	OTHERWISE
		MESSAGEBOX("You need to install the Envoy viewer."+CHR(13)+"Contact Quality Assurance.",d_nOKbutton+d_nexclamation,"Envoy Not Installed")
	ENDCASE

	****if it is an Acrobat filename
CASE l_ccheck1='PDF'

	DO CASE
		******16 bit Acrobat viewer, view the file
	CASE FILE('c:\acrobat3\reader\acrord16.exe')
		RUN /N1 C:\acrobat3\READER\acrord16.EXE "&l_csubname"
		RETURN
	CASE FILE('C:\Acrobat3\Exchange\AcroEx32.exe')
		RUN /N1 "C:\Acrobat3\Exchange\AcroEx32.exe" "&l_csubname"
		RETURN
		******32 bit Acrobat viewer, view the file
	CASE FILE('c:\acrobat3\reader\acrord32.exe')
		RUN /N1 C:\acrobat3\READER\acrord32.EXE "&l_csubname"
		RETURN
		***If Acrobat doesn't exist on the drive
	OTHERWISE
		MESSAGEBOX("You need to install the Acrobat viewer."+CHR(13)+"Contact Quality Assurance.",d_nOKbutton+d_nexclamation,"Acrobat Not Installed")
		RETURN
	ENDCASE

	****if the filename is not an Envoy/Acrobat extension
OTHERWISE
	MESSAGEBOX("Not an Envoy/Acrobat link!.",d_nOKbutton+d_nexclamation,"Error")
ENDCASE
RETURN
>>I have a form with a command button that uses GETFILE() to allow the user to select the filename of a document. There is a second command button that is used to view the file (with either Envoy or Acrobat, depending the file extension.)
>>
>>On my development machine, the following steps cause the file locator button to do NOTHING:
>>
>>1. Use the file selector button to select the filename and store it to the textbox.
>>2. Use the view document button to launch the appropriate program (via RUN).
>>3. Attempt to use the file selector button again.
>>
>>If I stay off of the view document button, I can repeatedly use file locator with no problem.
>>
>>When I say that the file selector button does nothing, it depresses, but no actions take place. I can quit the application and wind up back in VFP but then I can no longer DO anything or BUILD APP.....
>>
>>The strange thing is - the buttons all work just fine on the other machines that do not have VFP installed when the exe is run.
>>
>>Help??
>>
>>TIA,
>
>Hi Phil,
>
>A couple of thoughts:
>
>1) Others may know the answer to this off the top of their heads, but I think you may need to post the code running for analysis.
>
>2) You may want to use Ed Rauh's API_APPRUN class to launch and control the external applications. I haven't had need at this point to use it, but I'm sure it will give you more control over the applications and might be able to clue you in as to what is (not) happening.
>
>Bill
Phil Thomas
http://phillipdthomas.com

Never let your energy or enthusiasm be dampened by the discouragements that must inevitably come.....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform