HTA/VBA HELP PLEASE

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 13 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
frankiie15
Posts: 4
Last visit: Sat Feb 12, 2011 7:15 am

HTA/VBA HELP PLEASE

Post by frankiie15 »

Im trying to make a hta app that calculates pythagoreaN THOREM like a poppup tht propts for two side of a right triangle and calculate the unknown using formula a^2+b^2=c^2
User avatar
hackoo
Posts: 103
Last visit: Tue Apr 26, 2016 9:02 am

HTA/VBA HELP PLEASE

Post by hackoo »

Hi you can see to this advanced Calculator named Dingue Calculator v 2.0
FEATURES:
-See the operation you are typing and allow re-editing it before calculating the result
-Convert many units to many units including data storage
-Compose complex units with no limitation
-Convert currencies with with a customized currency list
-Use of customized variables
-Use of demultiplier symbols such as K,M,G and T to avoid typing large numbers
-Optionaly reduce the lenght of the result by using demultiplier symbols such as K,M,G and T
-Optionaly reduce the number of decimals
-Optionaly separates thousands with white spaces
-Switch back to the previous operations to re-edit them ("Previous/Next" buttons)
-See a full list of the operations that you have been doing with copy-paste allowed
-Save the operations and the results as a text file.
-Calculate percents of a certain number or how many percent this number is in another one
-Gives value of Pi
-Use "V" symbol for square root, visualy closer to classic math, also works with or without parenthesis.
-Cos(X) Sin(X) Tan(X) etc works with or without parenthesis.
-Optionaly gives help and tips on the fly
-Use buttons or type symbols manualy as you like
-Intuitive, customizable, skinable HTA interface, in another word: Cool!

jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

HTA/VBA HELP PLEASE

Post by jvierra »

Type almost any formula into the Google search box and it will be solved.


Try this:
2^2+3^2

Here is is already done for you:
http://www.google.com/#hl=en&sugexp=gsi ... 222b5f0e70

I had meant to post this earlier but got stuck on anoother project:

Here is the HTA I mentioned.

Code: Select all

<html>
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252"> 
<title>My HTML Application</title> 
<script language="vbscript"> 
<!-- Insert code, subroutines, and functions here -->
</script> 
<hta:application 
 applicationname="MyHTA"  
 border="dialog" 
 borderstyle="normal" 
 caption="Hey Pythagoras!" 
 contextmenu="no" 
 icon="myicon.ico" 
 maximizebutton="no" 
 minimizebutton="yes" 
 navigable="no" 
 scroll="no" 
 selection="no" 
 showintaskbar="yes" 
 singleinstance="yes" 
 sysmenu="yes" 
 version="1.0" 
 windowstate="normal" 
> 
</head> 
<script language="vbscript"> 
    Sub calc() 
        ia = CDbl(a.Value) 
        ib = CDbl(b.Value) 
        ic = (ia^2) + (ib^2) 
        c.Value = ic 
        root_c.Value = Sqr(ic) 
    End Sub 
</script> 
<body> 
<!-- HTML goes here --> 
A=<input type="text" id="a" value="3"/><br/> 
B=<input type="text" id="b" value="4"/><br/> 
<input type="button" value="calculate" onclick="calc"/><br/> 
C=<input type="text" id="c" readonly="true"/><br/> 
Root of C=<input type="text" id="root_c" readonly/><br/> 
</body> 
</html> 


Of course this is just a raw calculation and does no bounds checking.
User avatar
frankiie15
Posts: 4
Last visit: Sat Feb 12, 2011 7:15 am

HTA/VBA HELP PLEASE

Post by frankiie15 »

Thanks That does Exactly What i want Well Basically is there any way i could calculate the missing side given a and c or a and b maybe if i change the calc sub is that possible?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

HTA/VBA HELP PLEASE

Post by jvierra »

Yes - can you do the math? All it is is math. Simple algebra from Junior High.


User avatar
frankiie15
Posts: 4
Last visit: Sat Feb 12, 2011 7:15 am

HTA/VBA HELP PLEASE

Post by frankiie15 »

yes i did that thank you for the code i was wondering if you could make it so the C= line doesn't appear in the app just in the code i eventrually want to make the app look like this ----> http://i1115.photobucket.com/albums/k54 ... plate.pngi already have made the exit button but when you click on the calculate button i want another hta to popup with an exit button the calculated side and a button to copy calculated side to clipboard if that is possible the popup would look something like this ------>http://i1115.photobucket.com/albums/k54 ... .pngPlease Reply Thank You
User avatar
frankiie15
Posts: 4
Last visit: Sat Feb 12, 2011 7:15 am

HTA/VBA HELP PLEASE

Post by frankiie15 »

im 15 y/o and have been experimenting with vbs since i was 13 i dont know where to buy a book on scripting or how much they may cost so i usually use the web do you know where i can purchase one if i can get one online or in a bookstore?
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

HTA/VBA HELP PLEASE

Post by jvierra »

The HTA issue is about l4eaning HTML first then undertanding how it is used in an HTA system.

Here is a link to some great resources on scripting in an HTML environment.
http://www.w3schools.com/
Online and free.

Here is the home for HTA development.
http://msdn.microsoft.com/en-us/library ... S.85).aspx

It is great that you are 15. I wrote my first program when I was 15. I built my first computer components when I was 13. That was in 1963.

Bravo - keep learning.

VBS is usually executed under WSH and HTAs and HTML do not support all of the objects that are available under WSH.

VBS under HTML/HTA uses the DOM or Document Object Model. Her eis the DOM:

http://msdn.microsoft.com/en-us/library ... S.85).aspx

Good luck Post back with questions.


This topic is 13 years and 1 month old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked