jcrawford08
Technical User
Running CR XI R1, on a SQL environment...
I have two dillemmas with the formula below:
1) I have looked at the parenthesis OVER and OVER and cannot see where I am missing one, but CR insists that I add one ")" to the end, just before the display clause...
2)In situations where the string identified truly does have a colon appearing prior to a paragraph or appearing when no paragraph is present, the formula does not return a value...
stringvar pwrcd;
local stringvar x:={Comments.CommentText};
local numbervar i;
local numbervar cntpar;
local numbervar cntcolon;
for i:=1 to len(x) do(if x=chr(13) then cntpar:=cntpar+1;if x = [":"] then cntcolon:=cntcolon+1;
if cntcolon<=0 or (cntcolon>=1 and cntpar>=1 and instr(x,chr(13))<instr(x,":"))then pwrcd:="No" else
if cntcolon>=1 and cntpar>=0 and instr(x,chr(13))>instr(x,":") then pwrcd:="Yes");
pwrcd
for the instr() comparisons, I've tried sub-ing the actual field name in as well, but to no avail
Essentially, users are supposed to enter "usernameassword" into the first line of a comment field, this is just a simple formula that should return a "Yes" or a "No" as to whether it was done right...
Any input/help is GREATLY appreciated
Not in word only, but in deed also... 1Jn3:18
I have two dillemmas with the formula below:
1) I have looked at the parenthesis OVER and OVER and cannot see where I am missing one, but CR insists that I add one ")" to the end, just before the display clause...
2)In situations where the string identified truly does have a colon appearing prior to a paragraph or appearing when no paragraph is present, the formula does not return a value...
stringvar pwrcd;
local stringvar x:={Comments.CommentText};
local numbervar i;
local numbervar cntpar;
local numbervar cntcolon;
for i:=1 to len(x) do(if x=chr(13) then cntpar:=cntpar+1;if x = [":"] then cntcolon:=cntcolon+1;
if cntcolon<=0 or (cntcolon>=1 and cntpar>=1 and instr(x,chr(13))<instr(x,":"))then pwrcd:="No" else
if cntcolon>=1 and cntpar>=0 and instr(x,chr(13))>instr(x,":") then pwrcd:="Yes");
pwrcd
for the instr() comparisons, I've tried sub-ing the actual field name in as well, but to no avail
Essentially, users are supposed to enter "usernameassword" into the first line of a comment field, this is just a simple formula that should return a "Yes" or a "No" as to whether it was done right...
Any input/help is GREATLY appreciated
Not in word only, but in deed also... 1Jn3:18