Cobol support animation?

 Hello, Im new to cobol. I have some question, does Cobol support animation such as gauge meter? Is there any way to implement gauge meter into cobol other than using ActiveX Control?


  • Hello Rosalinda,
    yes, you can with Cobol. You can use the W$BITMAP function to display a bitmap or an animated bitmap.
  • The Tour.cbl sample program demonstrates the use of animated bitmaps.

  • Hello ruudh.. Thank you for the answer.. But I have a question.. Can we create animation using COBOL language?
  • Depends on what you want to animate. You mentioned a gauge. Using the frame control, there are 2 fill colors, so you can fill the frame as you wish (i.e. a certain % full).
  • Verified Answer

    Hello Rosalinda,

    I'm not sure what you mean.

    One cannot create graphics in Cobol, but you can display graphics, static as well as animated.

    In the example gauge below, you can point to one of the images in the strip or let it run from the first to the last.

    Hopefully this helps,

    Regards, Ruud

  • So Cobol cannot create graphics like drawing shapes.. do you mean that?

    Does that mean Cobol can make an image rotate (such as needle rotation)? How to make it? What kind of software or extension to do that?
  • Verified Answer

    You are correct. Extend cobol does not have any graphic primitives. It has various controls that are surpisingly flexible, and they can be used to solve various issues that I will try to list out, but if you want to actually draw your own images then yes, you will need a graphics library you can interface to that does the work for you. That can be an activeX library or dll or java library - there are sections in the manuals on inter-connectivity.

    Control options:
    - BITMAP can show a picture or an animated GIF
    - As ruudh showed, you could use a bitmap strip and change which picture you display to simulate a moving dial. Just have your program compute percentage, and when you get past X (10% gaps in ruudh's strip) update which bitmap you show.
    - Browser can show a picture or movie - anything that can be shown on a webpage, but all you can do is pass it a URL. You could build an HTML file and point the browser at that, then generate a new one and update the control to point at the new URL.
    - W$PROGRESSDIALOG routine can be used to display a progress bar in a separate window(really useful for C$COPY in thin client).
    - FRAME - shows a box which can be filled/partially-filled to simulate a progress bar in your own window. Just keep updating until you get to 100%.
    - BAR - draws lines, but only horiizontal or vertical. Nothing angled. No circles.

    That's it, anything else usually requires a graphics library. Good luck!