| View previous topic :: View next topic |
| Author |
Message |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Nov 26, 2004 12:28 am Post subject: Is @EXT() dependible, or is there another solution in v502? |
|
|
Hi,
The below searches for some folders and files with long names.
In the EXAMPLE below, in the INFO @EXT(14) shows BLANK(nothing).
But the @item(14) show the file with the EXTENSION ???
| Code: | %%ext_length = @LEN(@EXT(14))
IF @ZERO(%%ext_length)
info @item(14)@CR()@CR()Here is the EXTENSION":" @EXT(14)@CR()@CR()@item(14)
wait "0.5"
END |
Any Ideas? (or maybe I have a syntax error?) |
|
| Back to top |
|
 |
Dr. Dread Professional Member


Joined: 03 Aug 2001 Posts: 1065 Location: Copenhagen, Denmark
|
Posted: Fri Nov 26, 2004 12:35 am Post subject: |
|
|
Yeah syntax is it. Try @ext(@item(14))
Greetz
Dr. Dread _________________ ~~ Alcohol and calculus don't mix... Don't drink and derive! ~~
String.DLL * advanced string processing |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Nov 26, 2004 2:13 am Post subject: |
|
|
Thanks Dread for spoting my typo.
But now it didnt help other problem, please copy/paste below and try it, it gives false reading on the first item that pops up...
| Code: |
LIST CREATE, 1
LIST CREATE, 2
LIST CREATE, 3
List loadtext,1
"C:\zzz\zzz\this & that - etc\aaa info and INFO - blaa blaa
"C:\zzz\zz MakeWDG backup\zzzz 1.7 - Strong\Directmodem\hhd udu dud d io2 w oow wok jjd d may28.wdg
"C:\zzz\zz MakeWDG backup\zzzz 1.7 - Strong\Directmodem\jhfidu hfiodsf jijd f ppek fpeN ewMaps.wdg
%%amount = "30"
REPEAT
%%just_name_lengh = @NAME(@item(1))
%%length_just_name = @LEN(%%just_name_lengh)
IF @greater(%%length_just_name,%%amount)
Info JUST NAME "=" @NAME(@item(1))@CR()@CR()@item(1)
%%path_only = @PATH(@item(1))
%%name_only = @NAME(@item(1))
%%ext_only = @EXT(@item(1))
%%ext_only_plus_period = @CHR(46)""%%ext_only
%%full_filename = %%name_only""%%ext_only_plus_period
LIST APPEND,2,%%full_filename
LIST APPEND,3,%%path_only
IF @NOT(@equal(@item(1), ))
LIST delete,1
END
END
UNTIL @equal(@count(1),0)
:close
LIST CLOSE, 1
LIST CLOSE, 2
LIST CLOSE, 3
EXIT
|
|
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Nov 26, 2004 2:54 am Post subject: |
|
|
I noticed also that when I paste in the forum above, that it added an un-wanted ' ;amp;amp ' which probably wont effect the testing, just remove that part if in doubt.
And I'm wondering what did that also, I've ran McAfee and spyware programs, do you think I need to re-install my Windows XP Pro maybe? |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Fri Nov 26, 2004 3:19 am Post subject: |
|
|
Well, to simplify things, let's go back to the basic functions
| Code: | LIST CREATE, 1
LIST CREATE, 2
LIST CREATE, 3
List loadtext,1
"C:\zzz\zzz\this & that - etc\aaa info and INFO - blaa blaa
"C:\zzz\zz MakeWDG backup\zzzz 1.7 - Strong\Directmodem\hhd udu dud d io2 w oow wok jjd d may28.wdg
"C:\zzz\zz MakeWDG backup\zzzz 1.7 - Strong\Directmodem\jhfidu hfiodsf jijd f ppek fpeN ewMaps.wdg
INFO RAW ENTRY: @item(1,0)@cr()PATH ONLY: @path(@item(1,0))@cr()NAME ONLY: @name(@item(1,0))@cr()EXT ONLY: @ext(@item(1,0))
INFO RAW ENTRY: @item(1,1)@cr()PATH ONLY: @path(@item(1,1))@cr()NAME ONLY: @name(@item(1,1))@cr()EXT ONLY: @ext(@item(1,1))
INFO RAW ENTRY: @item(1,2)@cr()PATH ONLY: @path(@item(1,2))@cr()NAME ONLY: @name(@item(1,2))@cr()EXT ONLY: @ext(@item(1,2))
:close
LIST CLOSE, 1
LIST CLOSE, 2
LIST CLOSE, 3
EXIT |
Using the above code works just fine. _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Nov 26, 2004 4:09 am Post subject: |
|
|
Thanks Garrett,
I actually never used the 'LIST LOADTEXT' , I just put it here at the forum for easy illistration of my problem, but my program actaully loads the @items into the LIST(s) on the fly, are you saying your methoth will work with the below somehow, I've allways been lucky I guess, because I never used the 2nd number in the @item(1,?). lol
I just thought that was for cells - etc..
I need the below to somehow read as good as your INFO's did:
| Code: |
REPEAT
%%just_name_lengh = @NAME(@item(1))
%%length_just_name = @LEN(%%just_name_lengh)
IF @greater(%%length_just_name,%%amount)
Info JUST NAME "=" @NAME(@item(1))@CR()@CR()@item(1)
%%path_only = @PATH(@item(1))
%%name_only = @NAME(@item(1))
%%ext_only = @EXT(@item(1))
%%ext_only_plus_period = @CHR(46)""%%ext_only
%%full_filename = %%name_only""%%ext_only_plus_period
LIST APPEND,2,%%full_filename
LIST APPEND,3,%%path_only
IF @NOT(@equal(@item(1), ))
LIST delete,1
END
END
|
I guess I really only want the data to be placed into 2 different LIST somehow on the fly (and be dependible like your INFO's)
So your saying to use the same type of format? |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Fri Nov 26, 2004 8:02 am Post subject: |
|
|
Sorry I dont jibberjabber good, but below is what I was wanting(least it what I got right now to use).
I was wanting to weed out the detections that had no file.extensions, below detects them so I can delete them from my new LIST.
I just wanted file names with extensions...
| Code: |
LIST CREATE, 1
List loadtext,1
"C:\zzz\zzz\this & that - etc\aaa info and INFO - blaa blaa
"C:\zzz\zz MakeWDG backup\zzzz 1.7 - Strong\Directmodem\hhd udu dud d io2 w oow wok jjd d may28.wdg
"C:\zzz\zz MakeWDG backup\zzzz 1.7 - Strong\Directmodem\jhfidu hfiodsf jijd f ppek fpeN ewMaps.wdg
REPEAT
IF @equal(@EXT(@ITEM(1)), ,EXACT)
info Bingo!@CR()@CR()@item(1)
END
LIST delete,1
UNTIL @equal(@count(1),0)
:close
LIST CLOSE, 1
EXIT
|
The above seems to do it, but this is just a work around, if you have a more trusty idea, please tell, thanks a bunch... I appreciate highly |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Fri Nov 26, 2004 8:13 pm Post subject: |
|
|
I only removed the looping code to get to the simple side of this to see if
you could use a different aspect on getting the info out of this. Using
@path(), @name() and @ext() seem to work fine on the example strings
you provided.
If the problem was in trying to sort out the path, name and extension, then
maybe try a different approach to the loop you had going. I didn't fully
follow it to see what was up, but it sure seemed like a lot of code for
something simple.
-Garrett _________________ 'What you do not want done to yourself, do not do to others.' - Confucius (550 b.c. to 479 b.c.) |
|
| Back to top |
|
 |
vtol Valued Contributor


Joined: 05 Feb 2004 Posts: 656 Location: Eastern Indiana
|
Posted: Wed Dec 01, 2004 1:33 am Post subject: |
|
|
Well, I seem to allways not be able to do what I want to do with VDS5, maybe I'm trying to make it do more than expected out of it.
Most the time, all the @EXT @NAME @PATH etc works perfect, till I allmost get my program done, then it all falls apart(EXAMPLE: IF @unequal(%%detect_extension_period,@CHR(46)) periods are seen as 0 <zeros> and @EXT dont see anything, @PATH only gets about half the PATH etc etc etc lol) And I work and work till its all right, and decide to trash it all and start over with a less complex way(which makes me feel cheated - lol)
Oh well, I'm not really complaing that VDS5 is not good or cheap, its just I think I need something bigger maybe...
Thanks for the help - I got this project done ok. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|