Respond to this messageReturn to Index
Original Message
  • Identifier cannot include a period, but in sub procedure it can !
    • (no login)
      Posted May 31, 2012 1:26 AM

      Ok i get confused about qbasic. the same code put inside the SUB will not produce an error, and when put in the main procedure it will .... it will give an error about some statement that cannot include a period !

      The test comes from here, i changed it a bit :

      http://en.allexperts.com/q/Qbasic-Quickbasic-1623/Passing-user-defined-types.htm


      TYPE example
      a AS INTEGER
      b AS STRING * 32
      END TYPE

      DECLARE SUB ExSub (var AS example)

      DIM test AS example

      CLS

      test.a = INT(RND * 100)
      test.b = "hey, just testing"

      CALL ExSub(test)

      '===cut here !=====

      PRINT "MAIN :"

      PRINT "var.a = "; var.a
      PRINT "var.b = "; var.b

      '===cut here !=====

      END

      SUB ExSub (var AS example)

      PRINT "SUB :"
      PRINT "var.a = "; var.a
      PRINT "var.b = "; var.b
      END SUB

    Your Name
    Your Email
    (Optional)
    Message Title
    Message Text
    Options Also send responses to my email address
          


     Copyright © 1999-2014 Network54. All rights reserved.   Terms of Use   Privacy Statement