Author |
Message |
[Gandalf]
|
Posted: Sun May 22, 2005 9:22 pm Post subject: Picture Loaded in Condition Statement? |
|
|
I didn't know how else to state this problem.
How you check if there is a certain picture loaded in an if statement. For example, what I tried, which obviously didn't work is:
code: |
var pic := Pic.FileNew ("pic.bmp")
if pic := Pic.FileNew ("pic.bmp") then
put "this picture is loaded"
else
put "there is no picture loaded"
end if
|
Do I have to make some boolean condition true when the pic is loaded, and then check for that? It seems like too much hastle... |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Delos
|
Posted: Sun May 22, 2005 9:39 pm Post subject: (No subject) |
|
|
Check the Error.Last and Error.LastMsg things. They return values after Pic.New is called, so you can use them to determine whether or not the pic has loaded. |
|
|
|
|
|
[Gandalf]
|
Posted: Sun May 22, 2005 9:51 pm Post subject: (No subject) |
|
|
Hmm, can you explain this a bit more? How do you use Error.Last and Error.LastMsg? If I add what I posted previously, the program doesn't even compile... |
|
|
|
|
|
Bacchus
|
Posted: Sun May 22, 2005 10:51 pm Post subject: (No subject) |
|
|
just check to see if the var = 0, if it does then the pic wasnt created |
|
|
|
|
|
MysticVegeta
|
Posted: Sun May 22, 2005 10:55 pm Post subject: (No subject) |
|
|
unsuccessful pic open error is error # 201 |
|
|
|
|
|
zylum
|
Posted: Mon May 23, 2005 12:25 am Post subject: (No subject) |
|
|
code: | var pic := Pic.FileNew ("pic.bmp")
if Error.Last not= 0 then
put "this picture is loaded"
else
put "there is no picture loaded"
end if |
|
|
|
|
|
|
Cervantes
|
Posted: Mon May 23, 2005 8:01 am Post subject: (No subject) |
|
|
Heh, you've got it backwards, zylum. Error.Last returns zero if there is no error.
|
|
|
|
|
|
MysticVegeta
|
Posted: Mon May 23, 2005 9:28 am Post subject: (No subject) |
|
|
Gandalf do you mean if the pic is already open? or the importing file error? |
|
|
|
|
|
Sponsor Sponsor
|
|
|
zylum
|
Posted: Mon May 23, 2005 9:44 pm Post subject: (No subject) |
|
|
Cervantes wrote: Heh, you've got it backwards, zylum. Error.Last returns zero if there is no error.
yup, you're right |
|
|
|
|
|
[Gandalf]
|
Posted: Tue May 24, 2005 10:55 pm Post subject: (No subject) |
|
|
Thanks for all that, I was looking for something else, but this helps too.
I found a simple way of doing what I wanted, I was just doing things the wrong, redundant way... Thanks for all the help. |
|
|
|
|
|
|