Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENVIRON/ENVIRON$ #1

Open
clasqm opened this issue May 22, 2020 · 1 comment
Open

ENVIRON/ENVIRON$ #1

clasqm opened this issue May 22, 2020 · 1 comment

Comments

@clasqm
Copy link

clasqm commented May 22, 2020

Well, one of these three should work, surely?

> shell("pp=test")
> print environ$("pp")

> shell("export pp=test")
> print environ$("pp")

> environ("pp=test")
> print environ$("pp")

> 

This is on a Debian-derived system

@paulwratt
Copy link
Owner

hmm.. I will have to look into this (I dont have BAS 2.5 setup on this current OS) - appologies for not seeing this sooner

Off the top of my head, none of those SHELL commands will do what you want, they are all siblings and therefore cant affect the parent environment (this is a reflection of SHELL execution, not BAS - its a safety & security measure in POSIX)

FWIW Also SHELL execution does not "pipe back to BAS" (you cant collect return text or error values in a variable). I wanted to fix this at the time, but I did not know how (in a way that works cross platform) - my workaround was to use .OUT hidden files in the current directory, and read thos into a variable.

As far as ENVIRON goes, I used it alot to generate the proper width and height of the interpreter inside a shell/terminal (from './autoexec.bat` - but I did not include that in the repo). What I dont remember is setting anything. However I do know there is a qwirk with the contents of ENVIRON - that maybe I fixed? or this is an example of it being broken (sorry I cant remember more details atm)

I will try an post something back soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants