Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

oh the confusion

y2keabley2keable Posts: 23Member
i'm getting my setup program to work great in that it can copy the .EXE files to a place on the hard disk. the only thing is, when i put the program onto a floppy disk, the files are extracted not to the hard disk but onto the floppy disk, like its ignoring my CHDIR$ command.

hears how it goes...

my setup program displays a file path to the user, if he/she dont like it, they can change it.

The file path gets saved in a file for later use (it has to be used by a different program later on and the COMMON SHARED AS STRING wont work cos I have too many of them.)

After a few setup screens, the files are ready to be copied so I use the following code

OPEN Allocation FR NPUT AS #1
INPUT #1, UserDirectory$
CLOSE

OPEN FOR BINARY AS #1

CHDIR UserDirectory$ e.g. C:Progra`1 (program files)

OPEN FOR BINARY AS #1

Then the code copies the file from the current directory to the one set by the user.


This works fine as long as the setup program and the program to be moved are on the hard drive (i.e. C:ProgrammingQBASIC) but I simply click and drag the two files onto a floppy disk and the program still runs fine except that the files and the program are not put in the users allocation, theyre put on the floppy disk.

Anyone know why this is? Id put all my code in the message only its so big and there are 2 files. So if anyone wants to see the code then e-mail me at y2keable@hotmail.com note the files i'm talking about are compiled into .exe

Cheers

Comments

  • the walrusthe walrus Posts: 249Member
    [b][red]This message was edited by the walrus at 2003-11-3 16:46:57[/red][/b][hr]
    do this

    OPEN [b]UserDirectory$ + "" +[/b] FOR BINARY AS #1

    i think you can also change the drive using [b]CHDRIVE[/b] and then use [b]CHDIR[/b] if that's how you want to do it, but you don't really even need to use [b]CHDIR[/b], because you can just open the entire path + filename and do it all at once.

    (and I don't know how you've got [italic]UserDirectory$[/italic] stored, but if you've already got the "" at the end then do this instead: OPEN [b]UserDirectory$ + [/b] FOR BINARY AS #1)


Sign In or Register to comment.