vba eval broken?.

vba eval broken?.

Anonymous
Not applicable
913 Views
6 Replies
Message 1 of 7

vba eval broken?.

Anonymous
Not applicable
Hello, I have stumbled on a problem. If you try to use eval to call user defined subs autocad will generate an error.
Example:

Public Sub TestEval1()
Eval "MsgBox ""This works"""
End Sub

but

Public Sub TestEval2()
Eval "ShowMsgBox ""Doesnt work."""
End Sub

Public Sub ShowMsgBox(msg As String)
MsgBox msg
End Sub

Calling user defined funktions with eval worked in ver 2002 but doesnt work since atleast ver 2005.

Have anyone noticed this problem before?.

/Rikard
0 Likes
914 Views
6 Replies
Replies (6)
Message 2 of 7

Anonymous
Not applicable
seems as though it was broken in 2002 and they fixed it in a later version.

the whole point of using eval is so you don't have to create subs, funs,
etc.


wrote in message news:5221155@discussion.autodesk.com...
Hello, I have stumbled on a problem. If you try to use eval to call user
defined subs autocad will generate an error.
Example:

Public Sub TestEval1()
Eval "MsgBox ""This works"""
End Sub

but

Public Sub TestEval2()
Eval "ShowMsgBox ""Doesnt work."""
End Sub

Public Sub ShowMsgBox(msg As String)
MsgBox msg
End Sub

Calling user defined funktions with eval worked in ver 2002 but doesnt work
since atleast ver 2005.

Have anyone noticed this problem before?.

/Rikard
0 Likes
Message 3 of 7

Anonymous
Not applicable
But this makes no sense. Now there is no possibility to run subs in other dvbs with inparameters. This must be faulty behaivour.. Or is there another way to call a function in another dvb with input parameters? (And dont say sending it as commandline because thats is reallly not a good way..) I mean if you can evaluate a function like msgbox with input parameters, why cant you evaluate another function.. ?

/Rikard
0 Likes
Message 4 of 7

Anonymous
Not applicable
Your examples worked for me in both 2000i and 2005. Any typo's on your end.

--
----
Ed
----
0 Likes
Message 5 of 7

Anonymous
Not applicable

parameters?
Add a reference to the project and call you function.

wrote in message news:5222232@discussion.autodesk.com...
But this makes no sense. Now there is no possibility to run subs in other
dvbs with inparameters. This must be faulty behaivour.. Or is there another
way to call a function in another dvb with input parameters? (And dont say
sending it as commandline because thats is reallly not a good way..) I mean
if you can evaluate a function like msgbox with input parameters, why cant
you evaluate another function.. ?

/Rikard
0 Likes
Message 6 of 7

arcticad
Advisor
Advisor
didn't work for me in 2005
---------------------------



(defun botsbuildbots() (botsbuildbots))
0 Likes
Message 7 of 7

Anonymous
Not applicable
Did I just get lucky?

--
----
Ed
----
0 Likes