SetEnvironmentVariable PROBLEM

This is a discussion on SetEnvironmentVariable PROBLEM within the Pascal forums in Programming Languages category; 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('DAT A'),nil))^,1); showmessage(GetEnvironmentVariable(PChar('DATA'))) ; end. <<<----Project1.DPR END<<<---- PLEASE HELP. THANK YOU....

Go Back   Application Development Forum > Programming Languages > Pascal

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-22-2008, 08:40 AM
Saša Bistrović
Guest
 
Default SetEnvironmentVariable PROBLEM

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('DAT A'),nil))^,1);
showmessage(GetEnvironmentVariable(PChar('DATA'))) ;
end.
<<<----Project1.DPR END<<<----

PLEASE HELP.

THANK YOU.


Reply With Quote
  #2  
Old 07-22-2008, 11:11 AM
Marco van de Voort
Guest
 
Default Re: SetEnvironmentVariable PROBLEM

On 2008-07-22, Saša Bistrović <sasa.bistrovic@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('DAT A'),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?


Reply With Quote
  #3  
Old 07-22-2008, 12:35 PM
Sasa Bistrovic
Guest
 
Default Re: SetEnvironmentVariable PROBLEM


"Marco van de Voort" <marcov@stack.nl> wrote in message
news:slrng8bu46.2irh.marcov@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.


Reply With Quote
  #4  
Old 07-22-2008, 02:00 PM
Dr J R Stockton
Guest
 
Default Re: SetEnvironmentVariable PROBLEM

In comp.lang.pascal.borland message <g6528n$knh$1@ss408.t-com.hr>, Tue,
22 Jul 2008 18:35:39, Sasa Bistrovic <sasa.bistrovic@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.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:53 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.