Format in Navision Attain

SanyaSanya Member Posts: 11
edited 2003-12-05 in Navision Attain
Hi,

I have got a serialnumber and have to separate every single number to calculate with them. For example:

Serial: 14789

1*5
4*6
7*5
8*6
9*5

How can I get the numbers? I only found the possibility to get them as string (COPYSTR(Serial,1,1)). But I need them as integer.... Is there any possibility?

Comments

  • Timo_LässerTimo_Lässer Member Posts: 481
    This looks like Checksum calculation :wink:
    If it is so, you can use
    CheckNumber := STRCHECKSUM(String [, WeightString] [, Modulus])
    
    Timo Lässer
    Microsoft Dynamics NAV Developer since 1997
    MSDynamics.de - German Microsoft Dynamics Community - member of [clip]
  • SanyaSanya Member Posts: 11
    Yes it is a checksum, but it is a bit different.
    The function calculates the sum of the products. I need a checksum of
    the products. Therefore I cannot use this function. :(
  • Edgar62Edgar62 Member Posts: 1
    Sanya wrote:
    How can I get the numbers? I only found the possibility to get them as string (COPYSTR(Serial,1,1)). But I need them as integer.... Is there any possibility?

    You've got half of the answer. Here is the other half:

    OK := EVALUATE(IntegerVar,COPYSTR(Serial,Pos,1))

    Greetings,

    Edgar
  • SanyaSanya Member Posts: 11
    Thanks :D

    I tried it and it's exactely what I need!!
Sign In or Register to comment.