CodeUnit Problem

maheshmaurya1987maheshmaurya1987 Member Posts: 21
Hi,
All I have a problem in codeunit,In codeunit i want that if x=12345678 then print it as 15263748.

Comments

  • mohana_cse06mohana_cse06 Member Posts: 5,504
  • PeterDPeterD Member Posts: 66
    And why?

    Just curious :D
  • BeliasBelias Member Posts: 2,998
    IF x = 12345678 THEN
      x := 15263748;
    
    Seriously, you should give some more info...I'm not getting the logic of the transformation of that number, can you explain it clearly, in order to avoid wrong suggestions?
    -Mirko-
    "Never memorize what you can easily find in a book".....Or Mibuso
    My Blog
  • SogSog Member Posts: 1,023
    I'm guessing a scramble
    (not tested)

    what I would do is
    scramble(x) = 12345678
    insstr(x,',',strlen(x)/2) -> x = 1234,5678
    for i := 1 to 2 do
    subX selectstr(i,x) -> x = 1234,5678 subX[1]= 1234 subX[2] = 5678

    x:='';
    for i := 1 to strlen(subX) do begin
    x += copystr(subx[1],i,1) + copystr(subx[2],i,1)
    |Pressing F1 is so much faster than opening your browser|
    |To-Increase|
Sign In or Register to comment.