Results 1 to 8 of 8

Thread: please help with width

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Location
    london
    Posts
    31

    Angry

    I have this code and it is comming back with an error

    fla$ = "c:\reports\weekly.rpt"
    open fla$ of input as #1
    width #1, 140
    print #1,"weekly report"
    close #1

    i am getting an error message on the width line

    can you please help

    thanks

    dave
    D Stonebanks

  2. #2
    Hyperactive Member compuGEEK's Avatar
    Join Date
    May 1999
    Location
    Mpls,MN,USA
    Posts
    281
    On your line that reads open fla$ of input as #1, replace the of with for.

  3. #3
    Lively Member
    Join Date
    Feb 2001
    Location
    Qc, Canada
    Posts
    70
    Try "For Input..." instead of "OF"

    Steph
    Virtually Impossible !

    VB5 Entreprise (SP3) - VB6 Entreprise (SP4), MSSQL7, MSAccess, VBA, VBScript, ASP

  4. #4
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    i think the file has to be open for output.
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  5. #5
    Banished Cander's Avatar
    Join Date
    Dec 2000
    Location
    Why do you care?
    Posts
    6,913
    Im sure thats a typo guys, or else it would have errored on that line..not the width line
    Stack Overflow
    See the features of Visual Studio 2010 and C# 4.0: The 10-4 show on Channel9

  6. #6
    Lively Member
    Join Date
    Feb 2001
    Location
    Qc, Canada
    Posts
    70

    Cool

    Cander's right, it should be for output according to MSDN, ... sorry about the typo but it was to easy !...

    Steph
    Virtually Impossible !

    VB5 Entreprise (SP3) - VB6 Entreprise (SP4), MSSQL7, MSAccess, VBA, VBScript, ASP

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Mar 2000
    Location
    london
    Posts
    31

    Angry

    sorry guys yes that is a type error. th code is
    open fla$ for output as #1
    width #1, 140

    the error is invalid use of property.

    please help
    D Stonebanks

  8. #8
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431
    Microsoft KnowledgeBase article Q145678 confirms that this is a problem when the code you are trying to use is in a form and the example given in MSDN also doesn't work. However the problem only occurs if the code is in a form, so if you move it to a module or class it will work (I tried it).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width