f



FileCopy question

Why does

           FileCopy "C:\MyFolder\myfile.txt",  "D:\Backup\myfile.txt"

work, but

           Dim a,b as String
           a = "C:\MyFolder\myfile.txt"
           b = "D:\Backup\myfile.txt"
           FileCopy a, b

doesn't.
That is, why do literals work and variables don't.
How can I get it to work with Variables?

Carl  
0
invalid171 (7008)
2/5/2012 10:05:24 PM
comp.lang.visual.basic 2233 articles. 0 followers. please859 (33) is leader. Post Follow

2 Replies
473 Views

Similar Articles

[PageSpeed] 21

Carl Benton <invalid@invalid.invalid> wrote in 
news:oruti7pm4cvjo4bv5s3g6oaddaes59qbdi@4ax.com:

> Why does
> 
>            FileCopy "C:\MyFolder\myfile.txt",  "D:\Backup\myfile.txt"
> 
> work, but
> 
>            Dim a,b as String
>            a = "C:\MyFolder\myfile.txt"
>            b = "D:\Backup\myfile.txt"
>            FileCopy a, b
> 
> doesn't.
> That is, why do literals work and variables don't.
> How can I get it to work with Variables?
> 
> Carl  
> 

Strange, because in VB6 it works fine for me.

Try :
           Dim a as String
    	     Dim,b as String
           a = "C:\MyFolder\myfile.txt"
           b = "D:\Backup\myfile.txt"
           FileCopy a, b

I have already seen cases when two 'DIM' on the same line does not work 
correctly, giving a 'incompatible type'

Jean-Paulo
0
bidon5191 (1)
2/6/2012 5:42:17 AM
On Sun, 05 Feb 2012 23:42:17 -0600, JeanPaulo <lehmann.jeanpaul;bidon@free.fr> wrote:

>Carl Benton <invalid@invalid.invalid> wrote in 
>news:oruti7pm4cvjo4bv5s3g6oaddaes59qbdi@4ax.com:
>
>> Why does
>> 
>>            FileCopy "C:\MyFolder\myfile.txt",  "D:\Backup\myfile.txt"
>> 
>> work, but
>> 
>>            Dim a,b as String
>>            a = "C:\MyFolder\myfile.txt"
>>            b = "D:\Backup\myfile.txt"
>>            FileCopy a, b
>> 
>> doesn't.
>> That is, why do literals work and variables don't.
>> How can I get it to work with Variables?
>> 
>> Carl  
>> 
>
>Strange, because in VB6 it works fine for me.
>
>Try :
>           Dim a as String
>    	     Dim,b as String
>           a = "C:\MyFolder\myfile.txt"
>           b = "D:\Backup\myfile.txt"
>           FileCopy a, b
>
>I have already seen cases when two 'DIM' on the same line does not work 
>correctly, giving a 'incompatible type'
>
>Jean-Paulo

Thanks for the reply....
I have found the problem.
I had a 'senior moment' and
couldn't spot a simple mis-spelling....
DUH!
Carl
0
invalid171 (7008)
2/6/2012 4:12:23 PM
Reply:

Similar Artilces:

Newbie question: Quick Basic to Visual Basic
Program migration from Quick Basic to Visual Basic ? Regards to the newsgroup. Excuse my sudden intromission into the group, but I know from my long experience in these groups that there are a lot of people willing to help. As I ceased to program several years ago I found myself in the situation that my old programs are incompatible with Windows 98 and XP. I have code written in 1995 to 97 under DOS, using Quick Basic, which running under Windows, create problems when they write data files on to the fixed disk. I'm having trouble when restarting my PC. I guess this is due to the...

Questions about Visual Basic
1. Is there much similarity between Visual Basic and Qbasic? 2. What is the limit on array size for numbers? 3. Is it good for math? Thanks James "James" <news@quillian.net> wrote From the Vague Answers to Vague Questions department.... > 1. Is there much similarity between Visual Basic and Qbasic? Some. > 2. What is the limit on array size for numbers? Which language? > 3. Is it good for math? It is good for programming specific responses to user input. LFS -----= Posted via Newsfeeds.Com, Uncensored Usenet News =----- ...

