Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I can not figure out why getting missing ) 1

Status
Not open for further replies.

morechocolate

Technical User
Apr 5, 2001
225
US
I am getting an error of missing) for the following formula. I can not figure out why. Please help.

StringVar array AllPriceSource := ["BB","COST","HUBDATA","IDCCURR","LMP","LPC","MANUAL","OTHER","PM","PP","PVT","STREET"];
StringVar HoldPriceSource;
NumberVar cnt;
StringVar ShowPriceSource;
StringVar PriceSource;
StringVar DBLocation := {?CAMRA Location};
StringVar Path := DBLocation + "pricing.dat";

For cnt := 1 to UBound(AllPriceSource) Do
(
HoldPriceSource := AllPriceSource[cnt]
PriceSource = pfGetStrValEQ (Path,3,pfKeyStr ({currhold.CUSIP},pfKeyDate ({@GetCurrentPriceDate},pfKeyStr (HoldPriceSource,""))),"PRICE_SOURCE")
if PriceSource <> &quot;&quot; then
ShowPriceSource := PriceSource
);
ShowPriceSource

If I commit out all or any of the lines after HoldPriceSource := AllPriceSource[cnt] I get the error.

Also, for the more experienced programmers is there a better to do this. Eventually, I also want to make the ShowPriceSource an array and have that array filled with whereever the getvalue function matches the value in the AllPriceArray.

Thank You

Pam
 
I did the following to the for loop and I am no longer getting the error.

For cnt := 1 to UBound(AllPriceSource) Do
(

if AllPriceSource[cnt] = pfGetStrValEQ (Path,3,pfKeyStr ({currhold.CUSIP},pfKeyDate ({@GetCurrentPriceDate},pfKeyStr (AllPriceSource[cnt],&quot;&quot;))),&quot;PRICE_SOURCE&quot;) then
ShowPriceSource := AllPriceSource[cnt]
);
ShowPriceSource

Now I am working on the last part that I wanted to do.
 
PriceSource = pfGetStrValEQ(Path,3,pfKeyStr({currhold.CUSIP}, pfKeyDate ({@GetCurrentPriceDate},pfKeyStr (HoldPriceSource,&quot;&quot;))),&quot;PRICE_SOURCE&quot;)

this should be PriceSource := since you are assigning a value here...or perhaps this is just a typo.

This must be a set of custom UFL's I am not familar with them but just tearing it appart a bit it makes more sense to me this way...I could be way wrong on this though.

PriceSource = pfGetStrValEQ(Path,3,pfKeyStr({currhold.CUSIP}, pfKeyDate ({@GetCurrentPriceDate})),pfKeyStr (HoldPriceSource,&quot;&quot;),&quot;PRICE_SOURCE&quot;)

there seems to be 2 pfKeyStr functions in this and now they have the same call structure...again I may be wrong

Hope this helps
Jim
 
argghh...

Of course the first part should be

PriceSource :=

Jim
 
What your eally need is...
For cnt := 1 to UBound(AllPriceSource) Do
(
HoldPriceSource := AllPriceSource[cnt] ;
PriceSource = pfGetStrValEQ (Path,3,pfKeyStr ({currhold.CUSIP},pfKeyDate ({@GetCurrentPriceDate},pfKeyStr (HoldPriceSource,&quot;&quot;))),&quot;PRICE_SOURCE&quot;);
if PriceSource <> &quot;&quot; then
ShowPriceSource := PriceSource
);

I addedded a semicolon to the lines finishing...
HoldPriceSource := AllPriceSource[cnt] ;
(HoldPriceSource,&quot;&quot;))),&quot;PRICE_SOURCE&quot;);

Each statement in a multistatement formula must finish with a semi colon. Because you had started the do loop with a bracket that is what it was looking for.

Good luck

Editor and Publisher of Crystal Clear
 
Thank you Jim and chelseatech for your responses.

chelseatech, the semicolons did the trick. I totally forgot about checking those. Thanks you very much.

Pam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top