What is FTShell 
    Also FTShell2 version 6.7

last updated 12/12/2011

Back to the Main Developer page

FTShell2.DLL is a program file that is part of FastTrack's offerings. It is an ActiveX program  that provides computer program  a way to read to the FastTrack database, financial functions, and families interface. Your Windows computer MUST have a working, up-to-date copy of FT4Web and it's databases. It is NOT sufficient to copy databases from another computer.

FTShell2 replaces and combines the interfaces previously offered by FastTrack.DLL, FTDllShell.DLL, FTindica.DLL,  and FTFamRed.DLL.  Thus, FTShell2  provides dividend-adjusted prices, AccuTrack, moving averages, Ulcer Index, and other statistical functions, as well as access to FastTrack families (lists of growth funds, technology stocks, Vanguard funds, etc.) to your computer programs.

FTShell2 version 6.6 is the latest version. It supersedes and replaces FTShell 6.5. However, it is not binary compatible with 6.5, therefore, both versions are still supplied for backward compatibility. FTShell2 is not dependent on a library known as Stamin32.DLL. This dependency has caused problems with Windows Vista and 7 operating systems especially the 64-bit versions. All documentation using the term, "FTShell", applies equally to the newer FTShell2. As of 3/2011 there is no difference in functionality of FTShell and FTShell2. However, This may change in the future. New development should be based on FTShell2.

FTShell requires programming skills. However, even if you are not a programmer, do not delete the files: FTShell.dll,  FTShell2  because they are used by various FastTrack and 3rd Party programs. The programs depend on FTShell being maintained by FastTrack.

While the older interfaces (fasttrack.dll,  ftshell.dll, FTFamred.dll) continue to be available with limited support. We no longer suggest that programmers use these directly. Much thought has been put into the FTShell2 "second-generation" interface to make the programmer's task easier. Specific enhancements include:

  • ActiveX functionality. Microsoft compilers will be able to access FTShell2 functions using Microsoft's Intellisense features.
  • FTShell2 is a Windows registered program. Therefore, you can access FTShell2 from any program running in any folder.
  • FTShell2 passes and returns Variants (objects in .NET). This makes the interface more uniform and easier to deal with when using VBScript, JavaScript, VB.NET. ASP, PowerBasic, C++.
  • Date and Market day functions have been incorporated. These will allow you to easily transform dates to market days, Julian dates, international dates,  and to recognizable written dates.
  • FastTrack families may be listed, read, and written by FTShell2.

Steps in using FTShell on your 32-bit Windows computer.

  1. Be sure that you can use FT4Web and see charts. FTShell2 won't work if FastTrack is not properly installed and updated.
  2. Ensure that fasttrack.dll and ftindica.dll are present in your C:\windows\System32\ folder.
  3. Run the program file:///c:/ft/FT4WIN/FTDEVELOPER/FTSHELL/VB 6 Example/FTShellTest.exe. This should produce a window full of numbers and comments as all FTShell features are exercised.

Steps in using FTShell on your 64-bit Windows computer.

  1. Be sure that you can use FT4Web and see charts. FTShell2 won't work if FastTrack is not properly installed and updated.
  2. Ensure that fasttrack.dll and ftindica.dll are present in your C:\windows\SysWOW64\ folder.
  3. Run the program file:///c:/ft/FT4WIN/FTDEVELOPER/FTSHELL/VB 6 Example/FTShellTest.exe. This should produce a window full of numbers and comments as all FTShell features are exercised.

Reference for FTShell.DLL ActiveX Interface:

All arguments are passed as ActiveX variants. In .Net development environments use the type Object to receive and pass arguments.VB 5 and 6 aren't pickly about variable types and will, generally, automatically convert (coerce) variable types. However, C++ and C# are less tolerant.

Data arrays are all 0 based. That is, they all must have a zeroth element. However, the 0th element is just a duplicate of element #1. A typical VB statement allocating space for an array of prices would use,

Dim FT as new FTShell.clsFTShell  'reference to FTShell
Dim Prices() as Single            '32-bit floating point
Redim Prices(0 to ft.MaxNumDays)  'In .NET the 0 lower bound is always implicit and unnecessary