openoffice
Hi I'm trying to work with the visual basic like language of the web part of openoffice, it looks a lot like visual basic. My question is, i'm trying to set focus to a certain textbox, but i can't get it to work. I used to remember that there was something like that in the control properties box in vb, like setfocus or something, but not here. Any tutorials on openoffice about the vb web thingie would be highly appreciated to. Thanks a bunch. ...

Visual Basic programming question
I am trying to run a query from the Visual Basic side of Access. What i want to do is have the program input a variable (employer name) into the "conditions" of the query. The variable should come from a For Loop that goes through each employer name in a table and inputs the specific employer name into the query conditions, run the query, and print the results. Is there a code that assigns a variable to the conditions of the query? Thank you! ...

Visual Objects compared to Visual Basic and Visual C.
Who can explain me why I have to use VO instead of VB or VC? OR is is there no difference? With kind regards Rob van der Ploeg Rob, Every language has his (dis)advantages. The ones you mention are all wrappers around the Win32 API. VO is a very nice and easy language compared to VC. Data-access is famous with VO, but also memorymanagement, the cargage collector, ragged array's. and the result is fast and reliable code. You do not have to declare every variable if you do not want to. (but you will) Comparing to VB is VO a real OOP langangue where VB is not. You can write your own classes, inherit classes from VO classes or from your own classes, Overide methods, use both strong and loose typed variables, write early and late bound code VO comes with a SDK containing the sourcecode of the part of VO written in VO (almost everything except f.i. the compiler) With VO you get this newsgroup, where almost every question is answered within hours. VO has a prof. usergroup in the netherlands, check www.sdgn.nl. with very often very well organised conferences. I think it is the best organised usergroup in the world. VO is limitted to the Win32 api. A .NET version is announced, but withoot a releasedate yet. More inforrmation about VO can be found at www.cavo.com regards, Erik "Mobi-Data Helpdesk" <info@direcom.nl> schreef in bericht news:1070360435.358105@tbird.introweb.nl... > Who can explain me why I have to use...

Newby Question:Visual Basic Dictionary
I'm creating a visual basic 6 program and I need to query a dictionary for 3 to 6 letter words that can be formed from a group of 6 letters..Being brand spankin new to VB I'm not sure if VB has a built in dictionary or if I am going to have to build one. Also, if I have to build it how what I do it? Is this over my head being so new? Here's how I would go about doing it: 1. Create or find a database with tblWords in it. 2. Set reference to DAO (or ADO, whichever you prefer but the example I've used is DAO) 3. Use this anagram function mention a few days ago...

[OT] RB to Visual Basic Question
Hi, I'm looking into the possibility of converting some REALbasic classes that I sell into similar VB classes in order to increase sales and was wondering if a VB guru here could answer some quick questions. Note - Ive never used VB. The product I'm thinking of converting basically just does a whole lot of calculations and then draws the result into a picture that the user then draws wherever they want. Is the concept of a Picture and drawing environment similar to RB? ie can you draw into a picture and then draw the picture into a canvas? Does the picture hav...

Visual Basic 6 Data Report Question
Hi all, I have an app in which I need to create a packing slip. I have designed in report designer. The data is pulled from a SQL database. My question is how can I put information from the data base into the Page Header? The way I have it setup right now the PageHeader contains the logo, title, address. All of which are fine. Then under that I need to put the ship to and bill to addresses, which are pulled from the data base. Then under that I need to have the column headings for item number, qty ordered, etc... These column headings are just labels. The packing slips are usuall...

Basic JSP Question (very basic)
I am trying to understand understand JSPs and Beans say I have a jsp or HTML that looks like this: <h3>Enter Charge Record</h3> <table> <tr><td>User Name</td><td><input type=text name=name></td></tr> <tr><td>Project</td><td><input type=text name=project></td></tr> <tr><td>Hours</td><td><input type=text name=hours></td></tr> <tr><td>Date</td><td><input type=text name=date></td></tr> </table> <input type=hidden name=event value=NEW_RECORD> <p><input type=submit> When I hit the submit button, are the fields (User Name, Project, etc) passed to/by the servlet engine as part of the request, or are they session attributes? I always thought that the request object was basically the stuff on the browser line after the question mark. "Buck Turgidson" <jc_va@hotmail.com> wrote: > When I hit the submit button, are the fields (User Name, Project, etc) > passed to/by the servlet engine as part of the request, or are they session > attributes? I always thought that the request object was basically the stuff > on the browser line after the question mark. Successful form elements will be passed by the browser to the web server. (Not that un-checked checkboxes are NOT successful and will not be sent by the browser.) Your example doesn't actually co...

