Print Page | Close Window

use of split

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=20634
Printed Date: 04 May 2024 at 4:05pm


Topic: use of split
Posted By: spalmer
Subject: use of split
Date Posted: 10 Apr 2014 at 5:58am
I have a failing function that worked in Crystal 11
but is failing in Crystal 2008. I am trying to return the "User" to my report.
The formula is:
whileprintingrecords;
stringvar name:= split ({Command.host},"=")[2];
name:=split(name,",")[1];
name

The string data is "User=ann,ProcID=13368,Host=APP-MNI"
The string is defined as text 128 characters long.

The error I can't get beyond reads:
A subscript must be between 1 and the size of the array
The line highlighted is
stringvar name:= split ({Command.host},"=")[2];



Replies:
Posted By: DBlank
Date Posted: 10 Apr 2014 at 7:44am
I believe this has to do with your data source.
Some values in your Host field do not have a "=" character in it.
You have to decide how you want to handle that.



Print Page | Close Window