I've got a script that uses `link' to include a file containing a few procedures. This library that I'm trying to link lives in the same
directory as the script file. I compiled the library using `icont -c
<filename.icn>' which created filename.u1 and filename.u2.
However, the code does not seem to be linked in as the script outputs
wrong data. What am I doing wrong? TIA ..
-- Duke
On 2025-02-12, Sidney Reilley <sidney.reilley.ii@gmail.com> wrote:
On 2025-02-11, Jason Martin <jasonm@claudville.va> wrote:
On 2025-02-11, Sidney Reilley <sidney.reilley.ii@gmail.com> wrote:
I've got a script that uses `link' to include a file containing a few
procedures. This library that I'm trying to link lives in the same
directory as the script file. I compiled the library using `icont -c >>>><filename.icn>' which created filename.u1 and filename.u2.
However, the code does not seem to be linked in as the script outputs
wrong data. What am I doing wrong? TIA ..
-- Duke
Page 184 of the Icon book 3rd edition
[It will be Page 206 in your PDF viewer]
CREATING NEW LIBRARY MODULES
Keep reading about IPATH after that.
They may need to be in IPATH.
I've got IPATH pointing to where all the scripts live.
Any other ideas?
# mylib.icn
# Note: Libraries cannot have procedure main()
procedure one()
write("ONE")
end
procedure two()
write("TWO")
end
icont -c mylib.icn
# main.icn
link mylib
procedure main()
write("Main")
write(one())
write(two())
end
icon main.icn
# Works for me on GhostBSD without IPATH
Main
ONE
TWO
On 2025-02-11, Jason Martin <jasonm@claudville.va> wrote:
On 2025-02-11, Sidney Reilley <sidney.reilley.ii@gmail.com> wrote:
I've got a script that uses `link' to include a file containing a few
procedures. This library that I'm trying to link lives in the same
directory as the script file. I compiled the library using `icont -c >>><filename.icn>' which created filename.u1 and filename.u2.
However, the code does not seem to be linked in as the script outputs
wrong data. What am I doing wrong? TIA ..
-- Duke
Page 184 of the Icon book 3rd edition
[It will be Page 206 in your PDF viewer]
CREATING NEW LIBRARY MODULES
Keep reading about IPATH after that.
They may need to be in IPATH.
I've got IPATH pointing to where all the scripts live.
Any other ideas?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (2 / 14) |
Uptime: | 145:56:52 |
Calls: | 10,383 |
Calls today: | 8 |
Files: | 14,054 |
D/L today: |
2 files (1,861K bytes) |
Messages: | 6,417,687 |