Passing variables to a library procedure

As the files below show, I don't know how to pass variables to a library procedure. The library file doesn't seem to read the value (2.8) of WInch. In really old True BASIC (2.72), I'd write
DECLARE PUBLIC WInch
in the library file and
PUBLIC WInch
in the main program.)

Library file: SetUpPC1

EXTERNAL

! Calculate the size of the picture box in points:
DEF WPostScript
IF WInch = 0 then
PRINT "WInch is zero."
STOP
END IF
LET WPostScript = Winch*72
END DEF ! WPostScript

Main program:

LIBRARY "SetUpPC1"

LET WInch = 2.8
LET x= WInch
PRINT "WInch = "; x
LET y= WPostScript
PRINT " WPostScript = "; y
END

Thanks, Al Shenk

Comments

Passing values to LIBRARY modules

Hi,

You pass the value of variables to LIBRARY modules in exactly the same way as you did in TrueBASIC version 2.72. The language itself has not changed.

In other words make the variable PUBLIC in your main program, and DECLARE PUBLIC the same varaible in your library module.

Big John

2.72

Thanks for the prompt reply and the good news.
Al Shenk