Dates and Date Functions

  • FT databases Dates begin at calendar date 9/1/1988. This is MarketDay #1 and Julian date 32387. Julian dates are computed using Microsoft's standard. That is, Julian dates are sequential numbers starting at December 31, 1899 (Julian date=1).
  • Market Days are a sequential count of days in the database. Generally there are 21 or 22 Market Days in a month. Only US NYSE stock market days are counted. The FT database does not contain data for markets that are open on NYSE holidays.
  • Date functions are not picky about the way you specify a particular day. In the desciptive sections below the vDay variant variable may be any form of calendar date (according to your Windows Regional settings), or may be a Julian date, or Market Day. vDay may contain string, number, date, or other value that is legal to pass to Microsoft CDate function can convert to a date. This offers tremendous flexibility. See http://msdn.microsoft.com/en-us/library/az4se3k1.aspx for an extensive discussion or an alternate link
  • Earlier versions of FTShell required a different date function for each type of day. However, this has been generalized, thus the functionality overlaps. For example,
     
    • Date2Julian(5127),
    • Date2Julian("12/31/2008")
    • Date2Julian(39813)

    All return =  39813 
     

  • If vDay cannot be resolved to a day. FTShell will substitute the date of 09/01/1988.
  •  vDay dates that are before 09/01/1988 are interpreted as  09/01/1988.
  • vDay dates that are after the end of the most recently updated FT database are interpreted as the most recent Julian date for which data exists.

Dividend-Adjusted Data

FTShell2 (and all prior api's) provides dividend-adjusted data. This topic is amply covered in FastTrack help documentation. 

Programmers: Specially note that dividend-adjustment causes historical data to change. If you stuff FT data into another form of database, then you will be sorry. Your charted data will appear to have big stair-steps when dividends are paid. Resd the data directly from the FT database through FTShell2 whenever your application requires data. FTShell is fast and small . . . far faster and smaller than SQL and other database formats.

Call Type      Name and parameters
Property ArrayBase(ABase as variant) as Variant
This is an obsolete parameter. 
Calling or setting this Property has no effect on the program. It has been retained for compatibility purposes with earlier versions.
Function Date2Julian(ByVal vDay as variant )  as Variant

Returns Julian Dates

For most users these are the major date types which can be passed. Click for more detail :

  • Strings: 7/4/01, 07/04/2001, 04-Jul-01, "July 4, 1999". Invalid strings return the Julian Date 32387 (09/01/1988)
  • Date Type variables containing any date. Dates prior to the start of the FastTrack Database will return the Julian date 32387. Dates after the last date of the database return the last Julian date in the database. .
  • Numeric values >=32387are interpreted as Julian dates. Values which exceed the last Julian Date in the database return the last Julian date is returned.
  • Numeric Values which are within the Julian Date range of the FastTrack Database', but which are NOT market days, are returned as the last prior Julian Date.
  • Numeric values in the range of the 1 to the last market day are interpreted as FastTrack market days and are converted to the appropriate Julian date. 
  • Numeric values not handled above return 32387 (the Julian date of 09/01/1988).

There are no error returns. All string and numeric values are handled according to the above rules.

Function Date2Str(vDay as variant, optional vFMT as variant) as Variant
Date to string: Converts valid date format to a string. The string is formatted, again using Microsoft rules, using the string in FMT$. Click for details. For most users these following formats should be sufficient:
  • MM/DD/YY = 07/04/1996  <---Default vFMT value used if you do not pass a vFMT parameter then 
  • M/D/YY= 7/4/96
  • DD-MMM-YY =  04-Jul-96
  • ##### = 3250 (the Julian  date as a string)
Function Date2MarketDay (vDay as Variant) as Variant
Converts any date format to a FastTrack Market Day.  

For example, the period 09/01/1988 - 08/31/1989 comprises 364 calendar days, or 252 FastTrack Market days numbered 1 - 252 . . . only US NYSE market days are counted. Data originating in other markets is not contained in the database.

As a reference;

Market Day       1  =  09/01/1998
Market Day  5027 = 08/08/2008

If DT is does not fall on a Market Day (for example a Saturday), then then last prior market date is returned (typically for the prior Friday unless that too was a holiday)
Function DateMath( interval As String, number As Double, vDay As Variant) as Variant
Performs mathematics on a date. returns the result as a string in the form MM/DD/YYYY.
'The DateAdd function syntax has these named arguments:

 
interval  String expression that is the interval of time you want to add. >
yyyy Year
q Quarter
m Month
d Day

Note: Intervals y and w exist, but are identical to d in function.

ww Week
h Hour
s  Seconds
number Numeric expression that is the number of intervals you want to add. It can be positive (to get  dates in the future) or negative (to get dates in the past).
date  Variant (Date) or literal representing date to which the interval is added.

 

You can use the Date Math function to add or subtract a specified time interval from a date.
Example, you can use Date Math to calculate a date one month from days from 01/31/2005

Date Math("m", 1, "31-Jan-95")

Above, Date Math returns 28-Feb-95, not 31-Feb-95.

If starting date  is 31-Jan-96, the same statement above returns 29-Feb-96 because 1996 is a leap year. If the calculated date would precede the year 100 (that is, you subtract more years than are in date), an error occurs. If number isn't an integer, it is rounded to the nearest whole number before being evaluated.

Note: To add days to date, you can use either "d", "y", or "w". Be advised that the term "weekday" ("w") has nothing to do with skipping weekend days; i.e., it is NOT equivalent to "business days". Applications that would require skipping weekend days (like Saturday and/or Sunday) would have to be custom coded.

Function DivAdjPrices(ByVal symbol As String, optional  StrFlag as Boolean =False, optional Reserved as string)  as Variant

Returns all dividend-adjusted prices as a variant containing

  1. an array of Single number (32-bit floating point) for the ticker Symbol. The array is sized from1 through the most recent market day. All prices preceding the inception date of the Symbol's data are returned as the same value as the inception day's price.
  2. or, a string of data. See below

Examples of usage

Power Basic should include this statement in code.

dim PA as variant, P!(0 to 1)
Object call FT.DivAdjPrices(varSym) to PA
Let P!()= PA    'P!() array will be resized as needed in he LET

The Microsoft Visual Basic code looks like this
 Dim P!( )
 P! = FT.DivadjustedPrices(varSym)   

String of Data

If StrFlag is true (=-1) then, the variant returned is a string separated by pipe | characters. There are up to seven significant digits in each number. The first element is the string is the count of subsequent pipe | separated prices.

Function FamDelete(ByVal Family$)  as Variant

Deletes family files within the FTPath\USERDEF\ folder. Will not delete any families in other folders. FamDelete will delete write-protected files. Files are NOT moved to the trash can. Delete them and they are gone.

Function Family(ByVal FamName As String) as Variant
  • Reads an existing family. returns
  • A three part string each part separated by a Pipe character |

String parts:

  1. Family Description text/
  2. A count of number of family members in text
  3. The ticker symbols for each family member.

If the returned string is empty, then the family was not found. Check the family name carefully. The name must be a valid Windows file name. Names can be verified with the NameValid function.

Function Families(ByVal FamType As String) as Variant

Returns a two part string separated by | pipe characters. The families will be of the type specified by the FamType string

  • a count of families returned in text
  • family names separated by a | pipe character |

If the returned string is empty, then no matching families were found. Check the family type carefully.

FamType:

Families are physical disk files within physical disk folders. Family folders must be contained in the FTPath   folder. The name of the folder is the FamType. Standard predefined FamTypes are

  1. USERDEF - User defined families. This folder is directly in the FTPath
  2. FTDEF - Fund FastTrack Defined Families. This folder is directly in the FTPath.
  3. SFTDEF - Stock FastTrack Defined Families. This folder is within FTPath\FT4WIN\

Other folders containing families may be within FTPath  However, this is an extension of the historical standard operating usage of families and these folders may not be used by legacy applications that do not use FastTrack's DLL's for family access. any folder located anywhere within FTPath will be searched for .FAM files. files which are found to be invalid will not be listed. However, the test is not rigorous. Therefore. it is possible to read a family full of trash. 

Error Returns:
102:Families Error: No families matching Family Type=

Function FamNameValid(Nam$)  as Variant
Returns signed integers:
-1 =  when the  name is a valid file name AND there is no FastTrack-Defined Family of the same name.
 0 =   when the name is not a valid file name OR there is a FastTrack Defined Family of the same name.
Background: FastTrack maintains predefined families. This DLL will not delete or modify the FT predefined families. The user must pick valid names for the families he creates. Valid names must also follow Windows file name conventions, and cannot be the same as FastTrack-defined family names.

This routine DOES NOT verify the existence of a family. If a user-defined family of the same name exists, then the Name  considered valid.

Function FamWrite(ByVal Fam$) as Variant

Writes a four part formatted string to a FTDIR\USERDEF\. The parts are separated by pipe | characters

  1. Family name. Should be validated with NameValid before using
  2. Family Description text/
  3. A count of number of family members in text
  4. The ticker symbols for each family member separated by pipe | characters .

Note: FTDir is a FTShell functions specifying the path to the installation of FT4Web's databases

Error Returns:
Case  0: Success
Case  1: Existing User-defined family overwritten. A success message, if that is what you intended.
case  2: Existing Family overwritten, however, some family members were not in the FT Database and have been removed from the family.br> Case -1: Family name is an invalid filename, use the NameValid function before writing.
Case -4: Family already exists in other folders. Nothing written.
Case -5: Number of members must the greater than 0. No Family written. Check the 3rd
 part of the string passed.

VB 6 Example:

Assuming that you have built a string array of ticker symbols in the variant v, the code to make a family is as follows: 

NX& = ft.FamWrite ("MyStocks|Stocks|" & CStr(UBound(V)) & "|" & Join$(v, "|")

PropertyFTAccount as variant

Returns the FastTrack account number licensed to the current user. this property is read only

PropertyFTDBOpen as Variant
Returns the status of the initial database open. Because the open occurs at class initialization, there can be no error return.  FTDBOpen=0 means the open was successful. This property is read only. 
PropertyFTDir as Variant
Returns the installation folder for FastTrack. When FTShell initializes, it locates the FastTrack folder, and saves the root of the FastTrack installation. This is usually C:\FT\
FunctionHeadTail(ByVal Source As String, Optional ByRef Tail as string, ByVal N as Long )  as Variant

Each time this functions is called the Text string is parsed for a pipe character | Tab Character, or comma character  (separators). If no separator exists then the function returns the source. 

The function returns the head (Source characters preceding the separator ). Tail becomes the remaining Source. If the source is empty, then the function returns a null string.  Returned strings are stripped of leading/trailing blanks.

When N is >1 then, the head precedes the Nth separator. Tail returns then string after the Nth Separator. 

Use HeadTail to separate out elements of the separator delimited string returned by various calls. This makes for easy usage with scripts that are not capable of dealing with arrays.

Programming hint:

Do 'retrieve successive fields from a delimited string
   Head$=HeadTail( Source$, Source$ ) 
Loop until Source$="" 'Source$ becomes smaller with each HeadTail call

FunctionisIssue(ByVal symbol As String)  as Variant

Returns true when

  1. The issue is in one of the FT Databases
  2. The issue is an FNU file
  3. The issue is a rate of return (symbol ending in %)
PropertyLastErrNum() as Variant
The last Call error number. Read Only. A Zero return indicates no error. Other error numbers are clarified by the LastErrText
Note: There is no problem using a single FTShell instance shared by multiple programs.  However, the LastErrNum is a global value and will return its value regardless of whose error it was. For example, when FTShell is used at the web server Windows IIS Application level.
PropertyLastErrText (Optional ErrorNumber as Variant) as Variant
The last call's error text. Read Only
Note: There is no problem using a single FTShell instance shared by multiple programs. However, you should not pass the function return LastErrNum as the ErrorNumber argument. Use the error return of each discrete function. When no ErrorNumber is provided, then the default is LastErrText (LastErrNum). This works fine for single threaded applications.
FunctionMarketDay2Date(ByVal vDay As Long) as Variant
Converts a any VDay to a Microsoft date variable type. 
FunctionMarketDay2Julian(ByVal vDay  As Variant) as Variant
Converts a FastTrack Market Day to its Julian date.
FunctionMaxNumDays as Variant
The number of market days in the most recently updated database. Not all databases must have the same date.
FunctionRelIndex(ByVal sym As String) as Variant
Returns the symbol of a market index or index mutual fund. This is the index which is most closely highly correlated to the Sym (correlation of day to day price change).

Since there are only about 100 relevant indexes, this mechanism enables you to group tickers by similarity. Simplistically, a diversified portfolio would not hold multiple issues whose RelIndex is the same.
FunctionShell_Close()
Performs and orderly shutdown of FTShell.  Generally, not calling close will cause no problems. However, in a programming environment where the DLL is instantiated again and again, memory leaks may develop which can be avoided by doing the Shell_Close.
Subsequent calls made to the FTShell object will generate errors. Your program should destroy the FTShell object (set it to nothing) immediately after Close.

NEVER CALL SHELL_CLOSE FROM A WEB APPLICATION. When multiple users are using the FTShell via IIS, this call would only be made in the Global.ASA website shut down event handler.

VB 6 Example:

Dim FT As New FTShell.clsFTshell 'create the object
FT.Shell_Close                   'shut down the object

FunctionStartMarketDay (ByVal symbol As String) as Variant
The starting FastTrack Market Day for the symbol's data in the FastTrack Database. This is the day before the first change in price in the data series. This often differse from the official inception date.
FunctionStartMarketDay (ByVal symbol As String) as Variant
The starting FastTrack Market Day for the symbol's data in the FastTrack Database. This is the day before the first change in price in the data series. This often differse from the official inception date.
FunctionUpdateStatus(ByRef Status as string)  as Variant (FTShell2 only)

Use this call to determine if the databases are all updated to the same date.

Returns True (-1) if all FT Databases are up to date for the same date.
Status is a string containing pipe delimited FT database path | Last Date for each database.
 
If the return is false, the solutions are to (1) do another FTComm update to resolve the problem, or to (2) delete the databases to which you do not subscribe.

 

Mathematical Functions

FunctionAccuTrack(ByVal vDay as variant, ByVal ShortParam as Single, ByVal LongParam as Single, ByRef RedvPrices As Variant, ByRef GreenvPrices As Variant) As Variant

Returns a variant array of Singles that contains the same AccuTrack values that FT4Web displays. All the values are are computed from vDay (Inception Date) of the red line to the last day of data. The AT values prior to the Inception Date  backfilled with the AT value on the inception date. The inception date governs what the AT value will be. To match FT4Web you must pass then inception date of the red line.

You must pre-read the price data using DivAdjustedPrices into a variant, and pass that variant in this call. The references to Red and Green refer to lines within FT4Web.

There is an example of use in C:\FT\FT4WIN\ftdeveloper\FTShell\Excel\

Function AnnReturn(ByRef vPrices As Variant, ByVal StartDate As Variant, ByVal EndDate As Variant) As Variant

Returns floating point Single as a variant that contains the same Ann= annualized return that FT4Web displays for the period.

  1. You provide a floating-point single array of  prices as the variant vPrices(usually read with DivAdjPrices) .
  2. StartDate and EndDate follow vDay rules.
FunctionCorrelation(ByRef vPrices As Variant, ByRef vBasis As Variant, CorLength As Variant, ByVal StartDate As Variant, ByVal EndDate As Variant) As Variant

Returns a variant containing a single floating point value which is the Correlation of the returns of the vPrice price series compared to the vBasis series. This value should match the Cor= value in FT4Web for the period. Correlation measure the degree to which two different price series exhibit similar movement ( change per day).

  1. Load a floating-point single array of  prices (usually with DivAdjPrices) into the variant, vPrices.
  2. Load a floating-point single array of  prices (usually with DivAdjPrices) into the variant, vBasis
  3. Correlation length makes relatively little difference.  The longer the length, generally, the slightly higher the correlation. common values are in the range of 1-5.
  4. StartDate and EndDate follow vDay rules.
FunctionMovingAvg(ByRef vPrices As Variant, SmoothDays As Variant, ByVal StartDate As Variant, ByVal EndDate As Variant) As Variant

Returns a variant containing a floating-point single array of  prices that are the exponential moving average of dividend adjusted prices. Exponential moving averages are usually favored over simple averages for use in stock market analysis.

  1. Load a floating-point single array of  prices (usually with DivAdjPrices) into the variant, vPrices.
  2. SmoothDays must contain a numeric value for the  number of days to be averaged. 50 is a common value. However, the value may contain fractional values, for example 7.5 days. 
  3. StartDate and EndDate follow vDay rules.
FunctionRSI(ByRef vPrices As Variant, NDays As Variant, ByVal StartDate As Variant, ByVal EndDate As Variant) As Variant

Returns a variant containing a floating-point Single array of  RSI values. These should be identical to the RSI values produced by FT4Web.

  1. vPrices is a floating-point single array of  prices (usually with DivAdjPrices) passed as the variant.
  2. NDays must contain a numeric value for the  number of days to be averaged. 14 is a common value.
  3. StartDate and EndDate follow vDay rules.
FunctionSD(ByRef vPrices As Variant, ByVal StartDate As Variant, ByVal EndDate As Variant) As Variant

Returns a variant containing a single floating point value which is the Standard Deviation of the returns of the vPrices dividend-adjusted price series. This value should match the value in FT4Web for the period. SD measures the volatility of returns,

  1. Load a floating-point single array of  prices (usually with DivAdjPrices) into the variant, vPrices.
  2. StartDate and EndDate follow vDay rules.

There is an example of use in C:\FT\FT4WIN\ftdeveloper\FTShell\Excel\

FunctionSimpleMovingAvg(ByRef vPrices As Variant, Byval NDays As Variant, ByVal StartDate As Variant, ByVal EndDate As Variant) As Variant

Returns a variant containing a floating-point single array of  prices that are the simple moving average of dividend adjusted prices. Exponential (see above) moving averages are usually favored for use in stock market analysis.

  1. Load a floating-point single array of  prices (usually with DivAdjPrices) into the variant, vPrices.
  2. NDays must contain a numeric value for the  number of days to be averaged. 50 is a common value.
  3. StartDate and EndDate follow vDay rules.
FunctionUlcerIndex(ByRef vPrices As Variant, ByVal StartDate As Variant, ByVal EndDate As Variant) As Variant

Returns the Ulcer Index. Should provide the same value for the period as shown in the FT4Web spreadsheet. The Ulcer Index is a good statistic for comparing the risk of diversified assets.

  1. Load a  floating-point single array of  prices (usually with DivAdjPrices) into a variant .
  2. StartDate and EndDate follow vDay rules.
Function

UPIndex ( ByRef vPrices As Variant, ByRef vBasis As Variant, ByVal StartDate As Variant, ByVal EndDate As Variant) As Variant

Returns the floating point Single Ulcer performance Index as a variant. Should provide the same value for the period as shown in the FT4Web spreadsheet. Ulcer Performance Index provides a good statistic for comparing the risk and return of diversified assets.

  1. Pass a floating-point single array of  prices (usually read with DivAdjPrices) into the variant, vPrices.
  2. Pass a floating-point single array of  prices (usually read with DivAdjPrices) into the variant, vBasis.
  3. StartDate and EndDate follow vDay rules.
Function

Yield1Y ( ByRef Symbol as string, ByVal vEnddate as variant) As Variant (FTShell2 only)

Returns the Yield1Y value (a percentage) for the calendar year period before the vEndDate. vEndate follows vDay rules. FT4Web 3.6 computes back 252 days from vEndDate. This may cause a difference between the two values (and it may be a large difference). FTShell2 will be the correct value in this case.

 

Brief Programmers Guide to using FTShell

There is a program on your computer in C:\FT\FT4WIN\ftdeveloper\FTShell\VB 6 EXAMPLE\FTShellTest.exe which tests much of the functionality of FTShell (not all or it). This program should run on any machine that has a working FT4Web. The VB6 source file is available in c:\FT\FT4WIN\FTDEVELOPER\FTShell\VB 6 Example\FTShellTest_Source_vb6.frm

Visual Basic 6.0 (and VBA)  Practical Example

Using VBA is the most popular way people use FTShell as VBA is included free in every copy of Microsoft Excel. See the c:\ft\ftdeveloper\ftshell\excel\ folder for several examples. The example below runs with VB6 or within VBA. It doesn't contain any Excel cell/column/row references, but rather just outputs text files.

This program prints every bit of dividend-adjusted data in FT Databases to individual text files. Cut and paste into a new VB6 or VBA form or module
Runs about 2,000 text files per minute on an XP Pro 2006 AMD Dual CPU laptop with 2-GB. 

'----Private Sub Form_Load()---VB6 generates this top line

Dim I&, N&, P!(), Symbols$, Sym$
Dim FT As New FTShell2.clsFTshell2                     'be sure to set a reference to the FTShell.DLL
Symbols$ = FT.Family("ALL")                          'get a '|' delimited list of families
For I& = 1 To Val(FT.HeadTail(Symbols$, Symbols$, 3))'start parsing the list at the third element (the count of elements)
  Sym$ = FT.HeadTail(Symbols$, Symbols$)             'each subsequent element is a ticker symbol
  P! = FT.DivAdjPrices(Sym$)                         'read the prices
  Open "C:\temp\" & Sym$ & ".TXT" For Output As #1   'the temp folder must exist
  For N& = 1 To FT.MaxNumDays
    Print #1, FT.Date2Str(N&, "MM/DD/YY") & ","; P!(NX&)
  Next N&
  Close #1:  DoEvents                                'allow interrupts and windows events to happen
Next I&
Set FT=Nothing : DoEvents                            'shutdown the class. Allow Windows to deallocate resources before form exits.

'------End Sub-------VBA generates this bottom line

Visual Basic.Net 2005 (and later) Windows Form

All arguments are passed as ActiveX variants. In Net development environments variants are type Object. In most cases VB will coerce (transform) the parameters and returned values to the types needed.

Start VB.NET for Windows Forms with a new project. Right-click on WindowsApplication under the Solution explorer. Select add reference. Select the Browse window. Find FTshell2 reference to the most recent (highest version). Now you are ready to code

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim ftd As New FTShell2.clsFTShell2
Dim prices!() 'empty 32-bit floating point array
Prices! = ftd.DivAdjPrices("FMAGX")' gets a floating point price array for Fidelity Magellan
form1.Text = CStr(prices(10)) 'the 10th price (from September 1988)appears in the form caption
End Sub

C#.NET 2010 Console Application Example

This is an example written in C# using the C#.NET 2010 to call FTShell Features. You must add a reference to FTShell.DLL, a COM object. There is a small executable that runs the example named:

C:\FT\FT4WIN\ftdeveloper\FTShell\CS_Net_Example\CS_NET_EXAMPLE.EXE

This program requires Microsoft FrameWork 4.O, If the program fails due to Framework error, then you can download the Framework 4 Client from microsoft.com. This may involve a lengthy download. Do not bother doing this unless you are a .NET programmer.

For C#.NET programmers, below is the heart of the example.

We have not included executable or source files. It is not practical to attempt to load a .Net 2010 Solution into an older version of .NET. Just make your own console application by cutting and pasting the code below.

C# code .Net 2010
-----------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
object sym = "FMAGX";
Single[] P;
FTShell2.clsFTshell2 shell = new FTShell.clsFTshell();

Console.WriteLine("Hit any key to display all FMAGX data");
Console.ReadKey();
P = shell.DivAdjPrices(sym);
for (int i = 1; i <= shell.MaxNumDays; i++)
{
Console.WriteLine( shell.MarketDay2Date(i).ToString("MM/dd/yy ") + P[i].ToString("C"));
}

Console.WriteLine("Hit any key to print FMAGX name");
Console.ReadKey();
Console.WriteLine(shell.SymName(sym));
Console.ReadKey();
}
}
}

End of C# Code
------------------

Programmer Note from FastTracker Roger Hunter:

Be sure to Compile for x86. DO NOT set to "Any CPU" in the Build options. With console programs, Any CPU is the default, while it's x86 for Windows Forms programs. the build option is always set to x86.

Visual Basic.Net 2005 (and later) for access by Windows IIS web pages

This routine should be part out your GLOBAL.ASA file. You do not want to create multiple FTSHELL objects as this may cause conflicts between processes. Putting the reference in the GLOBAL.ASA means that there is one copy of the DLL and that all web page references flow through this DLL in a single threaded manner. No single call to the DLL is lengthy so users should not notice delays. 

Note: Windows Network services MUST have security access to the \FT folder and/or other folders and files that FTShell will use.

Dim FTDll As New FTShell2.clsFTshell2
Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when IIS start the website
Application.Add("FTDll", FTDll)
Application("FTDLL").ArrayBase(1) 'ESTABLISH FOR ALL SESSIONS. Do not call at Session level

End Sub

Sub Application_End(ByVal sender As Object, ByVal e As EventArgs)
' Code that runs when IIS shutdowns the website 
Application("FTDLL").shell_close. 'Do not call at Session level
Application.Remove("FTDll")
end Sub

Notes:  Reference in your code in modules (not in global ASA) as follows

Dim FTD as FTDll = Application("FTDLL")
Dim prices() As Single
prices = ftd.DivAdjPrices("FMAGX")

Alternately, use the Application reference. However, you won't get any Intellisense prompting of the available calls

    NX&=Application("FTDLL").DivAdjPrices("FMAGX", prices())

If your web project has a class, be sure the inherits the Application interface. 

Public Class Model
Inherits System.Web.UI.Page   'IMPORTANT: Allows you to access the Application variables
Dim FTD as FTDLL=Application("FTDLL")

. . .
end Class

Visual FoxPro Example

Reference the object:

    FTD=GetObject("C:\FT\FT4WIN\ftshell2.dll","FTShell2.clsFtShell2")
    *All variables should be passed by reference using an "@" before the variable.