Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Intellisense
Message
From
18/04/2002 10:29:06
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00646322
Message ID:
00646334
Views:
12
>If that isn't the case, I have a question about adding a custom script.
>
>I have a HEADER script I want to add. it adds Program name, company name, etc informat.
>
>How do I get one script to call onther intellisense item and get it's return value?


Here's the one I use (thanks to Doug Hennig and Toni Feltman for the original ideas on this one)
It is a custom entry
Type = "U"
Abbrev = "header"
Cmd = "{}"
lparameters toFoxCode
local lcReturn, ;
	lcTable
if toFoxCode.Location <> 0
	toFoxCode.ValueType = 'V'
	lcReturn = GetText()
endif toFoxCode.Location <> 0
return lcReturn

function GetText
local loRegistry, ;
	lcKey, ;
	lcCompany, ;
	lnResult, ;
	lcContact, ;
	lcAccount, ;
	lcEmail, ;
	lcText
loRegistry = newobject('Registry', home() + 'FFC\Registry.vcx')
lcKey      = iif('NT' $ os() or '5.0' $ os(), ;
	'Software\Microsoft\Windows NT\CurrentVersion', ;
	'Software\Microsoft\Windows\CurrentVersion')
lnResult   = loRegistry.GetRegKey('RegisteredOrganization', @lcCompany, ;
	lcKey, -2147483646)
if lnResult <> 0
	lcCompany = ''
endif lnResult <> 0
lnResult = loRegistry.GetRegKey('RegisteredOwner', @lcContact, lcKey, ;
	-2147483646)

if lnResult <> 0
	lcContact = ''
endif lnResult <> 0

* change lcContact to me in case registry says different on this machine
lcContact = "{developer name here}"

lcKey    = 'Software\Microsoft\Internet Account Manager'
lnResult = loRegistry.GetRegKey('Default Mail Account', @lcAccount, lcKey, ;
	-2147483647)
if not empty(lcAccount)
	lcKey    = lcKey + '\Accounts\' + lcAccount
	lnResult = loRegistry.GetRegKey('SMTP Email Address', @lcEmail, lcKey, ;
		-2147483647)
endif not empty(lcAccount)
if lnResult <> 0 or empty(lcEmail)
	lcEmail = ''
else
	lcEmail = ', mailto:' + lcEmail
endif lnResult <> 0 ...
text to lcText textmerge noshow
*==============================================================================
* Program:				<<wontop()>>
* Purpose:				~
* Author:				<<lcContact>><<lcEmail>>
* Copyright:			(c) <<year(date())>> <<lcCompany>>
* Last revision:		<<date()>>
* Parameters:			
* Returns:				
* Environment in:		
* Environment out:		
*==============================================================================

endtext
return lcText
More info also on the Fox Wiki: http://fox.wikis.com/wc.dll?Wiki~IntelliSenseCustomScripts~VFP


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform