Solved

convert Javascript to VB 6

Posted on 2014-01-13
5
231 Views
Last Modified: 2014-01-14
I want to convert below Java script expression to VB 6.0:

return lead + "." +  dec + "E" +  logX;


(lead = 86
dec = 3799
logx = 3)



I want equivalent in VB 6.0 ?



Thanks
0
Comment
Question by:mani_sai
  • 3
  • 2
5 Comments
 
LVL 12

Expert Comment

by:HugoHiasl
ID: 39777691
The expression would be

CStr(lead) &  "." & CStr(dec) & "E" & CStr(logX)


If it is with in a function then you need to assign this value to the name of the function

function test  as string
  test  = CStr(lead) &  "." & CStr(dec) & "E" & CStr(logX)
end function
0
 
LVL 8

Author Comment

by:mani_sai
ID: 39777696
Thanks

My function is returning back as double...  Can we convert the output to double?
0
 
LVL 12

Accepted Solution

by:
HugoHiasl earned 500 total points
ID: 39777977
I assume it is a geographical information. Then it is wrong built.

86.3799 would be a valid value...

86.3799E3 would convert to 86379.9  as double. This is not a valid value

DIM myString
DIM myValue as Double

myString = CStr(lead) & "." & CStr(dec)

myValue = CDbl(myString)
myValue = myValue * (10^logX)

Now myValue should have a valid value. EXXX in a scientfic notation is doing nothing else than shifting the decimal point.
0
 
LVL 8

Author Comment

by:mani_sai
ID: 39777990
Thanks

We are calculating density/ viscosity etc...
0
 
LVL 8

Author Closing Comment

by:mani_sai
ID: 39780696
Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
initialise the object angular2 4 30
Need to click button twice to get results 2 32
VB6 ListBox Question 4 29
How can I echo a PHP variable in AJAX function? 7 25
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
This article discusses how to create an extensible mechanism for linked drop downs.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …

947 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now