Solved

convert Javascript to VB 6

Posted on 2014-01-13
5
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
Part One of the two-part Q&A series with MalwareTech.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
Suggested Courses

626 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