Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 paint prog help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
abzoni




PostPosted: Sun Dec 11, 2005 12:20 pm   Post subject: paint prog help

hi, im currently workin on my paint prog *BIG PROJECT* and im basicly done except i cant get the program to add on a ".bmp" to the end of the filename when the user's saving. heres what i have so far:
if filename (* -3 .. *) not= ".bmp" then
filename := filename + ".bmp"
end if
any help would be appreciated! thx!
Sponsor
Sponsor
Sponsor
sponsor
do_pete




PostPosted: Sun Dec 11, 2005 12:27 pm   Post subject: (No subject)

this is the source code forum not the help forum
Paul




PostPosted: Sun Dec 11, 2005 1:53 pm   Post subject: (No subject)

That looks like it would do, what are you having problems with exactly?
TheXploder




PostPosted: Sun Dec 11, 2005 7:08 pm   Post subject: (No subject)

shouldn't it be '-4'?
code:

if filename (* -4 .. *) not= ".bmp" then
   filename := filename + ".bmp"
end if


p.s. yay paint I did that for my final project in gr.10
we64




PostPosted: Sun Dec 11, 2005 7:16 pm   Post subject: (No subject)

yeah, TheXploder had one of the best paint program around in Turing. Ask him for advice.
Paul




PostPosted: Sun Dec 11, 2005 8:15 pm   Post subject: (No subject)

TheXploder wrote:
shouldn't it be '-4'?
code:

if filename (* -4 .. *) not= ".bmp" then
   filename := filename + ".bmp"
end if


p.s. yay paint I did that for my final project in gr.10


... no
say the string is "paulbian", "n" would be the 8th letter of the string, getting the last 4 would be *-3, because 8-3=5, and 5..8 is "bian", 4 letters.
Paul




PostPosted: Sun Dec 11, 2005 9:03 pm   Post subject: (No subject)

Here's something I put together:
code:

%Saving picture

setscreen ("graphics: 300; 300")

var FileName : string := ""

Draw.Oval (maxx div 2, maxy div 2, 50, 50, brightred)
var PicID := Pic.New (0, 0, maxx, maxy)

cls
put "File name: " ..
get FileName : *

if length (FileName) >= 4 then

    if FileName (* -3 .. *) not= ".bmp" then
        FileName += ".bmp"
    end if

else
    FileName += ".bmp"

end if

Pic.Save (PicID, FileName)



Hope it helps.
abzoni




PostPosted: Tue Dec 13, 2005 11:03 am   Post subject: thx alot!:D

i finished my proj w/ your suggestions and ive been told im prolly gonna get perfect.

thx for all your help guys:D
Sponsor
Sponsor
Sponsor
sponsor
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 8 Posts ]
Jump to:   


Style:  
Search: