Pascal

Moderators: None (Apply to moderate this forum)
Number of threads: 4106
Number of posts: 14016

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
Dos variable Posted by geergon on 26 Jun 2002 at 9:41 PM
My question is:

How can I set a DOS environment variable in my code?

Report
Re: Dos variable Posted by iby on 28 Jun 2002 at 3:29 PM
: My question is:
:
: How can I set a DOS environment variable in my code?
:
:

What for? Your program already knows what you want to set...
Post some details

Iby

Report
Re: Dos variable Posted by geergon on 29 Jun 2002 at 8:17 PM
: What for? Your program already knows what you want to set...
: Post some details
:
: Iby
:
Ok,It is something like this:
C:/>read name
(*now reading*)
georg_

My question is: how can I set the paramstr(1) "name" into a DOS environment variable with the read(past) string assigned?
Then:
echo %name%
george

Thank you for your time.
(sorry, english is not my default language).
Report
Re: Dos variable Posted by iby on 30 Jun 2002 at 5:03 PM
: : What for? Your program already knows what you want to set...
: : Post some details
: :
: : Iby
: :
: Ok,It is something like this:
: C:/>read name
: (*now reading*)
: georg_
:
: My question is: how can I set the paramstr(1) "name" into a DOS environment variable with the read(past) string assigned?
: Then:
: echo %name%
: george
:
: Thank you for your time.
: (sorry, english is not my default language).
:


I am not aware of any pascal command for setting
enviroment variables. However this can be achived
by running exec() command. This however could be
limited to current sesion.
Reading of environment vriables is easy. Just check
example in help on GetEnv().


Iby
Report
Re: Dos variable Posted by Manning on 28 Jun 2002 at 4:56 PM
: My question is:
:
: How can I set a DOS environment variable in my code?

I remember looking at the source to an old BBS package that would change the PATH environment variable when you shelled to the OS (so it included a message saying "Type EXIT To Return" type thing), and it looked to be quite the hack job.

If you're interested in looking, the source is distributed in an archive called sg20src.zip. Unfortunately it's like 10 megs and you only need a couple files, so that's really overkill. Maybe someone else will have an answer for you though.
Report
Re: Dos variable Posted by weedsmoka on 14 Aug 2002 at 5:31 PM
: My question is:
:
: How can I set a DOS environment variable in my code?
:
:
i assume you are using turbo/borland pascal.
open the help and look for GetEnv or SetEnv
Report
Re: Dos variable Posted by geergon on 14 Aug 2002 at 8:53 PM
: : My question is:
: :
: : How can I set a DOS environment variable in my code?
: :
: :
: i assume you are using turbo/borland pascal.
: open the help and look for GetEnv or SetEnv
:

Yes, I use Borland Pascal With Objects 7.0
But the procedure SetEnv does not exist
(sorry english in not my native language)

Report
Re: Dos variable Posted by weedsmoka on 15 Aug 2002 at 3:22 AM
: : : My question is:
: : :
: : : How can I set a DOS environment variable in my code?
: : :
: : :
: : i assume you are using turbo/borland pascal.
: : open the help and look for GetEnv or SetEnv
: :
:
: Yes, I use Borland Pascal With Objects 7.0
: But the procedure SetEnv does not exist
: (sorry english in not my native language)
:

:
you are right, my mistake.
i looked around and found a DosEnv unit you might find useful. didnt
test it though.

in there ==> http://atlas.csd.net/~cgadd/knowbase/DOS0039.HTM
Report
Re: Dos variable Posted by geergon on 15 Aug 2002 at 5:31 PM

OK, it works fine.
thank you for your time.




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.