Book a Demo

Author Topic: scripting  (Read 3859 times)

george75

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
scripting
« on: December 15, 2010, 05:25:33 am »
Hello,
I want to write vbscript for the EA-Project Browser.
All works perfect, but when I want to declare a static variable or a normal variable(e.g. dim x as integer) or just an function (e.g. fuction xxx() as boolean .....) an error occurrs.
What I'm doing wrong

thanks

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: scripting
« Reply #1 on: December 15, 2010, 08:55:26 am »
Hi George,

It's hard to get a picture of what's going wrong from the description you have provided.

1. What error message are you getting?
2. Are you using the default Project Browser script template?
3. Would it be possible to send a copy of the script to sparx support so that we can try and debug it ourselves.
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: scripting
« Reply #2 on: December 16, 2010, 05:10:40 pm »
George,

I'm in no way a specialist, but isn't vbscript weakly typed?
If I'm correct that would mean that you have to declare variables and functions without a type.
So iso
Code: [Select]
Dim myVariable as integer you type
Code: [Select]
Dim myVariable
Geert

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: scripting
« Reply #3 on: December 17, 2010, 11:17:41 am »
EA allows Dim ... as when using EA types, for example

Code: [Select]
Dim MyElement as EA.ElementThis allows you to use intellisense in the editor. However trying the same thing with a non-EA type will cause an error, for the reason that Geert gave.
« Last Edit: December 17, 2010, 12:40:23 pm by KP »
The Sparx Team
[email protected]