Question about Microsoft Visual Basic 6.0 for PC

1 Answer

I want code for a program in vb6.0

What will be the code for this program- to obtain a character from user and check whether it is an uppercase or lowercase character,digit or any other character using for loop?can u tell me the code for this program

Posted by on

  • zonex0902 May 11, 2010

    do you want an example "form" for your problem?? i can send you the form through yahoo if you want.

×

1 Answer

  • Level 1:

    An expert who has achieved level 1.

    Hot-Shot:

    An expert who has answered 20 questions.

    Corporal:

    An expert that hasĀ over 10 points.

    Mayor:

    An expert whose answer gotĀ voted for 2 times.

  • Contributor
  • 46 Answers

Dim text as string
text="AbCd123" 'testing purposes
for i=1 to len(text)
select case asc(mid(text,i,1))
case is < 65:'a number
case 65 to 97: 'upper case
case is >97 : 'lower case
end select
next

Posted on Aug 28, 2009

Add Your Answer

Uploading: 0%

my-video-file.mp4

Complete. Click "Add" to insert your video. Add

×

Loading...
Loading...

Related Questions:

1 Answer

How to write a program to translate english text to binary string and write a program to do inverse 27 = . , 28 = , 29= ? 30 = . 31=


to convert from text to binary, you would do something along the following lines..
1. have the user enter a string.
2. loop through the string (for each char in stringEntered..)
3. convert the character to binary using the methods provided to you by your language of choice

For the reverse (binary to text):
you must take 8 bits of data (which would be a single character), and convert it to text using the methods provided by your language of choice..

here's some links that might be of interest to you.
Visual FoxPro VFP CTOBIN and BINTOC Functions Equivalent In Net The Most Accurate and Reliable Source Code Converters

Feb 06, 2015 | Microsoft Visual Studio 6 6.0 Professional...

2 Answers

What is strings in java?


Handling character strings in Java is supported through two final
classes: Java String and StringBuffer. The String class implements immutable character strings, which are read-only once the string has been created and initialized, whereas the StringBuffer class implements dynamic character strings. All string literals in Java programs, are implemented as instances of String class. Strings in Java are 16-bit Unicode.

Nov 21, 2012 | Sun Java Programming Language (cdj-275)

1 Answer

I want to format java code and later want to check whether it got formatted, using checkstyle. How can i do that


write a program that get an input size from the user and print the multiplication table with the specified size :
size of the multiplication table 5;
multiplication table of size 5;

Jul 07, 2010 | Sun Java Programming Language (cdj-275)

1 Answer

How to convert infix to postfix using stacks in java programming?


u can try the follwing coding
import java.io.*;
import java.util.*;
//begin coding for the stack interface
interface Stack<E>
{
public boolean isEmpty();//tests is current stack is empty. Returns true if so, and false if not.
public E top() throws StackException;//retrieves value at the top of the stack. Stack cannot be empty.
public void push(E value) throws StackException;//pushes a value on the top of the stack.
public void pop() throws StackException;//removes a value from the top of the stack. Stack cannot be empty.
}//terminates coding of Stack interface

//begin coding for the objArrayStack class
class objArrayStack<E> implements Stack<E>
{
//constructor
public objArrayStack()
{
topValue=-1;
}//terminates constructor
public void push(E value)throws StackException
{
if(topValue<ArraySize-1)//currrent stack is not full
{
++topValue;
Info[topValue]=value;
}//terminates if
else //current stack is full
throw new StackException("Error: Overflow");
}//terminates push method
public void pop() throws StackException
{
if(!isEmpty())//current stack is not empty
--topValue;
else //stack is empty
throw new StackException("Error: Underflow");
}//terminates pop method
public boolean isEmpty()
{
return topValue==-1;
}//terminates isEmpty method
public E top() throws StackException
{
if(!isEmpty())//stack is not empty
return (E)Info[topValue];
else //stack is empty
throw new StackException("Error: Underflow");
}//terminates top method
//declare instance variables
final int ArraySize=10;
private Object Info[]=new Object[ArraySize];
private int topValue;

//begins coding for the StackException class
class StackException extends RuntimeException
{
//constructor
public StackException(String str)
{
super(str);
}//terminates text of constructor
}//terminates text of StackException class

//method to convert from infix to postfix notation
public static String InToPost(String infixString)
{
//operator stack initialized
objArrayStack<Character> operatorStack = new objArrayStack<Character>();
//postfix string initialized as empty
String postfixString = " ";
//scan infix string and take appropriate action
for(int index = 0; index < infixString.length(); ++index)
{
char chValue = infixString.charAt(index);
if(chValue == '(')
operatorStack.push('(');
else if(chValue == ')')
{
Character oper = operatorStack.top();
while(!(oper.equals('(')) && !(operatorStack.isEmpty()))
{
postfixString += oper.charValue();
operatorStack.pop();
oper = operatorStack.top();
}//end while loop
operatorStack.pop();
}//end else if
else if(chValue == '+' || chValue == '-')
{
if(operatorStack.isEmpty()) //operatorStack is empty
operatorStack.push(chValue);
else //current operatorStack is not empty
{
Character oper = operatorStack.top();
while(!(operatorStack.isEmpty() || oper.equals(new Character('(')) || oper.equals(new Character(')'))))
{
operatorStack.pop();
postfixString += oper.charValue();
}//ends while loop
operatorStack.push(chValue);
}//end else
}//end else if
else if(chValue == '*' || chValue == '/')
{
if(operatorStack.isEmpty())
operatorStack.push(chValue);
else
{
Character oper = operatorStack.top();
while(!oper.equals(new Character('+')) && !oper.equals(new Character('-')) && !operatorStack.isEmpty())
{
operatorStack.pop();
postfixString += oper.charValue();
}//end while loop
operatorStack.push(chValue);
}//end else
}//end else if
else
postfixString += chValue;
}//end for loop
while(!operatorStack.isEmpty())
{
Character oper = operatorStack.top();
if(!oper.equals(new Character('(')))
{
operatorStack.pop();
postfixString += oper.charValue();
}//end if
}//end while
return postfixString ;
}//terminates text of InToPost method

public static void main(String[]args)
{
objArrayStack mystack = new objArrayStack();
System.out.println("Enter a string");
Scanner scan = new Scanner(System.in);
scan.nextLine();
String str = scan.nextLine();
InToPost(str);
}//terminates text of main method
}//terminates text of objArrayStack class

Mar 16, 2010 | Sun Java Programming Language (cdj-275)

1 Answer

Drawing in Visual Basic 6.0


Hi - You cannot scan directly into VB6 unless you use a third-party control (OCX). You would need to get the data into a database table and use ADO, or, hard-code the data directly into your source code. You can actually grab it from Excel too but that involves automation programming - not hard to do - just more to learn. Have fun!

May 12, 2009 | Microsoft Visual Basic Enterprise Edition...

1 Answer

Validating in jsp


JavaScript Form Validation JavaScript can be used to validate input data in HTML forms before sending off the content to a server.
Form data that typically are checked by a JavaScript could be:
  • has the user left required fields empty?
  • has the user entered a valid e-mail address?
  • has the user entered a valid date?
  • has the user entered text in a numeric field?
Required Fields The function below checks if a required field has been left empty. If the required field is blank, an alert box alerts a message and the function returns false. If a value is entered, the function returns true (means that data is OK):
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{
alert(alerttxt);return false;
}
else
{
return true;
}
}
} The entire script, with the HTML form could look something like this:
<html>
<head>
<script type="text/javascript">
function validate_required(field,alerttxt)
{
with (field)
{
if (value==null||value=="")
{alert(alerttxt);return false;}
else {return true}
}
} function validate_form(thisform)
{
with (thisform)
{
if (validate_required(email,"Email must be filled out!")==false)
{email.focus();return false;}
}
}
</script>
</head> <body>
<form action="submitpage.htm"
onsubmit="return validate_form(this)"
method="post">
Email: <input type="text" name="email" size="30">
<input type="submit" value="Submit">
</form>
</body> </html>
E-mail Validation The function below checks if the content has the general syntax of an email.
This means that the input data must contain at least an @ sign and a dot (.). Also, the @ must not be the first character of the email address, and the last dot must at least be one character after the @ sign:
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{alert(alerttxt);return false;}
else {return true;}
}
} The entire script, with the HTML form could look something like this:
<html>
<head>
<script type="text/javascript">
function validate_email(field,alerttxt)
{
with (field)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
if (apos<1||dotpos-apos<2)
{alert(alerttxt);return false;}
else {return true;}
}
} function validate_form(thisform)
{
with (thisform)
{
if (validate_email(email,"Not a valid e-mail address!")==false)
{email.focus();return false;}
}
}
</script>
</head> <body>
<form action="submitpage.htm"
onsubmit="return validate_form(this);"
method="post">
Email: <input type="text" name="email" size="30">
<input type="submit" value="Submit">
</form>
</body> </html>


P.S.: If this information was helpful, please rate this solution.

Mar 13, 2009 | Sun Java Programming Language (cdj-275)

1 Answer

I'm a Fresher in ASP.NET 2.0, Please help me


You need to change the column type from BoundField to TemplateField and call the substring method like this

<asp:TemplateField>
<HeaderTemplate>
Comments
</HeaderTemplate>
<ItemTemplate>
<%#Eval("Comments").ToString().Substring(0, 25)%>
</ItemTemplate>
</asp:TemplateField>
In this snippet, I am displaying only the first 25 characters of the Comments field.Only problem with this approach is that if even one of the rows contains a comments field with less than 25 characters, this might trigger an error.The fool proof way then is to write a small function in codebehind which will check the length of the field, chop off any extra characters and in case of shorter strings,

( THANKING " Balgates " For this HELP )

Apr 21, 2008 | Compilers & Programming Tools

2 Answers

Sentence


send me your code -- and I can fix it

Feb 27, 2008 | Compilers & Programming Tools

1 Answer

Keyboard functions in Delphi


In Delphi, the form, and many controls have events for key presses OnKeyDown, OnKeyPress, OnKeyUp, etc. the Key is passed in as a Word value, but when cast with the ?Chr(Key)? function it will be come a Character from the keyboard. As for writing the text out to the screen, TextRect(Rect: TRect; X, Y: Integer; const Text: string); will let you write the text anywhere on your canvas that you want to and that should get you started. Good Luck

Sep 05, 2007 | Compilers & Programming Tools

Not finding what you are looking for?
Microsoft Visual Basic 6.0 for PC Logo

Related Topics:

140 people viewed this question

Ask a Question

Usually answered in minutes!

Top Microsoft Compilers & Programming Tools Experts

Fred Block
Fred Block

Level 2 Expert

289 Answers

Robin Hill
Robin Hill

Level 3 Expert

1251 Answers

Brian Sullivan
Brian Sullivan

Level 3 Expert

27725 Answers

Are you a Microsoft Compiler and Programming Tool Expert? Answer questions, earn points and help others

Answer questions

Manuals & User Guides

Loading...