variables

Bacis2 and API programming
Post Reply
nevio64
Posts: 4
Joined: Mon Jul 01, 2002 1:35 pm

variables

Post by nevio64 » Wed Jul 03, 2002 4:50 am

I was very glad to know that exists a forum where we can tell our problems in order to have a suggestion.

My problem is the following:
I must make a porting of procedures bacis1 from medusa classic (on Sun os) into medusa NG (NT)
These procedures are:
A part of input dates (now they are made with write windi)
A part are made of calcule and drawing

As there are many procedures, I intended to write again in bacis2 the part of input dates only, and to keep in bacis1 the procedures of drawing.

I don’t know how to declare and to pass the variables taken by bacis2 to the procedures in bacis1.

I’ve tried to make as follows:
procedure bacis2

define_constant(!prova_macro_bacis2,
proc
DIAM :- 120
sys_show(DIAM)
endproc)

procedure bacis1

-- variabile.mac
qvar DIAM
bacis

It doesn’t work.

I’ve also declared DIAM in ...mxe/config.bac, but it still doesn’t work.

What can I do?

Awaiting your kind reply on the matter,

Best regards
Nevio Bassi
:)

fritro
Posts: 7
Joined: Thu May 02, 2002 3:42 am

variables

Post by fritro » Wed Jul 03, 2002 7:56 am

Hello,

for making bacis2 variables available at bacis1
you have to use the bacis2 function

diam :- 120
m2d_lvar_put(diam)

For work with bacis1 variable at bacis2 yo have
to use

frombacis1 :- m2d_lvar_get("varnam")

Fritro ;)

nevio64
Posts: 4
Joined: Mon Jul 01, 2002 1:35 pm

variables

Post by nevio64 » Thu Jul 04, 2002 3:20 am

Thank you for your quick answer!
Is it possible to assign with the m2d_lvar_put command variables too or this command assigns values only?


es:

bacis 2

diam :- 120
m2d_lvar_put("pippo", “diam”)

bacis 1

qvar pippo

The prompt writes diam
How can I assign to the variable pippo the value 120?

Awaiting your kind reply

Regards
Nevio Bassi

fritro
Posts: 7
Joined: Thu May 02, 2002 3:42 am

variables

Post by fritro » Mon Jul 08, 2002 2:50 am

bacis 2

m2d_lvar_put("diam",integer_string( 120))


bacis 1
* let diam =
* qvar diam
120

If you look to the online help you can see that you can
use string value or the bacis2-object LIST.

Fritro

Post Reply