visual basic from visual C++
Hi, is it possible, and if so, to call a Vb macro from VC++. Or manipulate spreadsheets (ie draw graphs from the data within the workbooks) usinbg MFC functions cheers Anthony Anthony Moss wrote: > Hi, > is it possible, and if so, to call a Vb macro from VC++. Or manipulate > spreadsheets (ie draw graphs from the data within the workbooks) usinbg MFC > functions This group is for standard C++ language only. Compilers, Vb, spreadsheets, MFC are not part of the C++ standard and therefore most of the people don't know anything about them. Try asking in some MFC related new...

Newbie question re Embedded Visual Basic
I just bought an HP iPAQ 2210 handheld and would like to write some simple VB programs to run on it. I am rather confused on what I need to do that. I gather I need VisualBasic 3.0 (I downloaded the runtime module from the MS site already). Where can I get the program? I have searched the MS and HP sites without success. I take it I can do the actual program writing on my desktop and then transfer the program to the handheld. VB3 is about 13 years old - you won't find it around anywhere other than auction sales (if that). I believe you want Windows CE - it's older version (pre-.net) was Windows CE 3.0. http://msdn.microsoft.com/embedded/prevver/ce.net/ -- Randy Birch MS MVP Visual Basic http://vbnet.mvps.org/ "Guenter Bellach" <bellachg@yahoo.com> wrote in message news:41980b45.2101735@news.individual.net... : I just bought an HP iPAQ 2210 handheld and would like to write some : simple VB programs to run on it. I am rather confused on what I need : to do that. I gather I need VisualBasic 3.0 (I downloaded the runtime : module from the MS site already). Where can I get the program? I have : searched the MS and HP sites without success. I take it I can do the : actual program writing on my desktop and then transfer the program to : the handheld. Hi Randy, > VB3 is about 13 years old - you won't find it around anywhere > other than auction sales (if that). I believe you want Windows > CE - it's older version (pre-.net) was Wind...

Question concerning Visual Basic 4.0
Well, two questions. I seem to be experiencing a problem. I found a copy ofVB 4.0 and I was playing with VBA in my access classes, so I tried this out. It's not so bad, but after sucessfully completing part of a project, at RANDOM points, it seems my form file corrupts! I don't understand why or how, because I probably dont understand the compiler process. I should have made backups, my fault, but thats my most current problem. My other question is, is there a way to detect when an image is in the bounds of another? Thanks! -S.Leon Are you programming in VB 4.0 or VBA? Are you using...

Question on displaying coloured words in Visual Basic
Is there anyway of displaying a group of words in a different colour? In the textbox or listbox all the words get changed to a selected colour. I want to change a group of words in the middle of a sentence. I've looked at the RichTextBox but can't find a way of getting the program to select the wanted text. Hoping for a reply Regards Brian Put a RichTextBox on a form (RichTextBox1) then add this code Option Explicit Private Sub Form_Load() Dim R As String R = "{\rtf1\ansi\ansicpg1252\deff0\deflang1033{" R = R & "\fonttbl{\f0\fnil\fcharset0 MS Sans Serif;}}"...

Visual Basic 5 and 6 compatibility questions
Hello, does anyone know: - Is it possible to run VB5 and Visual Studio 6 / VB6 on the same machine, or does this cause compatibility issues - Will VB6 generally run programs written in VB5, or does that need lots of adaptation to the VB5 code? Thanks, Olaf "Olaf" <olafamm_REMOVESPAM@saunalahti.fi> wrote in message news:4A142E8D.7020103@saunalahti.fi... > Hello, > > does anyone know: > > - Is it possible to run VB5 and Visual Studio 6 / VB6 on the same > machine, or does this cause compatibility issues > > - Will VB6 generally run programs written...

