Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2006, 12:55 PM
Registered User
 
Join Date: Dec 2006
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default "identifier> expected"error

Can anyone please tell me where do I declare the variable "bb", so that I do not get "identifier> expected" error. My code is:


public class Main extends javax.swing.JFrame
{
    static String bb="";


[... lines of code ...]


private void jComboBox1ActionPerformed(java.awt.event.ActionEve nt evt)
    {
    String b=null;
    String bb=null;
    Object a=jComboBox1.getSelectedItem();
    b=(String)a;
    bb=b.substring(0,1);
    System.out.println("bb "+bb);//Its printing fine hre
}
//System.out.println("bb "+bb);//but I need to print here, but am
                                    getting the error "identifier>
                                    expected"


 
Old December 18th, 2006, 08:31 AM
Friend of Wrox
Points: 7,395, Level: 36
Points: 7,395, Level: 36 Points: 7,395, Level: 36 Points: 7,395, Level: 36
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Capital Federal, , Argentina.
Posts: 2,189
Thanks: 5
Thanked 59 Times in 57 Posts
Send a message via MSN to gbianchi
Default

hi there...

I dont get it.. you want to print outside a procedure or function?? you cann't do that...

HTH

Gonzalo




Similar Threads
Thread Thread Starter Forum Replies Last Post
<identifier> expected error sprinkle Java Basics 1 February 11th, 2007 09:56 PM
Identifier expected andriy JSP Basics 0 November 1st, 2006 11:28 PM
"Identifier expected" Error NehaJani VB.NET 2002/2003 Basics 6 January 23rd, 2006 11:27 PM
Identifier Expected syncmaster VB.NET 2002/2003 Basics 1 September 2nd, 2004 03:34 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.