johntmcii
asked on
Find Line Feed / Carriage Return
Have formula in Crystal Report trided this code; received error in formula message. trying to locate the position in the string where carriage return is located, I know in the test record it is postion 15. I am learn this code need help isolating the problem
Dim intPos As Integer;
Dim strString As String;
intPos = InStr({ODLN.Address},Chr(1 3))
strstring = left({ODLN.Address}, intPos - 1)
Dim intPos As Integer;
Dim strString As String;
intPos = InStr({ODLN.Address},Chr(1
strstring = left({ODLN.Address}, intPos - 1)
What does the error message say?
ASKER
Error in formula Do you want to save anyway? I answer yes then refresh... says....... remaining text does not appear to be part of the formula
ASKER
I This is the file I am using. Found it has address, city state and country in one file, seperated by one or more sets of Od/Oa. I am trying to find the end of the first field then I will find the beginning of the second field etc
The code I sent was only the first part where I got the error
datafile.bmp
The code I sent was only the first part where I got the error
datafile.bmp
Can you try commenting out everything else in the formula except what you sent us? And then try saving it. The problem sounds like its from another part of the formula...
ASKER
ASKER
I think the difference is it was set for Crystal syntax vs Bsic syntax; in either case I go no results
Well if you switch to crystal syntax and use:
local Numbervar intPos;
local Stringvar strString;
intPos = InStr({ODLN.Address},Chr(1 3));
strstring = left({ODLN.Address}, intPos - 1);
it should work?!
local Numbervar intPos;
local Stringvar strString;
intPos = InStr({ODLN.Address},Chr(1
strstring = left({ODLN.Address}, intPos - 1);
it should work?!
Crystal syntax uses := for assignment and = for comparison.
Change the = to a :=
local Numbervar intPos;
local Stringvar strString;
intPos := InStr({ODLN.Address},Chr(1 3));
strstring := left({ODLN.Address}, intPos - 1);
mlmcc
Change the = to a :=
local Numbervar intPos;
local Stringvar strString;
intPos := InStr({ODLN.Address},Chr(1
strstring := left({ODLN.Address}, intPos - 1);
mlmcc
ASKER
Sorry, it don't....... The remaining text does not appear to be part of the formula....same error as original same results.
In basic syntax there are no ; at the end of lines. Your declarations have ;'s
mlmcc
mlmcc
What is highlighted when you get the error?
mlmcc
mlmcc
ASKER
The difference in the two error messages was a result of one being in Basic Syntax mode and the other message being in Crystal Syntax mode. When I run this in Crystal Syntax mode I get the same original message, if I change to run in basic mode it will get the other error I sent.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.