Topic: If Then Else, The Remaining Text ...
Oldest Post First
Newest Post First
Author
Message
bshort1023
Newbie
Joined: 18 Jan 2012
Location: United States
Online Status: Offline
Posts: 18
Topic: If Then Else, The Remaining Text ... Posted: 17 Dec 2015 at 9:39am
"The remaining text does not appear to be part of the formula.". This works if I leave off the Else "All" at the end; As soon as I put it back in I get the error message. NumberVar numEmpID; NumberVar numRowIdent; NumberVar numStartOfEmployeeNumbers; NumberVar numLengthOfFinalString; StringVar strEmpID; StringVar strFinalString; numEmpID := Instr({BAQReportParameter.Filter1}, "EmpID"); If numEmpID <> 0 Then numRowIdent := Instr({BAQReportParameter.Filter1}, "RowIdent") +8; strEmpID := mid({BAQReportParameter.Filter1}, numEmpID, (numRowIdent - numEmpID)); numStartOfEmployeeNumbers := Instr(strEmpID, "FieldValue") + 11; numLengthOfFinalString := Length(strEmpID) - numStartOfEmployeeNumbers - 25; strFinalString := mid(strEmpID, numStartOfEmployeeNumbers, numLengthOfFinalString); Replace(strFinalString, "~", ", "); Else "All"; Thanks, Bill Short
IP Logged
kevlray
Admin Group
Joined: 29 Oct 2009
Online Status: Offline
Posts: 1587
Posted: 17 Dec 2015 at 9:56am
Put parens around the then clause statements. If you don't then only the statement
numRowIdent := Instr({BAQReportParameter.Filter1}, "RowIdent") +8; will be considered part of the then statement. If numEmpID <> 0 Then ( numRowIdent := Instr({BAQReportParameter.Filter1}, "RowIdent") +8; strEmpID := mid({BAQReportParameter.Filter1}, numEmpID, (numRowIdent - numEmpID)); numStartOfEmployeeNumbers := Instr(strEmpID, "FieldValue") + 11; numLengthOfFinalString := Length(strEmpID) - numStartOfEmployeeNumbers - 25; strFinalString := mid(strEmpID, numStartOfEmployeeNumbers, numLengthOfFinalString); Replace(strFinalString, "~", ", "); ) Else "All";
IP Logged
bshort1023
Newbie
Joined: 18 Jan 2012
Location: United States
Online Status: Offline
Posts: 18
Posted: 18 Dec 2015 at 3:31am
Thanks for the response. That was it. Works great now. Thanks again. Bill
IP Logged
Forum Jump
-- Select Forum --
Announcements
Talk with the Author
Self-Publishing
Job Postings
New feature request
Report Design
Data Connectivity
Technical Questions
Tips and Tricks
Crystal Xcelsius
Report Design
Data Connectivity
Writing Code
Tips and Tricks
Report Design
Data Connectivity
Writing Code
Tips and Tricks
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum
This page was generated in 0.020 seconds.