Go Back   Rhinocerus > Newsgroup > Newsgroup comp.lang.basic.misc

Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old 06-25-2012, 03:10 PM
Helge
Guest
 
Posts: n/a
Default Environment variables in Visual Basic (Vb5E, W7/64)

Hallo NG!
I need to open PathA = "%USERPROFILE%\Documents\paper\pp.csv"
Open PathA for Output as #FiNu
But it does not work that easy. Any ideas? Thanks!
Vy 73! Helge
--
Helge, DJ1WM
Reply With Quote
Alt Today
Advertising
 
and become member of Rhinocerus
Standard Sponsored Links

  #2 (permalink)  
Old 06-25-2012, 03:43 PM
ralph
Guest
 
Posts: n/a
Default Re: Environment variables in Visual Basic (Vb5E, W7/64)

On Mon, 25 Jun 2012 17:10:18 +0200, Helge <w4h@nurfuerspam.de> wrote:

>Hallo NG!
>I need to open PathA = "%USERPROFILE%\Documents\paper\pp.csv"
> Open PathA for Output as #FiNu
>But it does not work that easy. Any ideas? Thanks!
>Vy 73! Helge


The "%" delimiters are for use with shells. At the command line, in
batch files, Windows Shells (Explorer) etc.

In VB use the Environ() function without the delimiters.
Dim sRoot As String : sRoot = Environ("userprofile")
PathA = PathA = sRoot & "\Documents\paper\pp.csv"

-ralph

Reply With Quote
  #3 (permalink)  
Old 06-25-2012, 06:17 PM
Auric__
Guest
 
Posts: n/a
Default Re: Environment variables in Visual Basic (Vb5E, W7/64)

ralph wrote:

> On Mon, 25 Jun 2012 17:10:18 +0200, Helge <w4h@nurfuerspam.de> wrote:
>
>>Hallo NG!
>>I need to open PathA = "%USERPROFILE%\Documents\paper\pp.csv"
>> Open PathA for Output as #FiNu
>>But it does not work that easy. Any ideas? Thanks!

>
> The "%" delimiters are for use with shells. At the command line, in
> batch files, Windows Shells (Explorer) etc.
>
> In VB use the Environ() function without the delimiters.
> Dim sRoot As String : sRoot = Environ("userprofile")
> PathA = PathA = sRoot & "\Documents\paper\pp.csv"


No real need for the extra string:

PathA = Environ("userprofile") & "\Documents\paper\pp.csv"

--
Step right up. I've got plenty of death for everybody.
Reply With Quote
  #4 (permalink)  
Old 06-26-2012, 07:59 AM
Helge
Guest
 
Posts: n/a
Default Re: Environment variables in Visual Basic (Vb5E, W7/64)

Am 25.06.2012, 20:17 Uhr, schrieb Auric__ <not.my.real@email.address>:

> ralph wrote:
>
>> On Mon, 25 Jun 2012 17:10:18 +0200, Helge <w4h@nurfuerspam.de> wrote:
>>
>>> Hallo NG!
>>> I need to open PathA = "%USERPROFILE%\Documents\paper\pp.csv"
>>> Open PathA for Output as #FiNu
>>> But it does not work that easy. Any ideas? Thanks!

>>
>> The "%" delimiters are for use with shells. At the command line, in
>> batch files, Windows Shells (Explorer) etc.
>>
>> In VB use the Environ() function without the delimiters.
>> Dim sRoot As String : sRoot = Environ("userprofile")
>> PathA = PathA = sRoot & "\Documents\paper\pp.csv"

>
> No real need for the extra string:
>
> PathA = Environ("userprofile") & "\Documents\paper\pp.csv"
>


Thanks! That's it.
--
Helge, DJ1WM
Reply With Quote
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 03:06 AM.


Copyright ©2009

LinkBacks Enabled by vBSEO 3.3.0 RC2 © 2009, Crawlability, Inc.