Computer Science Canada

Importing Imagesin Different Dirs... (Era of War)

Author:  BioHazardousWaste [ Fri Feb 13, 2004 12:30 pm ]
Post subject:  Importing Imagesin Different Dirs... (Era of War)

I understand the Pic command pretty well now I think, but I couldn't find how to do this last thing... how do you import a file from a different directory? e.g. To import a light tank

<b>Import Pic</b>
code:

var PicID : int
var filename : string

filename := ("LTank.jpg")

PicID :=  Pic.FileNew (filename)
Pic.Draw (PicID, 25, 150, picMerge)


I tried using the directory in the filename string, but to no avail Sad Turing gives me the error "Illegal picture ID number '0'", on the line
code:
filename := ("m:\tank.bmp").

I also got that error if the picture wasn't in the same directory of my program. NOTE: I am doing this at school, and my "personal" drive is labelled M:... Would the network make this error?

<u><b>Unworking Code:</b></u>
code:


var PicID : int
var filename : string

filename := ("m:\Era Of War\Pics\LTank.jpg")

PicID :=  Pic.FileNew (filename)
Pic.Draw (PicID, 25, 150, picMerge)


And yes, i'm quite positive the picture is in that directory!

Author:  Dan [ Fri Feb 13, 2004 3:48 pm ]
Post subject: 

try "m:\\Era Of War\\Pics\\LTank.jpg" insted of "m:\Era Of War\Pics\LTank.jpg"

turing's way of speffing dir lines is a bit wired

Author:  recneps [ Fri Feb 13, 2004 4:00 pm ]
Post subject: 

i read in the Turing Reference somewhere, that you must use double \\ because a \<command> indicates to the program that there is a switch there, like in DOS, dir /p gives you all files in the dir by pages Smile

Author:  BioHazardousWaste [ Fri Feb 13, 2004 4:29 pm ]
Post subject: 

Thanx guys, I figured it was somethin simple like that.


: