Server Action compilation error

I wrote a file size formatting tool, but there was a problem compiling, I don't know what the error is, please help me analyze it, thank you.

the Size is input parameter,Data type is Long integer; the SizeFormatText is outout parameter,Data type is Text.

I uploaded the module file

Hi Yi Wang,

I believe it probably has to do with the data type that the outcome of a multiplication has... if * is used with two integers the output will be an integer, if it is used with an integer and a long integer then the output is a long integer. That outcome of that last if/multiplication cannot be represented as an Integer (and as such overflows).

If you store the TB value in a Long Integer local variable it should work.

Can you try it?

Solution

Hi Yi Wang,

What Jorge mentioned is correct , i did some changes in the oml and is working fine. Instead of evaluating the GB and TB value by multiplying i took two variable and assigned the calculated value as default which is working fine .

Please refer to the updated oml.


Regards,

-PJ-

Solution

Pramod Jain wrote:

Hi Yi Wang,

What Jorge mentioned is correct , i did some changes in the oml and is working fine. Instead of evaluating the GB and TB value by multiplying i took two variable and assigned the calculated value as default which is working fine .

Please refer to the updated oml.


Regards,

-PJ-


Thanks, it works fine

Jorge Martins wrote:

Hi Yi Wang,

I believe it probably has to do with the data type that the outcome of a multiplication has... if * is used with two integers the output will be an integer, if it is used with an integer and a long integer then the output is a long integer. That outcome of that last if/multiplication cannot be represented as an Integer (and as such overflows).

If you store the TB value in a Long Integer local variable it should work.

Can you try it?

I understand, thanks =)


Good to hear it solved your problem.

Regards,

-PJ-