Re: ouvrir un document word à partir d'un programme cobol



"2jo" <joffroy_lapeyronnie@xxxxxxxx> wrote in message
news:1140679832.187978.193190@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
In VB (or VBA) we can create 'Macros' (called subs or functions) and
what i want to do is to call a sub from my COBOL program...
..
the definition of a sub with parameters in VB is like that :
1-
private (or public) sub Name_of_sub (first_var as string)
[the code is here]
end sub

COBOL is not BASIC.

If you really need a BASIC analogy, COBOL supports "GOSUB" (via the PERFORM
verb), but does not support CALL (function or sub). (Period. Deal with it).
The COBOL 'CALL' verb is reserved for external procedures, nested programs
or additional ENTRY points, all beyond the scope of the this message.

For 'parameters', you can use with COBOL what you would use with BASIC to
execute code via GOSUB/RETURN: you write that subroutine to use a set of
specific variable names; when you are ready to execute your subroutine (in
COBOL, "PERFORM the paragraph") you assign (in COBOL, 'MOVE') to those
variables the values to be used for this particular execution.on RETURN, you
assign the result variables to the 'working' variables.

As far as 'private' or 'public' variables, you can forget about those, too,
unless you get into LOCAL STORAGE, available only when using additional
ENTRY points or nested programs. In COBOL, all datanames are GLOBAL (
SHARED by all code within the code module).

All that said, well-written COBOL ends up looking a lot like well-written
BASIC. And poorly-written COBOL looks a lot like...well, poorly-written
COBOL.

the solution (1-) is what i need to do

What you are describing is 'how', not 'what'. You never *need* to do
anything a certain way. Maybe you WANT to do it that way, but in this case
that is simply not possible. So you do it another way.


--------
Michael C. Mattias
Tal Systems Inc.
Racine WI
mmattias@xxxxxxxxxxxxxx



















.



Relevant Pages

  • Re: COBOL anyone?
    ... > William M. Klein wrote: ... > sub, or just 1 main total, if the subs are similar enough to combine ... that required a question of the assembled mass of COBOL ... If only vague and you want to give it a try - we can specify Decision ...
    (comp.lang.cobol)
  • Re: COBOL anyone?
    ... sub, or just 1 main total, if the subs are similar enough to combine ... that required a question of the assembled mass of COBOL ... I'm also really wishing that my work compiler supported free format... ... (Not that free format is the at the ...
    (comp.lang.cobol)