Writing Code
 Crystal Reports Forum : Crystal Reports for Visual Studio 2005 and Newer : Writing Code
Message Icon Topic: how to use array formula? Post Reply Post New Topic
Author Message
crystaliao
Newbie
Newbie


Joined: 27 Sep 2010
Location: Taiwan
Online Status: Offline
Posts: 18
Quote crystaliao Replybullet Topic: how to use array formula?
    Posted: 27 Oct 2010 at 11:55pm
Local StringVar array color_type_str := Split({qryTable.COLOR_TYPE}, ",");
Local NumberVar strLen := Count ({qryTable. COLOR_TYPE});
Local NumberVar i;

For i:=1 To strLen step +1 Do
(
    if color_type_str = "A" then
    (
     "V";
     Exit For ;
     )
)

the array data is like ["A","B","C"]
1.why the result shows "True" instead of "V" or "X"?
2.and is Count() the right way to count array length, why it show double zero "00", not the correct number of elements?

thank you~
IP IP Logged
lockwelle
Moderator
Moderator


Joined: 21 Dec 2007
Online Status: Offline
Posts: 4372
Quote lockwelle Replybullet Posted: 04 Nov 2010 at 11:23am
I would have thought that UBound would have been the correct method...same as .NET.
 
Not sure about the True part, I don't use array very often.
IP IP Logged
crystaliao
Newbie
Newbie


Joined: 27 Sep 2010
Location: Taiwan
Online Status: Offline
Posts: 18
Quote crystaliao Replybullet Posted: 06 Nov 2010 at 1:40am
Local StringVar array color_type_str := Split({qryTable. COLOR_TYPE}, ",");
Local NumberVar strLen := Count (color_type_str);
Local NumberVar i;
Local StringVar result;

For i:=1 To strLen step +1 Do
(
    If color_type_str = "A" Then
    (
        result := "V";       
        Exit For;
    )
);

result;


I wrote like above, it's work! :)
IP IP Logged
Post Reply Post New Topic
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



This page was generated in 0.031 seconds.