Results 1 to 3 of 3

Thread: Calling a Function?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 1999
    Location
    France
    Posts
    90
    Hi,

    I'm changing some code a friend wrote for me. Unfortunately she's gone to Spain. She wrote the code with a picture box in mind, but I'm changing it to a textbox - makes more sense.

    In a command button I have:

    Command1_Click()
    Text1 = "We are being asked to find the value of 'x'." & _
    "Firstly, we have to tidy up the left side of the equation,"
    qShow
    End sub

    This then calls the function, qShow

    It works fine for the code as a Picturebox:

    Sub qShow()
    If b < 0 Then Pictext.Print Trim$(a); "(x" & Trim$(b) & ")" _ Else: Pictext.Print Trim$(a); "(x+"; Trim$(b); ")"
    End Sub

    But if I change Pictext.Print to Text1.Text, I get the following error:

    Compile Error: Expected: End of Statement, and ";" is highlighted. Could someone please tell me how to sort this out?

    Thanks a lot!


  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946
    not sure if I get what you are after
    but you should change pictext.print to text1.print
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    With all due respect, Joe, the textbox does not have a Print method, so you can't say Text1.Print ...

    Chris, what you want to do is convert the semicolons to ampersands so that you can display a concatenated string. (In the Print method, the semicolon means "print the following item adjacent to the previous item". To achieve the same results with a textbox, you must concatenate.)

    Try this:

    Sub qShow()
    If b < 0 Then
    Text1.Text = Trim$(a) & "(x" & Trim$(b) & ")"
    Else
    Text1.Text = Trim$(a) & "(x+" & Trim$(b) & ")"
    End If
    End Sub

    [Edited by BruceG on 05-30-2000 at 01:05 PM]

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