Page 2 of 2

PostPosted: Sat Oct 27, 2007 9:44 am
by Gaev
One extra line of code. No bloat.
In case there was a misunderstanding ... I agree with you ... I vote for using one extra script command instead of asking Dave for yet another command (which eventually would contribute to .exe bloat for every .exe by every developer)

PostPosted: Sat Oct 27, 2007 3:04 pm
by Wrangler
Nope. No misunderstanding. Posted it to back up your opinion.

PostPosted: Mon Oct 29, 2007 6:06 am
by Leos
what about this?:

SetVar "[file]" ""
ExtractFileName "[file]" "[fileName]"
.to extract the filename AND extension
StrParse "[fileName]" "." "[filearray]" "[numparsed]"

PostPosted: Mon Oct 29, 2007 6:43 am
by Gaev
what about this?:

SetVar "[file]" ""
... I would do it like this ...
Code: Select all
ExtractFileExt "[file]" "[FileExt]"
If "[FileExt]" "=" ""
   ExtractFileName "[file]" "[FileNameOnly]"
   ExtractFileName "[file]" "[FilePlusExt]"
   StrLen "[FilePlusExt]" "[FilePlusExtLen]"
   StrLen "[FileExt]" "[FileExtLen]"
   StrDel "[FilePlusExt]" "1+[FilePlusExtLen]-[FileExtLen]" "[FileExtLen]" "[FileNameOnly]"
... covers file names like ...

- abc (no extension)
- abc.jpg (regular stuff)
- abc.def.jpg (dots in filename part)
- abc.jpg.jpg (parts of name same as extension)

... of course I would place above code in the NeoBook Function folder and use it like this ...
Code: Select all
Call "gkExtractFileNameOnly" "[file]" "[FileNameOnly]"
... build once, deploy a gazillion times after that.

PostPosted: Mon Oct 29, 2007 8:18 am
by Leos
Hi, Gaev

nice exercise. However my first intention wasn't to solve it (i apreciate your help), but just to show that a simple command can simplify our life (neobook users).

You know, I agree with you almost in 90% from your's point of view.
How much more commands, more 'lacks' or problems... but i think so that if we have not nothing (any commands), we got Zero problems :D , but we have nothing!

So, I agree that we must have priority in our wish list (who must designate this prioritys, I don't know, maybe 50% to Daves's 50% to neobook users), and this mine wish, obviously is not at the top...

... LOL ... I am not part of the NeoBook team ... just an enthusiastic user of this great application development product.

At this point i can not to agree with you.
You know: all of us, we are the team! (Neobook users and specially neobook forum users; we are not so many, but it is a pleasure to me to participate in this community)...
... but, and i think that in this point I have many others that agree with me, when i ask here for help, i know that i have four entity that are allways ready to help:

- Neosoft support,
- Gaev
- HPW (Hans)
- the users (almost the same)
- Sam Cox (what about him?)

- I'm sorry if i don't do mention no more guys in individual, but there are a lot of them that i aprecitte very mutch.

Wrangler: i appreciate to your intervention.

So... my wish list is just a wish list (the priority i don't know)

and... long life to Neobook! 8)

PostPosted: Mon Oct 29, 2007 11:35 am
by Neosoft Support

You can use the existing ChangeFileExt action to remove the extension from a file name. Just leave the "new ext" parameter blank. For example:

ChangeFileExt "[FileName]" "" "[FileName]"

...when you begin to write extr you press one key (for example space key) and you can choose from the existing commands (in this case, ExtractFileName, ExtractFileExt, ExtractFileNameNoExt and you can select one, and the editor complete the rest: ExtractFileName)

Good idea! I will make sure that this is added to "the list". If added it will be an option that can be turned off.

PostPosted: Tue Oct 30, 2007 9:21 am
by Leos
Nice tip Neosoft!

Thank you very mutch.