Newbie question: Any good resources on Visual Basic programming?
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com I hope I have misunderstood what is going on but..... This exact message text has been posted at least 3 of times between April 2003 and 8th August 2003 with a number of different names "signing" it, in at least 3 VB related NG.s. I find it *extremely* unlikely that differ...

Newbie question: Any good resources on Visual Basic programming?
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com ...

Newbie question: Any good resources on Visual Basic programming?
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com Timberwolf wrote: > > Hi everyone > > I'm a newbie to the world of Visual Basic programming. > I'm especially interested in VB internet programming and > VB database programming. > > Can anyone recommend some good books or w...

Newbie question: Any good resources on Visual Basic programming?
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com ...

Newbie question: Any good resources on Visual Basic programming? #3
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com Others have posted lists to respond to your question, which I don't have access to right now, but you might want to start with the sites at www.mvps.org and see if those scratch your itch. -- Randy Birch MVP Visual Basic http://www.mvps.org/vbnet/ P...

Newbie question: Any good resources on Visual Basic programming? #2
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com Seems no one wants to suggest stuff, oh well For straight SQL, 'SQL in a nutshell' is very good. http://www.amazon.co.uk/exec/obidos/ASIN/1565927443/ref=sr_aps_books_1_1/026-9716579-8154823 The similar 'VB in a nutshell' is a good reference (MS...

Newbie question: Any good resources on Visual Basic programming? #4
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com ...

Newbie question: Any good resources on Visual Basic programming? #2
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com On Fri, 26 Sep 2003 23:52:55 +0800, "Timberwolf" <timberwolf@yahoo.com> wrote: >Hi everyone > >I'm a newbie to the world of Visual Basic programming. >I'm especially interested in VB internet programming and >VB database...

Newbie question: Any good resources on Visual Basic programming? #2
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com ...

Newbie question: Any good resources on Visual Basic programming? #3
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com multi-post. answered in another group. -- Randy Birch MVP Visual Basic http://www.mvps.org/vbnet/ Please respond only to the newsgroups so all can benefit. "Timberwolf" <timberwolf@yahoo.com> wrote in message news:3f8033ab$2@news.starhub.net.sg... : Hi everyone :...

Newbie question: Any good resources on Visual Basic programming? #3
Hi everyone I'm a newbie to the world of Visual Basic programming. I'm especially interested in VB internet programming and VB database programming. Can anyone recommend some good books or websites about the topic? Thanks in advance. Best Regards, Gary Hendricks http://www.desktop-video-guide.com Try these; http://pc13.virtualave.net/dbtutorial.htm http://visualbasic.about.com/mbody.htm http://www.a1vbcode.com/ Dave "Timberwolf" <timberwolf@yahoo.com> wrote in message news:3f745ff7@news.starhub.net.sg... > Hi everyone > >...

Web resources about - FileCopy question - comp.lang.visual.basic

Meet Gabe Aul, Microsoft's beloved 'king of the big red button'
... problems of each user into account. @KH8March @windowsblog 17 :D (Sorry, couldn't resist) Mostly low-level changes, nothing visible. The filecopy ...

CurseForge.com Knowledge base - Curse Mod - CurseForge
CurseForge.com Projects Authors Forums Wiki Store Paste Sign in Register new account CurseForge.com Knowledge base Curse Mod 2 pages found Name ...

Move Files in Windows
... E.g. ^+.:: FileMove, c:\temp\*.doc, C:\stuff\docs FileMove, c:\temp\*.rtf, C:\stuff\docs\rtf return To go with FileMove, there is also FileCopy. ...


Department of Computer Science
from utils.display import Display, Database, FileCopy, Modal from utils.controls import * from utils.output import * from utils import shapes, ...

CurseForge.com Knowledge base - Curse Mod / Scripting Information - r15 - Source - CurseForge
About Curse Mod 2 (CMOD2) The Curse Mod 2 format makes it easy to automate the install of mods for games where all the mod files sit in the same ...

Resources last updated: 3/9/2016 10:40:33 PM