SMath Studio Forum
»
SMath Studio
»
Questions
»
Convert TNumber in VB .net plug-in
Rank: Member Groups: Registered
Joined: 10/08/2011(UTC) Posts: 24 Location: Missouri
Was thanked: 8 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
|
|
|
|
Rank: Advanced Member Groups: Registered, Advanced Member Joined: 10/11/2010(UTC) Posts: 1,494 Was thanked: 1274 time(s) in 745 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). [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. Edited by user 21 July 2021 20:45:44(UTC)
| Reason: Not specified |
Russia ☭ forever Viacheslav N. Mezentsev |
1 user thanked uni for this useful post.
|
|
|
Rank: Member Groups: Registered
Joined: 10/08/2011(UTC) Posts: 24 Location: Missouri
Was thanked: 8 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
|
|
|
|
SMath Studio Forum
»
SMath Studio
»
Questions
»
Convert TNumber in VB .net plug-in
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.