forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Variable Counter - Freeware VDS extension-tool
Goto page 1, 2, 3, 4  Next
 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Other Product Support/Announcements
View previous topic :: View next topic  
Author Message
Estas
Contributor
Contributor


Joined: 31 Jan 2004
Posts: 66
Location: Germany

PostPosted: Mon Apr 24, 2006 3:04 pm    Post subject: Variable Counter - Freeware VDS extension-tool Reply with quote

Hi folks,
I have just finished a small freeware utility, that automatically finds and lists all variables used in a vds source file, showing their position (line no) and how many times they are being used. Meant for larger projects, especially when approaching the 220 variable limit in order to reduce the amount of variables used and to keep track where they are located in your script.
Feel free to test it and comment on this tool.
Email: mdoran65@gmx.net

Greetings Mike

Download:
http://www.vdsworld.com/search.php?view_mode=fileinfo&file_id=480&sid=74017b32787c635c11008f62216ee1ce

_________________
Greetings to all the folks back home in the States. A friendly "hola -como estas" to all my friends from Spain and Greece.


Last edited by Estas on Tue May 02, 2006 10:43 am; edited 21 times in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Mon Apr 24, 2006 3:50 pm    Post subject: Reply with quote

Working pretty cool Smile Maybe you can add something that if I put your tool in my "Visual Dialogscript\Tools" directory and use the Tools menu from VDS, the code will automatically start processing the currently open file... Smile You might be able to do this by looking if the %1 variable is specified Smile

Btw. I couldn't seem to open your attached ZIP file with Winzip, although it did work using WinRar

_________________
[ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial!
Back to top
View user's profile Send private message
Estas
Contributor
Contributor


Joined: 31 Jan 2004
Posts: 66
Location: Germany

PostPosted: Mon Apr 24, 2006 4:23 pm    Post subject: Reply with quote

Yes, the zip-file has been created using WinRar!
I hope though it works for most of you...

_________________
Greetings to all the folks back home in the States. A friendly "hola -como estas" to all my friends from Spain and Greece.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Mon Apr 24, 2006 5:57 pm    Post subject: Reply with quote

Thanks Mike this would be useful on larger projects. I did find a minor parsing issue with your tool causing some variables to be listed with extraneous text appended onto their names for example (%Asometext). I assume you're parsing each line of the script's text with "@pos(@chr(37),%%Line)" and grabbing the sub-string from that position to the next @chr(32) or @cr() as the variable name. So if the var is embedded within a string with out spaces a portion of the string gets returned as the var name. This could be corrected for local vars by checking the next chr after the pos and if it's not "%" you would just grab the next chr as the var name.
Back to top
View user's profile Send private message Send e-mail
Estas
Contributor
Contributor


Joined: 31 Jan 2004
Posts: 66
Location: Germany

PostPosted: Tue Apr 25, 2006 8:33 am    Post subject: Variable Counter - Update V 1.0.0l Reply with quote

I just uploaded the new version 1.0.0.58. It should now work as intended.
I merely overlooked the fact that there is a possibility of declaring or using variables in such a way eg. (%Axxxxxxxxxx).
Improvements:
-You can now save the results to your harddisk.
-Jump directly to a specific variable by dblclicking on it.

_________________
Greetings to all the folks back home in the States. A friendly "hola -como estas" to all my friends from Spain and Greece.


Last edited by Estas on Wed Apr 26, 2006 3:11 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
WidgetCoder
Contributor
Contributor


Joined: 28 May 2002
Posts: 126
Location: CO, USA

PostPosted: Tue Apr 25, 2006 4:48 pm    Post subject: Reply with quote

The updated version works great Exclamation I know I'll be using it quite often, Thank you for sharing this little gem with us. Cool
Back to top
View user's profile Send private message Send e-mail
Aslan
Valued Contributor
Valued Contributor


Joined: 31 May 2001
Posts: 589
Location: Memphis, TN USA

PostPosted: Tue Apr 25, 2006 9:53 pm    Post subject: Reply with quote

Nice piece of work Smile

Something to consider fixing though. It seems to accept "<" and ">" as valid variable characters.

eg.

%%variable<html_tag> shows up as %%variable<html_tag>

%%variable</html_tag> shows up as %%variable<

This means that %%variable is counted as 3 different variables


just a thought Wink
Back to top
View user's profile Send private message Send e-mail
Estas
Contributor
Contributor


Joined: 31 Jan 2004
Posts: 66
Location: Germany

PostPosted: Tue Apr 25, 2006 10:12 pm    Post subject: Reply with quote

Your right - this will be fixed by tomorrow...
Thanks for the reply.

Uploaded V 1.0.0.84 - Go for it. Very Happy

New: it will now automatically start processing the currently open file!

_________________
Greetings to all the folks back home in the States. A friendly "hola -como estas" to all my friends from Spain and Greece.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Estas
Contributor
Contributor


Joined: 31 Jan 2004
Posts: 66
Location: Germany

PostPosted: Fri Apr 28, 2006 12:16 pm    Post subject: Reply with quote

New Update available: Version 1.2.0.17
Added a couple of new features. You can now:
-able to read project-file (.dsp files)
-inspect an entire project which include multiple dsc-files.
-enhanced the code for faster source-code processing.
I hope you guys find it useful - a bief feedback message is appreciated.

_________________
Greetings to all the folks back home in the States. A friendly "hola -como estas" to all my friends from Spain and Greece.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Estas
Contributor
Contributor


Joined: 31 Jan 2004
Posts: 66
Location: Germany

PostPosted: Fri Apr 28, 2006 6:08 pm    Post subject: Reply with quote

For completeness sake: one more update...
New: Update available: Version 1.2.0.44

There was one thing I had disregarded in the previous versions:
That was to differentiate between GLOBAL and LOCAL variables.
Well, that's been included now as well...

_________________
Greetings to all the folks back home in the States. A friendly "hola -como estas" to all my friends from Spain and Greece.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Fri Apr 28, 2006 10:14 pm    Post subject: Reply with quote

Thanks for a useful utility Estas. Very Happy

I ran it through my largest project and it picked up 287 variables and 253 global variables... this is due to a few errors in identifying variables.

I'll list the variable found, followed by the code snippet it was found in...

Var: %%CheckToppyConnection) Found: if @zero(%%CheckToppyConnection)

