There are some very powerful ways to get Thor IntellisenseX to work on your objects/classes when coding.
First, let me tell you this... The best place to get support for Thor questions is to join the Thor google group and post your question there.
https://groups.google.com/forum/#!forum/foxprothorNow, some direct guidance:
There are some plug-ing prgs that get called to help resolve your code reference into the underlying object that you are targeting.
For instance;
thor_proc_gettablefromobject.prg and
peme_opentable.prg Watch this video to learn more about these:
https://www.youtube.com/watch?v=UGyqlInAfvc&hd=1&rel=0There is also the Alias Dictionary table which can map object names to class names or table schemas. Learn more about it here:
https://groups.google.com/forum/#!topic/foxprothor/3D17opqq8JQEach of these plugins and table are used by Thor when it is trying to resolve your code/object reference. In these plugins/table, *you* can write code that helps IntellisenxeX work. In my use case, I use GetTableFromObject parse the object name I am coding with and I return the correct object to Thor and then Thor can perform Intellisense analysis on it.
For example, here is my code from my customized thor_proc_gettablefromobject.prg file:
lxResult = GetSQLStructure(lcEntityName)
If Vartype(lxResult) = 'O'
Return Execscript(_Screen.cThorDispatcher, 'Result=', lxResult)
Endif
#Define PROPERTYNAME 'cAlias'
#Define ccTab Chr[9]
loHost = toParameters.oTopOfForm
lnWordCount = GetWordCount(lcEntityName, '.')
lcLastWord = GetWordNum(lcEntityName, lnWordCount, '.')
If lnWordCount > 1
lcNextToLastWord = GetWordNum(lcEntityName, lnWordCount -1 , '.')
Else
lcNextToLastWord = ''
EndIf
Do Case
Case lcEntityName == 'this.odata' and Vartype(loHost) = 'O' and PemStatus(loHost, 'cFilename', 5) and !Empty(loHost.cFilename)
lcAlias = loHost.cFilename
Case lcEntityName == 'this.odata' and Vartype(loHost) = 'O'
lcAlias = GetTableFromBOKey(loHost.Class)
Case ('mainobject.odata' $ lcEntityName or toParameters.lForceIt) and ;
Vartype(loHost) = 'O' and ;
PemStatus(loHost, lcFormBusinessObjectRef, 5)
lcBusinessObjectClass = Alltrim(Lower(Eval('loHost.' + lcFormBusinessObjectRef)))
lcAlias = GetTableFromBOKey(lcBusinessObjectClass)
Case Lower(lcLastWord) = 'odata' and Left(Lower(lcNextToLastWord), 1) = 'o'
lcBusObjKey = Substr(lcNextToLastWord, 2)
lcAlias = GetTableFromBOKey(lcBusObjKey)
Case ('mainobject' $ lcEntityName or toParameters.lForceIt) and ;
Vartype(loHost) != 'O'
lcAlias = .null.
Case ('mainobject' $ lcEntityName or toParameters.lForceIt) and ;
Vartype(loHost) = 'O' and ;
PemStatus(loHost, lcFormBusinessObjectRef, 5)
lcBusinessObjectClass = Alltrim(Lower(Eval('loHost.' + lcFormBusinessObjectRef)))
lcAlias = CreateObjectFromBOKey(lcBusinessObjectClass)
Case 'o' = Left(Lower(lcLastWord), 1) and Lower(lcLastWord) != 'odata'
lcBusObjKey = Substr(lcLastWord, 2)
lcAlias = CreateObjectFromBOKey(lcBusObjKey)
Case 'lo' = Left(Lower(lcEntityName),2) and !('.' $ lcEntityName)
lcObjectRef = GetWordNum(lcEntityName, 1, '.')
If Lower(Left(lcObjectRef, 2)) = 'lo'
lcBusObjKey = Substr(lcObjectRef, 3)
lcAlias = CreateObjectFromBOKey(lcBusObjKey)
Endif
Case '.odata' $ Lower(lcEntityName)
lcObjectRef = GetWordNum(lcEntityName, 1, '.')
If Lower(Left(lcObjectRef, 2)) = 'lo'
lcBusObjKey = Substr(lcObjectRef, 3)
lcAlias = GetTableFromBOKey(lcBusObjKey)
EndIf
If Empty(lcAlias)
lcAlias = lcBusObjKey
EndIf
Case Left(lcLastWord, 1) == 'o'
lcBOKey = Substr(lcLastWord, 2)
lcAlias = CreateObjectFromBOKey(lcBOKey)
Case llForceit
lcAlias = GetTableAlias(loForm, PROPERTYNAME, .T.)
Otherwise
lcAlias = .F.
Endcase
Return Execscript(_Screen.cThorDispatcher, 'Result=', lcAlias)
Procedure GetTableAlias(loForm, tcPropertyName, tlCurrentAlias)
Local lcAlias
If Pemstatus(loForm, tcPropertyName, 5) And Vartype(loForm.&tcPropertyName) = 'C'
lcAlias = loForm.&tcPropertyName
If Empty(lcAlias) And Lower(loForm.Name) = 'bo_'
lcAlias = OpenMyTable(Substr(loForm.Name, 4))
Endif
lcAlias = OpenMyTable(lcAlias)
Else
lcAlias = .F.
Endif
If Empty(lcAlias) And tlCurrentAlias And Not Empty(Alias())
lcAlias = Alias()
Endif
Return lcAlias
Endproc
Procedure OpenMyTable(tcAlias)
If Empty(tcAlias) Or '.' $ tcAlias
Return ''
Else
Return Execscript(_Screen.cThorDispatcher, 'PEME_OpenTable', tcAlias)
Endif
Endproc
Procedure GetSQLStructure(lcEntityName)
#Define DictionaryTableName 'C:\VISUAL FOXPRO\DATA\KONG\DATADICTIONARY.DBF'
#Define Table_FieldName Xtabname
#Define Field_FieldName field_name
#Define Type_FieldName Field_Type
#Define Length_FieldName Field_Len
#Define Decimals_FieldName Field_Dec
Local lxResult As 'Collection'
Local laFields[1], laList[1], lcTableName, lnSelect
lxResult = .F.
If '.' $ lcEntityName
Return lxResult
EndIf
If Upper(lcEntityName) = 'SQL_'
lcTableName = Substr(lcEntityName, 5)
Else
lcTableName = lcEntityName
Endif
If File(DictionaryTableName)
lnSelect = Select()
Use(DictionaryTableName) Alias DataDictSource In 0
Select Lower(Field_FieldName) As field_name, ;
Type_FieldName As Field_Type, ;
Length_FieldName As Field_Len, ;
Decimals_FieldName As Field_Dec ;
From DataDictSource ;
Where Lower(Table_FieldName) = Lower(lcTableName) ;
Into Array laFields
If _Tally > 0
Dimension laList[1]
Execscript(_Screen.cThorDispatcher, 'THOR_PROC_GetFieldNames', @laFields, @laList, 3)
lxResult = Createobject('Empty')
AddProperty(lxResult, 'aList[1]')
Acopy(laList, lxResult.aList)
Endif
Use In DataDictSource
Select(lnSelect)
Endif
Return lxResult
Endproc
>I know I'm late in the game of looking into Thor, but looking into the youtube videos I see that it can be very useful for me.
>
>However, two of my most important problems don't seem to get solved. Please tell me I'm wrong on this.
>
>You cannot easily use intellisenseX on public objects. For example I've got several public objects
>Applic: The global Applic object which can be referred to in any piece of code.
>oPS: Personal Settings
>oDatacache: Responsible for caching remote data
>oDF, Datafunctions, Applic specifig function to create lookups
>etc...
>
>They not specifically declared other than in the places where they are created, but I really like to use intellisense on them anywhere in my project.
>Is there a way to do this?
>
>
>The other question is whether it is possible to easily save all thor tools and settings to be applied to another development machine. Personally I've got 2 desktops and 2 laptops which I use to code and I really hate to install and configure things on all 4 machines. Is there a way of doing that?