Announcement

Collapse
No announcement yet.

Problem Declare Variable in Vb/Dll

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem Declare Variable in Vb/Dll

    When I declare "var1(100)" as single
    Can I declare "var1" as single
    and "var1$" as string
    then I use var1(1)=12345
    can I use var1=12345
    and can I use var1$="SOME STRING"
    in the same procedure?

    ---
    dim var1(100) as single
    dim var1 as integr
    dim var1$ as string

    Is above line is acceptable in vb/dll?

  • #2
    From the helpfiles:
    Bear in mind that cat?, cat%, cat&, cat&&, cat!, cat#, cat##,
    [email protected], [email protected]@, and cat$, are ten separate variables.
    Although using cat over and over again to create different variables
    like this is legal, good programming practice suggests that you use
    somewhat different names for different variables. It's also much better
    to use descriptive and understandable names for your variables rather than
    single letters. It's extremely difficult to debug a program in which [email protected]
    has been entered instead of x! or x#. Imagine the confusion of trying to
    distinguish x&& and x&. If you had used variable names like count!, result#,
    remain##, and company$, you would have had considerably less trouble keeping
    your variables (and their types) apart.



    ------------------
    Peter.
    mailto[email protected][email protected]</A>
    Regards,
    Peter

    Comment


    • #3
      "Dimension Company"... the rules of this BBS are such that you must register with you real name (First + Last) - aliases and handles are not permitted.

      Please reregister accordingly before posting further messages.

      Thank you!


      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]

      Comment


      • #4
        To put it simple:

        You can do that in PB, you can't in VB.

        Knuth

        ------------------
        http://www.softAware.de

        Comment


        • #5
          Knuth,

          You don't need to in VB because you would just declare the variable as
          type 'variant'.

          I reckon that 'Dimension Company' is trying to force a variable of
          type 'variant' in PB.

          You can do that in VB but not in PB.

          I keep saying you use the correct tool for the job. And all of this knocking
          VB rubbish doesn't help PB's image at all. PB are not going into competition
          with VB, they actually positively market it as a complimentary tool to increase
          the usability of VB. For ******* sake stop knocking it.

          regards
          Trevor

          ------------------

          Comment


          • #6
            Originally posted by Trevor Lane:
            I keep saying you use the correct tool for the job. And all of this knocking
            VB rubbish doesn't help PB's image at all. PB are not going into competition
            with VB, they actually positively market it as a complimentary tool to increase
            the usability of VB. For ******* sake stop knocking it.
            Trevor,

            you completly misinterpreted my answer. They asked:
            dim var1(100) as single
            dim var1 as integr
            dim var1$ as string

            Is above line is acceptable in vb/dll?
            And I simply answered their question with a "No" and a "Yes".
            And, yes, I activly use VB myself (It's still my primary development tool).

            Don't get too paranoid, Trevor<g>...

            Knuth

            ------------------
            http://www.softAware.de


            [This message has been edited by Knuth Konrad (edited June 18, 2001).]

            Comment


            • #7
              Guys, please endeavor to keep things civil...

              Thanks!


              ------------------
              Lance
              PowerBASIC Support
              mailto:[email protected][email protected]</A>
              Lance
              mailto:[email protected]

              Comment

              Working...
              X