Var: %%CheckToppyConnection = Found: %%CheckToppyConnection = %%false

Var: %%CheckToppyConnection = @iniread(Options,CheckToppyConnection, 1) Found: %%CheckToppyConnection = @iniread(Options,CheckToppyConnection, 1)

Var: %%RecParamOverrideVals,1,3) Found: dialog set, STARTSPIN, @substr(%%RecParamOverrideVals,1,3)

Var: %%FindText' Found: info Cannot find '%%FindText'

Var: %%TimerConflictDetection,@not( Found: if @both(%%TimerConflictDetection,@not(%%AllTimersRejected))

Var: %^ Found: This was found in a long string used as a replacement test

I think that covers most of the error types. If you are able to fix these I'll run it through again and report back the results.

Cheers.

_________________
John Trappett
Back to top
View user's profile Send private message
Estas
Contributor
Contributor


Joined: 31 Jan 2004
Posts: 66
Location: Germany

PostPosted: Sat Apr 29, 2006 6:13 pm    Post subject: Reply with quote

Problem fixed - hopefully
New: Update available: Version 1.2.0.47


Thanks for the report.

_________________
Greetings to all the folks back home in the States. A friendly "hola -como estas" to all my friends from Spain and Greece.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
DaveR
Valued Contributor
Valued Contributor


Joined: 03 Sep 2005
Posts: 413
Location: Australia

PostPosted: Sun Apr 30, 2006 4:34 am    Post subject: Reply with quote

Very nice, Mike. No problems here.
_________________
cheers

Dave
Back to top
View user's profile Send private message
trapper
Contributor
Contributor


Joined: 28 Jan 2005
Posts: 112
Location: Brisbane, Australia

PostPosted: Sun Apr 30, 2006 5:28 am    Post subject: Reply with quote

Thanks for the fix. Very Happy

I didn't get any erroneous entries this time, however, the report is a little baffling:

Total number of variables: 254
Global Variables used: 222

I thought VDS only had a maximum of 220 global (user-defined) variables.

Cheers...

_________________
John Trappett
Back to top
View user's profile Send private message
Estas
Contributor
Contributor


Joined: 31 Jan 2004
Posts: 66
Location: Germany

PostPosted: Sun Apr 30, 2006 5:59 am    Post subject: Reply with quote

That's right - according to VDS.
I once tried to see what happens if I used more than the recommended 220 variables. I tested it with a script that was close to the limit and added some unneeded variable names. It added up to 240 user defined variables and the script still compiled - and worked.
It probably also depends on what content you assign to the variables or how many variables are needed at a specific time. The application might crash if too many variables are used at runtime.
It might be worth a test to create a script and see where exactly the limit is and what VDS does in this case.

_________________
Greetings to all the folks back home in the States. A friendly "hola -como estas" to all my friends from Spain and Greece.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> Other Product Support/Announcements All times are GMT
Goto page 1, 2, 3, 4  Next
Page 1 of 4

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group