Author Topic: VBScript string match doesn't match (!)  (Read 19097 times)

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: VBScript string match doesn't match (!)
« Reply #15 on: December 06, 2015, 03:20:44 pm »
Hi again,

THE MESS

I made a chart of the un-orthogonality of the EA TaggedValue types, and in the right-most column, the new consolidated names (as they are named in the (new) wrapper).

Existing (messy) Native Tag Properties :

Hint: Display the image separately to see it in full.


THE SOLUTION

The new wrapper class has the following (consistent) property names, and in the table far below, a bunch of new added and in some cases very useful properties. The properties with blue background are the ones that are most likely to be used ( The Value() property derives any defined Default values, so the other ones are rarely used although very useful when you need them):

Wrapper's Renamed Properties :



Wrapper's New Added Properties :



The orthogonality and convenience when using this wrapper is... priceless.

The Stats gives that if I read ALL these properties (of which some will derive its value via SQLQuery) one can read about 1000 (a thousand) per second (more exactly 1044).

And most important, it works. On all types of tagged values. The PITA is over-dun-with. :)

// Rolf
« Last Edit: December 06, 2015, 03:24:33 pm by Rolf_Lampa »
-- There's always a solution --

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12455
  • Karma: +507/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: VBScript string match doesn't match (!)
« Reply #16 on: December 06, 2015, 07:06:45 pm »
Hi Rolf,

U understand your pain. Back in the day when I first started with add-ins I came to the same conclusion and wrote my wrapper library in C# which I published on Github.
Because of environmental restrictions at some clients (Citrix) I'm using more and more scripting these days.

For some reason it never occurred to me that I could make classes in VBScript as well :-[, but now that I know that I see an excellent opportunity to make a VBScript library similar to my C# library.

I still need to think about the structure of it because of the lack of inheritance in VBScript, but I think there are workarounds for that as well.

Over the last couple of months I've gathered quite some vbscript code, and I've been thinking about a way to manage all that code. (scripts stored in EA model are not the easiest way to manage code)

I'll make a new github repository to store the code.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12455
  • Karma: +507/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: VBScript string match doesn't match (!)
« Reply #17 on: December 06, 2015, 08:53:36 pm »
I've made a new Github Repository and added most of my VBScripts to it.
Enterprise-Architect-VBScript-Library
Anyone interested in contributing to this repository can send an email to geert@bellekens.com

My next task will be to write a script that stores all of my scripts to a folder so I can easily check in changes.

Geert

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: VBScript string match doesn't match (!)
« Reply #18 on: December 06, 2015, 10:27:19 pm »
Quote
I've made a new Github Repository and added most of my VBScripts to it.
Enterprise-Architect-VBScript-Library
Anyone interested in contributing to this repository can send an email to geert@bellekens.com
Geert

That sounds interesting! I'll have a look at it. I'll be in touch.

// Rolf
-- There's always a solution --

qwerty

  • EA Guru
  • *****
  • Posts: 13222
  • Karma: +381/-299
  • I'm no guru at all
    • View Profile
Re: VBScript string match doesn't match (!)
« Reply #19 on: December 06, 2015, 11:26:41 pm »
Not that I'm keen starting VB programming once again, but there should be some kind of "use case related" structure in that repository. This way it's unlikely for others to hook on "Project K" or the like.

q.

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12455
  • Karma: +507/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: VBScript string match doesn't match (!)
« Reply #20 on: December 07, 2015, 01:57:24 am »
Project "K" and "A" are anonymized client names :), and they are there mainly for me so all of the scripts I've written for my various clients are stored at the same location.

The main useful part of this library should become the wrappers library. I'm already working on the Script and ScriptGroup class, :)

Geert

qwerty

  • EA Guru
  • *****
  • Posts: 13222
  • Karma: +381/-299
  • I'm no guru at all
    • View Profile
Re: VBScript string match doesn't match (!)
« Reply #21 on: December 07, 2015, 07:58:23 am »
I thought so. It's just that I think you should separate the common and the more private part in two repositories. It's likely not just me who might get confused by "K" and "A"  :)

q.
« Last Edit: December 07, 2015, 07:59:06 am by qwerty »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12455
  • Karma: +507/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: VBScript string match doesn't match (!)
« Reply #22 on: December 09, 2015, 07:11:28 am »
You have a point, but having two different repositories is not convenient for me.

I did however restructure the repository to make the distinction more obvious.

Geert

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: VBScript string match doesn't match (!)
« Reply #23 on: December 09, 2015, 07:28:04 am »
Quote
I did however restructure the repository to make the distinction more obvious.
Geert

I think the structure is very much OK with the latest chages. Except for one thing; Wrappers and Tools uses plural form, and in contrast the Util folder seems to have lost a "s" from its tail :)

// Rolf
-- There's always a solution --

qwerty

  • EA Guru
  • *****
  • Posts: 13222
  • Karma: +381/-299
  • I'm no guru at all
    • View Profile
Re: VBScript string match doesn't match (!)
« Reply #24 on: December 09, 2015, 08:33:11 am »
You did not include your VBS importer? Or did you drop that meanwhile?

q.

RIL

  • EA User
  • **
  • Posts: 142
  • Karma: +3/-0
  • -- There's always a solution --
    • View Profile
Re: VBScript string match doesn't match (!)
« Reply #25 on: December 09, 2015, 03:11:33 pm »
OK, now a new TaggedValue helper class (VBScript) is uploaded to Geert Bellekens Github repo in its own folder and presentation (and a link back to this thread, for some background info). Comments and suggestions are welcome, of course.

The wrapper derives default values for regular TaggedValues. It has not been tested on complex structured TV's. The script has no dependencies on other libraries, and it's free to use for anyone. Hope you guys will find it useful.

- Enjoy!

https://github.com/GeertBellekens/Enterprise-Architect-VBScript-Library/tree/master/Framework/Wrappers/TaggedValues

// Rolf Lampa
-- There's always a solution --

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12455
  • Karma: +507/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: VBScript string match doesn't match (!)
« Reply #26 on: December 09, 2015, 03:47:23 pm »
Quote
You did not include your VBS importer? Or did you drop that meanwhile?

q.

You mean the excel importer?
Well, that's a bit different. This library is meant for scripts that can be used in EA's internal script module.
And the Excel importer uses VBA, which is another language from VBScript although it uses pretty much the same syntax.

Geert

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 12455
  • Karma: +507/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: VBScript string match doesn't match (!)
« Reply #27 on: December 09, 2015, 03:50:11 pm »
Quote
. Except for one thing; Wrappers and Tools uses plural form, and in contrast the Util folder seems to have lost a "s" from its tail :)

// Rolf

Fixed :)

Geert