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:
Tony Summers <[log in to unmask]>
Reply To:
Tony Summers <[log in to unmask]>
Date:
Wed, 9 Apr 2003 12:29:59 +0100
Content-Type:
text/plain
Parts/Attachments:
text/plain (106 lines)
Also check you've got OPTION EXPLICIT set in your VB application - this picks up errors at compile time.

Option Explicit 

Dim A As String



Private Sub Form_Load()

A = "TEST"
B = "ANOTHER TEST"

End Sub


>>> Wirt Atmar <[log in to unmask]> 09/04/03 11:58:58 >>>
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 *



The contents of this email are confidential to the intended recipient and may not be disclosed.  Although it is believed that this email and any attachments are virus free, it is the responsibility of the recipient to confirm this.

Smith & Williamson Corporate Finance Limited - A member of M&A International Inc. http://www.mergers.net  Registered in England No. 4533970.  Regulated by the Financial Services Authority 
Smith & Williamson Investment Management Limited, Registered No. 976145.  Regulated by the Financial Services Authority.
Smith & Williamson Pension Consultancy Limited - Independent Intermediary.  Registered No. 3133226. Regulated by the Financial Services Authority.
Smith & Williamson Unit Trust Managers Limited, Registered No. 1934644.  Regulated by the Financial Services Authority.
Smith & Williamson Limited - A member of Nexia International.   Registered in England No. 4534022.  Regulated by the Institute of Chartered Accountants in England & Wales for a range of investment business activities.

Registered Office: No. 1 Riding House Street, London W1A 3AS
Telephone: 020 7637 5377 http://www.smith.williamson.co.uk

Nexia Audit Limited - A member of Nexia International.  Registered in England No. 4469576. Registered to carry on audit work and regulated by the Institute of Chartered Accountants in England & Wales for a range of investment business activities.

Registered Office: No. 1 Riding House Street, London W1A 3AS
Telephone: 020 7637 5377 http://www.nexiaaudit.co.uk

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

ATOM RSS1 RSS2