CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    May 2013
    Posts
    11

    Unhappy Value separation from an array

    Hi All,

    I am getting multiple values in single parameter(type : string). i had added as string parameter and converted into
    number as well. But i dont know how to separate those values into single array each.

    i ll mention below which formula i have used:

    Stringvar Array string := Split({?ops1_id}, ",");


    Numbervar Array number;
    Redim number[Ubound(string)];


    Numbervar i;
    for i := 1 to Ubound(string) do (
    number[i] := ToNumber(string[i])
    );

    number[i];


    But this formula used to get count of an array. So please help me out.
    Thanks in advance
    vinoth

  2. #2
    Join Date
    Jul 2005
    Posts
    1,083

    Re: Value separation from an array

    I would use next code...
    The multiple value parameter ?ops1_id is already an array
    In the formula a numeric array 'number' is created with the elements of input parameter
    After the formula is executed (when you insert it in a report section) the numeric array is created and loaded
    then you can use each array element: number[1] or number[2] or number[3], etc.

    Code:
    Numbervar Array number;
    Redim number[Ubound({?ops1_id})];
    Numbervar i;
    for i := 1 to Ubound({?ops1_id}) 
    do
    (
    number[i] := ToNumber({?ops1_id}[i])
    );
    JG


    ... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured