Author |
Message |
abzoni
|
Posted: 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! |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
do_pete
![](http://i38.photobucket.com/albums/e112/do_pete/1943.gif)
|
Posted: Sun Dec 11, 2005 12:27 pm Post subject: (No subject) |
|
|
this is the source code forum not the help forum |
|
|
|
|
![](images/spacer.gif) |
Paul
![](http://i12.photobucket.com/albums/a207/paulbian/DDRDuck.png)
|
Posted: Sun Dec 11, 2005 1:53 pm Post subject: (No subject) |
|
|
That looks like it would do, what are you having problems with exactly? |
|
|
|
|
![](images/spacer.gif) |
TheXploder
![](http://www22.brinkster.com/thexploder/chess.jpg)
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
we64
![](http://i5.photobucket.com/albums/y174/we64/LJDisplayPicture.jpg)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Paul
![](http://i12.photobucket.com/albums/a207/paulbian/DDRDuck.png)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
Paul
![](http://i12.photobucket.com/albums/a207/paulbian/DDRDuck.png)
|
Posted: 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. |
|
|
|
|
![](images/spacer.gif) |
abzoni
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
|