Options

DateFormula Size

jemmyjemmy Member Posts: 247
Folks,

Anyone could tell me what is the calculation of size (bytes) for date type = DateFormula.
I found an ambiguous definition under Navision 3.7 and Navision 4.0.
But when I tried with SQL Option for Navision 4.0, I got 32 bytes.

Thanks in advance,

Jemmy

Comments

  • Options
    Tim81Tim81 Member Posts: 68
    The "Application Designer's Guide" sais 4bytes. But maybe he uses a different datatype in SQL, so it is bigger than the 4 bytes.
  • Options
    jemmyjemmy Member Posts: 247
    Yes Tim, you are right. I also found the doc said 4 bytes.
    But it doesn't match with the fact....
    I found 32 bytes and the data type is VARCHAR, any clue? :-s

    Jemmy
  • Options
    fbfb Member Posts: 246
    Cool -- experimenting crashes the v4.0 client...

    Here's what I did:
    • Run the Payment Terms form.
    • In the "Due Date Calculation" field, I entered 29 chars as '1D+1D+1D...' (you get the idea.) That worked fine.
    • Then, I added another '+1D' -- got the following error message:
    -----------------------------------------------
    Microsoft Visual C++ Runtime Library
    -----------------------------------------------
    (X) Buffer overrun detected!
    
    Program: ...Business Solutions-Navision 400\Client\fin.exe
    
    A buffer overrun has been detected which has corrupted the program's
    internal state.  The program cannot safely continue execution and must 
    now be terminated.
    
                                [OK]
    
    Click ok -- no Dr. Watson... the client just disappears.

    Just for haha's, I tried it again, only this time, I entered a really long string (60 chars or so -- the text box doesn't seem to have a limit). Results: This time I got Dr. Watson. Looks like the C++ Runtime buffer overflow detection can't handle a 'really big' buffer overflow...

    So, for v4.0 at least, the answer to the 'how long' question is something like "be really careful not to go over about 30 chars..."
  • Options
    Tim81Tim81 Member Posts: 68
    And that agrees with the 32 bytes that jemmy mentioned. 1 byte is used for the length. So if you enter more than 31 signs, a buffer overrun will be the result.
Sign In or Register to comment.