hallo...can i get some knowladge...about java script convert to V.B....how??like 'calculation downloadable',i've get a formula calculate but in java script....how i want convert this language to V.B
This is formula in java script:
<script language="JavaScript">
<!--
var gaji;
var cpekerja;
var cmajikan;
var semua;
var pilih;
function kira(form) {
pilih = form.pilihan.options[form.pilihan.selectedIndex].value;
gaji = form.gaji.value;
if (pilih == '' || gaji == '' || gaji == '0' || gaji == '0.00' || gaji == '0.0') {
alert('Please select year and your annual income for that year.'); } else { if (pilih == '1') {
cpekerja=5;
cmajikan=5;
form.cpekerja.value=cpekerja;
form.cmajikan.value=cmajikan;
} else if (pilih == '3') {
cpekerja=6;
cmajikan=7;
form.cpekerja.value=cpekerja;
form.cmajikan.value=cmajikan;
} else if (pilih == '4') {
cpekerja=9;
cmajikan=11;
form.cpekerja.value=cpekerja;
form.cmajikan.value=cmajikan;
} else if (pilih == '5') {
cpekerja=10;
cmajikan=12;
form.cpekerja.value=cpekerja;
form.cmajikan.value=cmajikan;
} else if (pilih=='6') {
cpekerja=11;
cmajikan=12;
form.cpekerja.value=cpekerja;
form.cmajikan.value=cmajikan;
} if (pilih=='7') {
cpekerja=9;
cmajikan=12;
form.cpekerja.value=cpekerja;
form.cmajikan.value=cmajikan;
}
cpekerja = (cpekerja*gaji)/100;
form.total.value = cpekerja
cmajikan = (cmajikan*gaji)/100;
form.total.value = cmajikan
cpekerja = eval(cpekerja);
cmajikan = eval(cmajikan);
semua = cpekerja + cmajikan;
form.total.value=Math.round(semua*100)/100;
}
}
//-->
</script>
4 1924
First, a question. I realise that I'm dealing with a somewhat unfamiliar language. But surely setting the same variable (or control) three times (as highlighted above) would not serve much purpose? And what is the significance of the missing semicolons on these lines?
Anyway, here's my first draft... -
Public Sub kira(frm As Form)
-
-
Dim gaji, cpekerja, cmajikan, semua, pilih
-
-
-
' Sorry, I don't know how to translate this line...
-
' pilih = frm.pilihan.options[form.pilihan.selectedIndex].value;
-
-
' This depends on the type of control. If it's a textbox for example, you'd want .Text rather than .value
-
gaji = frm.gaji.value
-
-
If pilih = "" or gaji = "" or gaji = "0" or gaji = "0.00' or gaji = "0.0" Then
-
MessageBox "Please select year and your annual income for that year."
-
Exit Sub
-
End If
-
-
Select case pilih
-
Case "1"
-
cpekerja = 5
-
cmajikan = 5
-
frm.cpekerja = cpekerja
-
frm.cmajikan = cmajikan
-
' How come there's no 2?
-
Case "3"
-
cpekerja = 6
-
cmajikan = 7
-
frm.cpekerja = cpekerja
-
frm.cmajikan = cmajikan
-
Case "4"
-
cpekerja = 9
-
cmajikan = 11
-
frm.cpekerja = cpekerja
-
frm.cmajikan = cmajikan
-
Case "5"
-
cpekerja = 10
-
cmajikan = 12
-
frm.cpekerja = cpekerja
-
frm.cmajikan = cmajikan
-
Case "6"
-
cpekerja = 11
-
cmajikan = 12
-
frm.cpekerja = cpekerja
-
frm.cmajikan = cmajikan
-
Case "7"
-
cpekerja = 9
-
cmajikan = 12
-
frm.cpekerja = cpekerja
-
frm.cmajikan = cmajikan
-
End Select
-
-
-
cpekerja = (cpekerja*gaji)/100;
-
frm.total = cpekerja
-
-
cmajikan = (cmajikan*gaji)/100;
-
frm.total = cmajikan
-
-
' cpekerja = eval(cpekerja); What does this do?
-
' cmajikan = eval(cmajikan); What does this do?
-
semua = cpekerja + cmajikan;
-
frm.total=(semua*100)/100
-
End Sub
Hi Killer,
It's Bahasa Melayu (Malay Language), i think he is a Malaysian. :)
It's Bahasa Melayu (Malay Language), i think he is a Malaysian. :)
Thanks sashi. But I was referring to the javascript.
... - ...
-
cpekerja = (cpekerja*gaji)/100;
-
...
-
cmajikan = (cmajikan*gaji)/100;
-
Sorry, I forgot to remove the semicolons from these two lines. VB probably won't like them.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Lamberti Fabrizio |
last post by:
Hi all.
I've got an ActiveX Object that gives me OleColor codes for its graphical
components.
I need to convert these OleColor codes into RGB codes using JScript or
VBScript, becuase I have...
|
by: rob.kellington at gmail |
last post by:
Does anyone have the logic to convert RTF formatted data in a text
column into plain ascii text that I can use in a varchar variable or
field?
We have an app that allows formatted comments/notes...
|
by: Kai Bohli |
last post by:
Hi all !
I need to translate a string to Ascii and return a string again. The code below dosen't work for
Ascii (Superset) codes above 127. Any help are greatly appreciated.
protected...
|
by: ABC |
last post by:
I have a very large amount VB code convert into C Sharp. I just complete it
use tools. But it still have some codes errors. There are object to
datatype problems. I need to edit many files to...
|
by: Charles Law |
last post by:
I thought this was going to be straight forward, given the wealth of
conversion functions in .NET, but it is proving more convoluted than
imagined.
Given the following
<code>
Dim ba(1) As...
|
by: Jonathan |
last post by:
Hi
I want to convert HTML codes ("!" , "#" , "$" , "%") to text
("!","#", "$", "%"). How can i do it without replacing one an one the codes?
Thanks in advance
|
by: prabhuvonnet |
last post by:
Hello all,
I need to convert this following vb.net codes to c# codes within a day or two.
So i need this help urgently.
Please look at the following code and help me out to finish this barcode...
|
by: setheo |
last post by:
To all gurus,
I am currently converting some of C++ codes to VB.net
The C++ Codes is as follows :
================= C++ CODE ==================
typedef struct _tagBBCameraParameter
{...
|
by: Poppy |
last post by:
I'm reading from a database a column that has a list of codes (comma
seperated). When I read in the list I have a single value, see code sample
below values for a, b, and c. These represent...
|
by: Peter |
last post by:
Does anyone know how to convert the following VB6 code to C# code?
Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As
Any, Source As Any, ByVal bytes As Long)
Dim...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |