Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Attn MS:Reproducible C5 Error
Message
De
10/02/1999 14:45:03
Kenneth Downs
Secure Data Software, Inc.
New York, États-Unis
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de projet
Titre:
Attn MS:Reproducible C5 Error
Divers
Thread ID:
00186163
Message ID:
00186163
Vues:
58
If MS is listening:

I've got myself another reproducible C5 error. This time it involves accessing a project property.

In order to reproduce, load up VFP in a clean directory. Copy in a project, and build a simple table named PrjInfo with one field, "cAppName", with one record. The field "CAppName" gets the name of the project, no extension. IOW, project "Test.VCX" would go into PrjInfo.cAppName as "TEST".

Execute these commands from the command window:
loProject = .NULL.
? TestC5(@loProject)

The TestC5 code looks like this:

----BEGIN TESTC5.PRG FILE -------
LPARAM loProject
LOCAL woPrjInfo,lnSele0,llReturnValue,lcProjName

lnSele0 = SELE(0)

woPrjInfo = USED("prjInfo")
IF ! woPrjInfo
SELE 0
USE PrjInfo SHARE IN 0
ENDIF

lcProjName = ALLT(UPPER(cAppName))

IF ! woPrjInfo
USE IN prjInfo
ENDIF
SELE (lnSele0)

* Find out if project is already open
*
FOR each oProj in Application.Projects
IF oProj.Name = m.lcProjName
loProject = oProj
llReturnValue = .t.
EXIT FOR
ENDIF
ENDFOR

* If not open, open it NOSHOW, and get a pointer
IF ! llReturnValue
MODI PROJ (m.lcProjName) NOSHOW NOWAIT
FOR each oProj in Application.Projects
*
* C5 on the next line
*
IF oProj.name = m.lcProjName &&--C5 on this line
loProject = oProj
EXIT FOR
ENDIF
ENDFOR
ENDIF

RETURN llReturnValue
----------END TestC5.PRG File-----------

I will occassionally get, instead of C5, the VFP message "Property Not found." I presume it means it can't find oProj.name

I have eliminated it by both removing the conditional table open at the top and by replacing the two instances of:

IF oProj.Name = m.lcProjName

With

IF JustStem(UPPER(oProj.Name)) == m.lcProjName

Of course, it does not make sense to me that either of these would solve the problem, but it seems to work.

P.S. Sorry that the code is not very readable, I haven't figured out yet how to keep UT from converting my entire message into proportional font and removing all of my tabs and spaces.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform