Unit SymbolInfo; { This unit used to be a lot more complicated. A TSymbolInfo object had to know all sorts of things. o For one thing, we had a special flag to say that a symbol had no volume, and we should fake the volume numbers. o At one time TAL did not have continuous futures. So we built them ourselves, based on several sources. This unit recorded which sources, and other information required to do that work. o Until just recently, this list could be used in two ways. When we went to TAL we needed to know which stocks to ask about. And when we created the file to tell the real-time servers which symbols to look at, that info also came from this unit. The two lists were not identical. (And I recently found out that feature was broken, and you could not successfully request information about a symbol if that symbol is not available in real-time. But part of the code for that existed until just now.) o Until just recently, this unit was reponsible for choosing which symbols to watch and which ones to ignore if the user requested automatic symbols and gave us a maximum number of symbols to watch. Those requirements are gone. This unit seems trivial now. It still maintians a list of symbols. We need to ask TAL for data about all of these symbols. The old code was a huge mess. I'm glad that it is gone. If we ever need to do one of those things again, we need to find a better way to do it. We do not want to go back to the old code. } Interface Uses Classes; Function CreateSymbolList : TStrings; Procedure AddSymbol(SymbolList : TStrings; Symbol : String); // This will add each item in the source list to the destination as if you // called AddSymbol on each item one at a time. // If you sort the list first, this will go faster. Procedure AddSymbolList(Destination, Source : TStrings); Function GetFuturesAltSymbol(Symbol : String) : String; Implementation Uses StrUtils, SysUtils; Function CreateSymbolList : TStrings; Var RealList : TStringList; Begin RealList := TStringList.Create; RealList.Sorted := True; RealList.Duplicates := dupIgnore; Result := RealList End; Procedure AddSymbol(SymbolList : TStrings; Symbol : String); Begin Symbol := UpperCase(Trim(Symbol)); If Symbol <> '' Then SymbolList.Add(Symbol) End; Procedure AddSymbolList(Destination, Source : TStrings); Var I : Integer; Begin For I := 0 To Pred(Source.Count) Do AddSymbol(Destination, Source[I]) End; Function GetFuturesAltSymbol(Symbol : String) : String; Begin If (LeftStr(Symbol, 1) = '/') And (RightStr(Symbol, 3) = '[0]') Then Result := LeftStr(Symbol, Length(Symbol) - 3) + '[2]' Else Result := '' End; End.