Say:
var/icon/I = input("Get the icon") as icon|null |
You can get the name of the file by just using << "[I]" and using length gives you the length of file. name also isn't a varible.
Thanks for the help in advance.
ID:169875
Apr 18 2005, 9:03 pm
|
||
Something that has stumped me for a while, how do you get the length of a filename if you pull it in as an icon.
Say:
You can get the name of the file by just using << "[I]" and using length gives you the length of file. name also isn't a varible. Thanks for the help in advance. | ||
Thanks, I'll try it when I get home and post an update.
Heh, nope.
(makes sense) from
| |||
Yota wrote:
OK, I havn't tested this or anything, but try... But he was asking about an icon file, not an /icon datum. As it is, /icon.icon will not give you a file length because it's an internal structure. However, if the icon was selected as a file, length(iconfile) should work. If not, then try length(file("[iconfile]")), which should convert everything to the proper format. Lummox JR | ||
I tried those ways and ended up getting the size of the data. I think I didn't say what I needed clearly enough, sorry.
If someone selects a file called "Guy.dmi" I want it to show the length of the file name, being 7. | |
Here is your code. this will let you pick the file on your computer and then tell you the size of it in bytes. | ||
#10 Apr 19 2005, 8:13 pm
|
|
Doing length("[I]") should work.
| |
ok so your wanting the length of the name right? not the file size
| |
SSJ2GohanDBGT wrote:
I tried those ways and ended up getting the size of the data. I think I didn't say what I needed clearly enough, sorry. Oh yeah, that's easy.
Note this will only work for an actual file, not an /icon. Lummox JR | ||
/icon happens to have an 'icon' variable.