Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SetEnvironmentVariable PROBLEM

1 view
Skip to first unread message

Saąa Bistrović

unread,
Jul 22, 2008, 8:40:58 AM7/22/08
to
SetEnvironmentVariable PROBLEM

How to get in SHOWMESSAGE dialog box CHAR 'A' ?

---->>>Project1.DPR BEGIN---->>>
program Project1;

uses
SysUtils, Dialogs, Math, Windows;

var I:integer;

begin
I:=FileCREATE('DATA.TXT');
FileWrite(I,'DATA.TXT',Length('DATA.TXT'));
FileSeek(I,1,1);
FileRead(I,PChar(SetEnvironmentVariable(PChar('DATA'),nil))^,1);
showmessage(GetEnvironmentVariable(PChar('DATA')));
end.
<<<----Project1.DPR END<<<----

PLEASE HELP.

THANK YOU.


Marco van de Voort

unread,
Jul 22, 2008, 11:11:02 AM7/22/08
to
On 2008-07-22, Saąa Bistrović <sasa.bi...@ck.t-com.hr> wrote:
> SetEnvironmentVariable PROBLEM

First, this is the wrong group for Delphi problems, but

> How to get in SHOWMESSAGE dialog box CHAR 'A' ?

showmessage('A');

(or specify better what you want).

> ---->>>Project1.DPR BEGIN---->>>
> program Project1;
>
> uses
> SysUtils, Dialogs, Math, Windows;
>
> var I:integer;
>
> begin
> I:=FileCREATE('DATA.TXT');
> FileWrite(I,'DATA.TXT',Length('DATA.TXT'));
> FileSeek(I,1,1);
> FileRead(I,PChar(SetEnvironmentVariable(PChar('DATA'),nil))^,1);

What is this supposed to do? Setenvironmentvariable returns a bool.

var c:char;

fileread(i,c);
showmessage(c);

What are you trying to do?


Sasa Bistrovic

unread,
Jul 22, 2008, 12:35:39 PM7/22/08
to

"Marco van de Voort" <mar...@stack.nl> wrote in message
news:slrng8bu46....@snail.stack.nl...

If there is replacement for SetEnvironmentVariable to set variable
"var c:char;" without definning it in Delphi as :

var c:char;

if there is replacement as SetEnvironmentVariable for definning
"var c:char;" as I above mentioned in :

fileread(i,c);
showmessage(c);

PLEASE HELP.

THANK YOU.


Dr J R Stockton

unread,
Jul 22, 2008, 2:00:21 PM7/22/08
to
In comp.lang.pascal.borland message <g6528n$knh$1...@ss408.t-com.hr>, Tue,
22 Jul 2008 18:35:39, Sasa Bistrovic <sasa.bi...@ck.t-com.hr>
posted:

>
>If there is replacement for SetEnvironmentVariable to set variable
>"var c:char;" without definning it in Delphi as :

For Delphi questions, you must ask in a group with "delphi" in its name.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk Turnpike v6.05 MIME.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.merlyn.demon.co.uk/clpb-faq.txt> RAH Prins : c.l.p.b mFAQ;
<URL:ftp://garbo.uwasa.fi/pc/link/tsfaqp.zip> Timo Salmi's Turbo Pascal FAQ.

0 new messages