🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.basic.visual
Article #119

Re: Changing only the first letter in a file name

#119
From: Visual Boodu .NET
Date: Tue, 18 Mar 2003 06:13
46 lines
3014 bytes
Is this what your after?

REQ: form, label, common dialog control & command button

Private Sub Command1_Click()
 ' Set CancelError is True
  CommonDialog1.CancelError = True
  On Error GoTo ErrHandler
  ' Set flags
  CommonDialog1.Flags = cdlOFNHideReadOnly
  ' Set filters
  CommonDialog1.Filter = "All Files (*.*)|*.*|"
  ' Specify default filter
  CommonDialog1.FilterIndex = 2
  ' Display the Open dialog box
  CommonDialog1.ShowOpen
  ' Display name of selected file
  Dim A As Integer, FullFileName As String

  FullFileName = CommonDialog1.FileName

  For A = 0 To 1000

    'take out directories from the full file path
    If InStr(1, FullFileName, "\") Then

        FullFileName = Mid(FullFileName, InStr(1, FullFileName, "\") _
        + 1, Len(FullFileName) - InStr(1, FullFileName, "\"))

    Else

    Exit For

    End If

Next A

'Change first letter to b
Label1.Caption = "b" & Mid(FullFileName, 2, Len(FullFileName) - 1)
Exit Sub

ErrHandler:
  'User pressed the Cancel button
  Exit Sub
End Sub
Technical Details
Message-ID: <aOyda.4231$L57.39496@news-server.bigpond.net.au>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!news.linkpendium.com!ken-transit.news.telstra.net!news.telstra.net!news-server.bigpond.net.au!not-for-mail
References: <nhyda.36614$fa.1451379@twister.austin.rr.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f94ee,87b1850e9e17a40b
X-Google-Attributes: gidf94ee,public
X-Google-Thread: 1053fc,87b1850e9e17a40b
X-Google-Attributes: gid1053fc,public
X-Google-Thread: 110e3b,87b1850e9e17a40b
X-Google-Attributes: gid110e3b,public
X-Google-Thread: ffb5a,87b1850e9e17a40b
X-Google-Attributes: gidffb5a,public
X-Google-Thread: f645d,87b1850e9e17a40b
X-Google-Attributes: gidf645d,public
X-Google-Thread: 108062,87b1850e9e17a40b
X-Google-Attributes: gid108062,public
X-Google-Thread: 106fd2,87b1850e9e17a40b
X-Google-Attributes: gid106fd2,public
X-Google-Thread: fb992,87b1850e9e17a40b
X-Google-Attributes: gidfb992,public
X-Google-ArrivalTime: 2003-03-17 22:13:28 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-09!supernews.com!newshosting.com!news-xfer2.atl.newshosting.com!news.linkpendium.com!ken-transit.news.telstra.net!news.telstra.net!news-server.bigpond.net.au!not-for-mail
From: "Visual Boodu .NET" <sn@il.mail>
Newsgroups: comp.lang.basic.visual,comp.lang.basic.visual.misc,comp.lang.visual.basic,comp.lang.visual.basic.misc,cz.comp.lang.basic.visual,es.comp.lenguajes.visual-basic,free.it.programmazione.visualbasic,free.it.visual-basic,it.comp.lang.visual-basic
References: <nhyda.36614$fa.1451379@twister.austin.rr.com>
Subject: Re: Changing only the first letter in a file name
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
Message-ID: <aOyda.4231$L57.39496@news-server.bigpond.net.au>
Date: Tue, 18 Mar 2003 06:13:26 GMT
NNTP-Posting-Host: 138.217.64.166
X-Complaints-To: abuse@bigpond.net.au
X-Trace: news-server.bigpond.net.au 1047968006 138.217.64.166 (Tue, 18 Mar 2003 17:13:26 EST)
NNTP-Posting-Date: Tue, 18 Mar 2003 17:13:26 EST
Organization: BigPond Internet Services (http://www.bigpond.net.au)