File-Compression with C/Side

rkaufmannrkaufmann Member Posts: 71
Hi,

I know this has beed discussed already, but what I need is a bit more special I think.
So here we go:

I need a OCX or Automation for C/Side to create compressed self-extracting archives for given files and/or whole directories.

Commandline-Tools will not help, because the files to compress may vary a lot in size, so the time the compression takes will vary also. Using Commaldline Tools and SLEEP is therefor not really helpfull.

C/Side must have control over the compression process and must know when the compression is finished, because the Code Processing in C/Side has to wait until the compression is finished.

I would also be helpfull, if C/Side would know, if the compression was successfull at all.

Does anybody know a Compression Tool, which can be used to achieve that?

Thanks,
Rolf

Answers

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You can use SHELL with a returncode. This way, Navision will wait until the execution has finished, and you can get the result of your command.
    [ReturnCode]:= SHELL(Name [, Param, ...])
    ReturnCode

    Data type: integer

    ReturnCode is used for two different purposes:

    First, if ReturnCode is used, the external program will be run modally, while it will be run non-modally if ReturnCode is not used. For instance, if you want to go to the operating system and get a directory listing and then bring that information back into the system, include ReturnCode. Omit ReturnCode if you want to run the external program non-modally. For instance, if all you want to do is pass information (such as a name and address) to a standardized letter that is set up in a word processor, you would omit the ReturnCode.

    Second, ReturnCode can contain the return value of the external program. Since external programs can return different codes to reflect whether errors occurred during the execution of the program, the values stored in ReturnCode depend on the external program.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • krikikriki Member, Moderator Posts: 9,110
    And you can use 7-zip : http://www.7-zip.org.
    It has a command-line interface, it can create exe-files and with the SHELL-command or even better
    http://www.mibuso.com/forum/viewtopic.php?t=12417, you can control when it finishes. I already use the combination and it works fine.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • rkaufmannrkaufmann Member Posts: 71
    Many thanks.

    Learned something new today.

    One thing I forgot to mention in my first post:
    The code needs to work in NAS.
    So I think I will try kriki's solution, because NAS can not answer the confirmation-request of the SHELL-Command, right?
  • krikikriki Member, Moderator Posts: 9,110
    rkaufmann wrote:
    Many thanks.

    Learned something new today.

    One thing I forgot to mention in my first post:
    The code needs to work in NAS.
    So I think I will try kriki's solution, because NAS can not answer the confirmation-request of the SHELL-Command, right?
    Right!
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • rkaufmannrkaufmann Member Posts: 71
    Thanks again for your quick reply.
Sign In or Register to comment.