Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Engr  
#1 Posted : 21 July 2021 17:52:42(UTC)
Engr


Rank: Member

Groups: Registered
Joined: 10/08/2011(UTC)
Posts: 24
Location: Missouri

Was thanked: 6 time(s) in 4 post(s)
I have a previous VB subroutine (with a iterative mathematical calculation) which I would like to put into a plug-in for use with SMath Studio. I have started with the VB.net plug-in template and have a function started which passes the starting values from a smath worksheet to the plug-in. I have gotten so far as the values from the worksheet are transfered to the plug-in as TNumber objects. I need to convert the values from TNumber to Single or Double VB numbers to pass them to the subroutine (the subroutine uses single and doubles in the calculations). Is there a way to convert between TNumber and Single or double and then back again in VB code?

Thanks,
Engr
Offline uni  
#2 Posted : 21 July 2021 20:41:03(UTC)
uni


Rank: Advanced Member

Groups: Registered, Advanced Member
Joined: 10/11/2010(UTC)
Posts: 1,174
Man
Russian Federation

Was thanked: 1010 time(s) in 586 post(s)
I recommend making a copy of the repository on a local disk and then looking for code examples in it.

Also, right in the program there is a user's guide (or Core documentation).

2021-07-21_22-21-05.png

[TNumber].obj.ToDouble() - convert to double

New TNumber( double, double ) or CType( double, TNumber ) - for back operation, but I'm not sure how it will look in basic. There is an implicit conversion operator.

2021-07-21_22-40-34.png

2021-07-21_22-41-58.png

Edited by user 21 July 2021 20:45:44(UTC)  | Reason: Not specified

Russia ☭ forever
Viacheslav N. Mezentsev
💰 Support me for plugins development: https://yoomoney.ru/to/410013245578758
thanks 1 user thanked uni for this useful post.
on 27/07/2021(UTC)
Offline Engr  
#3 Posted : 27 July 2021 17:04:22(UTC)
Engr


Rank: Member

Groups: Registered
Joined: 10/08/2011(UTC)
Posts: 24
Location: Missouri

Was thanked: 6 time(s) in 4 post(s)
Uni,

Thanks for the reply and the tips for finding information.

I hope you can help with one more item I am struggling with. I am able to return a double with the solution from my calculation subroutine back to the SMath worksheet with the following:

Dim force as Double

result = New Entry( force )

However I would like to return four values to SMath instead of just one. Is it possible to have a single function in a plug-in return a 4x1 matrix to SMath?

I appreciate the assistance.

Engr
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.