473,320 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

mathmatical signs

lee123
556 512MB
how do you do this:

in fractions they have a numerator & denominator. Ok I'm making a fraction project and i can't get this to work:

i have four textboxes two of them are numerators and the other two are Denomiators and a label in my code i want to say:

Expand|Select|Wrap|Line Numbers
  1. IF  Text1.text <  Text3.text  Then
  2.       label1.caption = "Proper Fraction"
  3. End IF
But when i enter in a number like 50 in the text1 and a 100 in the Text3 the Label doesn't show the Caption.

But when i enter in a number like 5 in the text1 and a 10 in the text3 the Caption "Proper Fraction" displays.

Why Is that? How can i get it to show when the number (text1) is less than the Number (text3) when I Have Numbers like that. Am I forgetting to do something?

lee123
Sep 1 '08 #1
5 1365
YarrOfDoom
1,247 Expert 1GB
Am I forgetting to do something?
Yes, using the CInt() function on Text1.text and Text3.text.
Hope this helps.
Sep 1 '08 #2
lee123
556 512MB
I have never used this function before explain more please..

lee123
Sep 1 '08 #3
YarrOfDoom
1,247 Expert 1GB
The expression you put between the brackets gets converted to an integer.
Even if Text1is filled in with only numbers, Text1.text returns a string,and CInt() will set this straight. If a non-numeral character is in this string, the function shall return 0. CInt() doesn't only work with strings, but also with other types of data.
Sep 1 '08 #4
lee123
556 512MB
ok i have changed the names But this is what i think your saying (please correct me if I'm wrong):

Expand|Select|Wrap|Line Numbers
  1. Private Sub Num1_LostFocus()
  2. If CInt(Num1) < CInt(Num2) Then
  3.     Label3.Caption = "<-- Proper Fraction"
  4.     Label3.FontBold = True
  5.     Label3.FontSize = 18
  6.     Num2.FontSize = 40
  7. End If
  8. End Sub
lee123
Sep 1 '08 #5
QVeen72
1,445 Expert 1GB
Hi,

You need to take care of Initialising the label..
Also use VAL function instead of Int.. CINt causes error if > 32k

Expand|Select|Wrap|Line Numbers
  1. Private Sub Num1_LostFocus()
  2.       If Val(Num1) < Val(Num2) Then
  3.           Label3.Caption = "<-- Proper Fraction"
  4.           Label3.FontBold = True
  5.           Label3.FontSize = 18
  6.           Num2.FontSize = 40
  7.       Else
  8.           Label3.Caption = "<-- ImProper Fraction"
  9.       End If
  10. End Sub
  11.  
Also write the same code in Num2_Lostfocus..

Regards
Veena
Sep 2 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: administrata | last post by:
Hi! I'm programming maths programs. And I got some questions about mathematical signs. 1. Inputing suqare like a * a, It's too long when I do time-consuming things. Can it be simplified? 2....
0
by: Marion Elledge | last post by:
Microsoft Signs On as Elite Sponsor of XML 2004; Expanded Conference Program Announced Presentations Added from Adobe, Justsystem, Lockheed Martin, Microsoft, W3C Alexandria, Va. – Nov. 10,...
7
by: flm | last post by:
I've got an XML document that contains euro signs and looks like : <?xml version="1.0" encoding="utf-8"?> <merchant id="52"> <product offerid="03543068131" deliverycost="6,90 €" /> ....
8
by: Murt | last post by:
Hi, when writing equations in vb .net, how do you enter the signs "less than or equal to" etc. thanks Murt
2
by: lkrubner | last post by:
When I had these two lines in my code: if ($executed == "The command didn't exist") { $this->core->error("In CommandRenderAllActionsInAnArray we sought the command '$commandName' but...
1
by: Ine Embrechts | last post by:
I have a asp.net website based on an SQL Server database. There are texts in 8 languages in it. But I have problems showing the polish signs. How can I fix this? *** Sent via Developersdex...
2
by: Wyseguy79 | last post by:
I am looking at a line of code in javascript that I dont understand... var ad = n % nn; What I dont understand is what the % represents as a mathmatical function in javascript. If anyone...
2
by: VivD | last post by:
I recently updated some webpages and they seem fine previewed in browsers on my computer. When I uploaded them and checked again the £ signs had been replaced with ? or little squares (depending on...
14
by: gimme_this_gimme_that | last post by:
What is going on here with the dollar signs and parenthesis? $(document).ready(function(){ $("li").behavior("click",function(){ $(this).load(menu.html"); }); }); And when do you use click...
0
by: RobR2009 | last post by:
I am having trouble with a C# proxy page I am writing which allows me to do cross domain AJAX calls with Javascript. The problem is with certain pages that contain pound signs £ that are not HTML...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.