Solved

convert Javascript to VB 6

Posted on 2014-01-13
5
230 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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks

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

Author Closing Comment

by:mani_sai
Comment Utility
Thanks
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

This is an explanation of a simple data model to help parse a JSON feed
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

11 Experts available now in Live!

Get 1:1 Help Now