Le 21 mars 07 à 19:52 Soir, Dan Nafe a écrit:

>      if i < 10 then
>        szFileName = "image00" + str(i) + ".jpg"
>        szImageName = "image00" + str(i)
>      else
>        szFileName = "image0" + str(i)+  ".jpg"
>        szImageName = "image0" + str(i)
>      end if
>      picFile =TemporaryFolder.TrueChild(szFileName)

I would like, if you allow me, to comment (simplify) this code.

First, the documentation says that "SaveAsJPEG" automatically appends  
".jpeg" to the name. So, you should not append ".jpg" to szFileName  
(well, it feels strange that RB modifies itself the parameter of the  
file name).

So, szFileName and szImageName should be the same (since, if you  
remove ".jpg" in szFileName, you get szImageName). Then, use only one  
of them.

Also, rather than an "if i<10 then" block, you may simplify all the  
code abode like that:

szFileName="image"+right("000"+str(i),3) 'As I said, the ".jpeg"  
extension is added by "SaveAsPicture"
picFile =TemporaryFolder.TrueChild(szFileName).

HTH
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>

Reply via email to