Respond to this messageReturn to Index
Original Message
  • Identifier cannot include a period, but in sub procedure it can !
    • lisztfr (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 :

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

      DECLARE SUB ExSub (var AS example)

      DIM test AS example


      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 !=====


      SUB ExSub (var AS example)

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

    Your Name
    Message Title
    Message Text

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