HP3000-L Archives

April 2003, Week 2

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Wirt Atmar <[log in to unmask]>
Reply To:
[log in to unmask][log in to unmask], 9 Apr 2003 13:41:15 EDT315_US-ASCII An unnamed "senior administration official" said three weeks ago:

"Everyone wants to go to Baghdad. The real men want to go to Tehran."

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *36_9Apr200313:41:[log in to unmask]
Date:
Wed, 9 Apr 2003 06:58:58 EDT
Content-Type:
text/plain
Parts/Attachments:
text/plain (68 lines)
Gehang writes:

>  It's not about war, it's about VB programming so somewhat on
>  topic..

That's too bad. That means it's probably another one of those damnably boring
programming problems.


>    I wrote a label making program which creates a text file to be
>  printed on 4X12 label paper...
>   It has 5 textboxes each with maxlenth set to 28. And a button
>  to process (makes text file). It also has 3 other buttons on the
>  bottom which set the textbox alignments to left, center, or
>  right justified...
>
>   The problem is after you enter in 28 chars you get the beep
>  saying it's too many chars(good thing). However I noticed by
>  accident if you click any of the alignment buttons then go add
>  more text it will let you(bad thing). Something about clicking
>  any of those buttons cancels out the maxchars property...
>   I added 5 statments text(1-5).maxlength = 28 to the end of my 3
>  alignment button subs. Still it lets you add more text only
>  after clicking any alignment button.
>   For debugging pourposes I added a picbox at the bottom and had
>  it print the text1.lenth and text1.maxlength properties anytime
>  text is entered in to the box. The maxlenth always stays at 28,
>  as you enter text the text.length keeps going up as it should,
>  er as it shouldn't(becuse it's greater then the max length
>  allowd).
>
>   In short if that's still possible, is anyone out there a VB
>  Junkie, or likes a good challege?
>   If you want code, or any quesstions answered please mail me
>  before I pull my hair out...

> ps.  I don't think it's a problem with my alignment sub, as it
>  doens't do anything big. All those maxlegths are in there as a
>  test I did to see if that effected anything. It didn't :(
>
>      Private Sub Center_Click()
>      text1.maxlenth = 28
>      Text1.Alignment = vbCenter
>      text1.maxlenth = 28
>      Text2.Alignment = vbCenter
>      Text3.Alignment = vbCenter
>      Text4.Alignment = vbCenter
>      Text5.Alignment = vbCenter
>      text1.maxlenth = 28
>      End Sub

In this case, the solution is quite easy: you misspelled the word "length".

In VB, when you spell a variable or property properly, VB acknowledges that
correct spelling by retyping your input in the case that the variable or
property was originally defined in. If you look at you Sub code above, you'll
notice that "text1.maxlenth = 28" is not capitalized for either the control
nor the specific property of the control, indicating that VB is saying the
equivalent of "What the hell is this? I have no idea of what you're trying to
do here." I strongly suspect that if you add a "g" to "maxlength", VB will
not only properly recognize your sentence but begin acting in the way that
you want it to.

Wirt Atmar

* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *

ATOM RSS1 RSS2