Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 31st, 2006, 12:43 PM   #1
zorin
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 218
Rep Power: 4 zorin is on a distinguished road
Characters display problem

Im using visual basic 6 and I have a problem. I want to use the drink name 7-up in my program and then output the name into a list box but I can only use

Const up

not

Const 7-up

If I use const 7-up I get the error message compile error: Expected Identifier. Im not sure why. Visual basic must be able to use numbers and not just text shoulden't it?

The code that I am using for the calculation is

 Form5.Show
   Form5.List1.AddItem ("up")
   Form5.List2.AddItem Format(up, "0.00")
   Form5.Text2 = Format((Val(Form5.Text2) + up), "##0.00")

Which adds the item to a different form. If anyone could help that would be great. Thanks.
zorin is offline   Reply With Quote
Old May 31st, 2006, 2:02 PM   #2
NSchnarr
Newbie
 
Join Date: May 2006
Posts: 28
Rep Power: 0 NSchnarr is on a distinguished road
Im not sure in numbers can or cannot be used, but im certain it cant start with a number.
Consider using seven-up, Seven-Up, etc.
NSchnarr is offline   Reply With Quote
Old Jun 23rd, 2006, 4:38 PM   #3
mackenga
Professional Programmer
 
Join Date: Mar 2005
Location: Glasgow, Scotland
Posts: 317
Rep Power: 4 mackenga is on a distinguished road
You can't have a - in the name either. That's an expression. 7-up means "Seven, subtract up" which is nonsensical. Try sevenUp.
__________________
"I'm not a genius. Why do I have to suffer?"
mackenga is offline   Reply With Quote
Old Jun 24th, 2006, 2:27 PM   #4
zorin
Hobbyist Programmer
 
Join Date: Apr 2005
Posts: 218
Rep Power: 4 zorin is on a distinguished road
mackenga, I chose to do that in the end 'cause I didn't know if thier was another way around it. I wanted it to be 7-up because thats the trade name and thats what was required of me. I tried my best anyway but its okay using the way you suggested.
zorin is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:27 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC