Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.


#Analytics
#DecisionOptimization
#DecisionOptimization
 View Only
Expand all | Collapse all

adding a string to a nonstring value

  • 1.  adding a string to a nonstring value

    Posted 12/03/08 03:20 PM

    Originally posted by: SystemAdmin


    [shadi said:]

    hello,
    i want  to add a string to a nonstring value  in my model file and to use the result (range1) in my data file
    so i used the following code

    string Range1="SUN!R3:X" + 79;

    and i get this error
    Operator not available for string + int
    Why?

    Kshieboun Shadi

    #DecisionOptimization
    #OPLusingCPLEXOptimizer


  • 2.  Re: adding a string to a nonstring value

    Posted 12/03/08 03:28 PM

    Originally posted by: SystemAdmin


    [alain.chabrier said:]

    Hi,

    In the OPL language there is not string manipulation syntax, as the error says.
    There is in Script.

    You can do :


      string Range1;
     
      execute {
        Range1 ="SUN!R3:X" + 79;
        writeln(Range1);
      }
       

    Alain
    #DecisionOptimization
    #OPLusingCPLEXOptimizer