Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Intellisense and FileName
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00688622
Message ID:
00690504
Vues:
20
Here is what I came up with using Focus.


LPARAMETERS oFoxcode

LOCAL ;
cFileName AS CHARACTER, ;
cPrevSeperator AS CHARACTER, ;
cRetVal AS CHARACTER, ;
cWindowHandles AS CHARACTER, ;
cWindowTitle AS CHARACTER, ;
lWasFLLOpened AS BOOLEAN, ;
nBegin AS NUMBER, ;
nCounter AS NUMBER, ;
nEnd AS NUMBER, ;
nHandle AS NUMBER, ;
nTokens AS NUMBER, ;
nVFPWindowWHND AS NUMBER

oFoxCode.ValueType = 'V'

DO WHILE .T.
cFileName = ''
lWasFLLOpened = 'FOCUS' $ UPPER(SET('LIBRARY'))

IF !lWasFLLOpened
IF !FILE('Focus.fll')
MESSAGEBOX('Cannot Load Focus.fll')
EXIT
ENDIF

SET LIBRARY TO Focus ADDITIVE
ENDIF

nVFPWindowWHND = Win_WHandleToHWND(Win_Main())
IF !WIN_EnumChildren(nVFPWindowWHND)
EXIT
ENDIF

cWindowHandles = WIN_GetChildren()
cPrevSeperator = STR_SetSep( "^" )
nTokens = STR_NumTOk( cWindowHandles )

FOR nCounter = 1 TO nTokens
nHandle = STR_NToken(nCounter,cWindowHandles)
cWindowTitle = GetWindowTitle(VAL(nHandle))

IF !EMPTY(cWindowTitle) AND ;
'CLASS DESIGNER' $ UPPER(cWindowTitle)

nBegin = AT('-',cWindowTitle) + 2
nLength = AT('.vcx', cWindowTitle) - AT('-',cWindowTitle) + 2
cFileName = SUBSTR(cWindowTitle, nBegin, nLength )
cFileName = UPPER(JUSTSTEM(cFileName))
EXIT
ENDIF
NEXT
STR_setsep(cPrevSeperator)
EXIT
ENDDO

IF !lWasFLLOpened
RELEASE LIBRARY Focus
ENDIF

TEXT TO cRetVal TEXTMERGE NOSHOW
*---------------------------------------------------------------
*-- >.<>
*--
*-- Ron Darling
*--

*--
*-- N/A
*--

*--
*-- ~
*--

*---------------------------------------------------------------
ENDTEXT

RETURN cRetVal





>Did you try PROGRAM()?
>
>>I have the following Intellisense script. How do I discover the name of the file currently being edited. I tried oFoxCode.FileName but receive an empth string.
>>
>>I want to show SQLMIGRATOR.CCSTSQLMIGRATORLIB.DESTROY
>>
>>

>>
>>LPARAMETERS oFoxcode
>>LOCAL ;
>> cFileName, ;
>> cReturnDateStru
>>
>>oFoxCode.ValueType = 'V'
>>cFileName = GetVCXorPRGName()
>>
>>TEXT TO cReturnDateStru TEXTMERGE NOSHOW
>>*---------------------------------------------------------------
>>*-- >.<>
>>*--
>>*-- Ron Darling
>>*--

>>*--
>>*-- N/A
>>*--

>>*--
>>*-- ~
>>*--

>>*---------------------------------------------------------------
>>ENDTEXT
>>
>>RETURN cReturnDateStru
>>

What ben makes tracks for what wil be. Words in the air pirnt foot steps on the groun for us to put our feet in to.

Riddley Walker
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform