Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: Creating A Number Array Post Reply Post New Topic
Author Message
OKsoccer24
Newbie
Newbie


Joined: 05 Jun 2008
Online Status: Offline
Posts: 35
Quote OKsoccer24 Replybullet Topic: Creating A Number Array
     Posted: 09 Mar 2010 at 8:31am
I need to create a number Array from an existing String Array (Multiple Value Parameter)

I want to copy the string array into a new number array.

Example Values in the String array are 111, 112, 113, etc.


Here is what I have so far

Local NumberVar Array simpleArray;
Local NumberVar arrayLen := count({?Area Manager});
Local NumberVar i;

For i:= 1 To arraylen Do(

simpleArray := tonumber({?Area Manager})

);


Edited by OKsoccer24 - 09 Mar 2010 at 8:46am
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4374
Quote lockwelle Replybullet Posted: 10 Mar 2010 at 6:25am
haven't done too much with arrays, but you need to dimension it (tell CR how big it is going to be).  Also, when you loop, you need to acccess an array member in the string array and add it to the number.
 
It appears that the {?Area Manager} is a delimited string, in which case you probably want to use Split() which will result in an array of strings that you can then use.
 
Array members are accessed using [] notation...basic likes()
 
HTH
IP IP Logged
Printable version Printable version

Forum Jump
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