Topic: Question about the Reg_Out( ) command. (1 of 3), Read 20 times
Conf: Other, General, etc.
From: Peter Rejto
Date: Monday, March 30, 2009 01:41 AM

Hi,

I would like to put the name of the drive from which I booted up my computer into a text register.

Since the name of this drive is given by the Windows environment variable %HOMEDRIVE%, I could do this via redirection. Here are the details:

System("cmd /c set HOMEDRIVE >|(VEDIT_TEMP)\homedrive.tmp")
#10=Buf_Free
Buf_Switch(#10)
File_Open("|(VEDIT_TEMP)\homedrive.tmp",NOEVENT+NOMSG+OVERWRITE)
Begin_Of_File
Char(10)
Block_Begin(Cur_Pos)
Char(2)
Block_End(Cur_Pos)
Reg_Copy_Block(10,BB,BE)
Buf_Close(#10)
Return( )


This little macro, indeed, works for me.

According to the Vedit on-line help:

Out_Reg(r) Re-route console output to T-Reg 'r'.

So, I thought that the Out_Reg( ) command would do this task faster. However, I can not make it work.

Thanks,

-peter

 


Topic: Re: Question about the Reg_Out( ) command. (2 of 3), Read 21 times
Conf: Other, General, etc.
From: Christian Ziemski
Date: Monday, March 30, 2009 03:44 AM

On 30.03.2009 08:01 in vtech-other Peter Rejto wrote:
>
> I would like to put the name of the drive from which I booted up my
> computer into a text register.
>
> Since the name of this drive is given by the Windows environment
> variable %HOMEDRIVE%, I could do this via redirection.
>
[...]
>
> This little macro, indeed, works for me.

The easiest way would be the command

-- Get_Environment(r,"name")

Set T-Reg 'r' to the (string) value of the environment variable 'name'.
Returns the number of characters placed into T-Reg 'r'.


Christian

 


Topic: Question about the Reg_Out( ) command. (3 of 3), Read 20 times
Conf: Other, General, etc.
From: Pauli Lindgren
Date: Friday, April 03, 2009 11:38 AM

On 3/30/2009 1:41:22 AM, Peter Rejto wrote:
>
> According to the Vedit on-line help:
>
> Out_Reg(r) Re-route console output to T-Reg 'r'.
>
> So, I thought that the
> Out_Reg( ) command would do
> this task faster. However, I
> can not make it work.

Out_Reg redirects Vedit output (such as Message()) to a register. It does not work in DOS, of course.

As Christian said, you can use Get_Environment command.
In this case, the command would be:
Get_Environment(10,"homedrive")

--
Pauli