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!

incrementing array size

Status
Not open for further replies.

chris777

MIS
Jan 3, 2002
228
US
I want to take a string field and assign each position of the string to a position in an array. The size of the array needs to change with the string. I think I am close to making it work, however, The formula I have doesn't change the size of the array. What am I doing wrong? Here is the formula I am using (crystal syntax in v. 8.0):

numbervar totposit:=length({PR_PRINCIPAL.PRINC_NAME});
numbervar x:=1;
stringvar array a:="";

while x <= totposit do

(
a[x]:=mid({PR_PRINCIPAL.PRINC_NAME},x,1);
x:=x+1;
);

a[x];

The size of the array is not getting past 1? Do I need to assign a size to the array when I declare it? If so, how? I can't find anything on how to declare the size before-hand.


Thanks,
Chris
 
You may be making things much to difficult for yourself

a sting value itself is an array

try this

stringVar test := &quot;This is easy&quot;;

test[12] + test[9] + test[4];

the result of this little formula is &quot;yes&quot;

give you any ideas with your report ?? :)

Jim
 
I'm not sure that will help (although it's good to know!)

I guess I should elaborate more, but I didn't want to confuse the issue too much. Ultimately, I am trying to take an all caps string and convert it proper format taking into account numbers and spaces. The testing would not be difficult, if I can just get the loop to take the string piece-by-piece and then I can evaluate each array value and then reassemble the string.

Of coarse, if you know of a function that will do this already, that would be even better. Hammeraman and Assoc have one but it won't work with Oracle for some reason.
 
Please post an example of the field you are trying to convert and the desired result.

Mike

 
For example, {database.name} is a text field containing a first name and last name with a space in between, such as, &quot;STEVE JONES&quot;. The desired output is &quot;Steve Jones&quot;. Or, in a more extreme example is an address, such as, &quot;1234 MAIN ST EAST&quot;, which should be &quot;1234 Main St East&quot;. I am working with both types of string fields.
 
Homer says &quot;D'Oh&quot;!!!

The first thing I usually do is check the kbase. It works great. I did get an error while installing the dll but it seems to work great.

Thanks.
 
Chris,

You may need to register the dll.
Type: &quot;Regsvr32 uflcaps.dll&quot; from a command prompt. I always do that from the windows\system directory but I am not sure if it matters.
Software Support for Sage Mas90, Macola, Crystal Reports, Goldmine and MS Office
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top