No announcement yet.

Very weird problem using DDT.

  • Filter
  • Time
  • Show
Clear All
new posts

  • Very weird problem using DDT.

    Try to compile this:

    Yes, forget the dialog new, it's only for compiling in this case.
    In this case i get the error:
    "invalid register variable"

    Now, enable the a&

    Now it compiles fine!

    I certainly don't hope that i need specific calls like registervariable or sort of..(!)

    CallBack Function Form1() As Long
    End Function
    Function PBMain()
        Dim hDlg As Long
    '    Dim a&
        Dim Result As Long
        DIALOG SHOW MODAL hDlg, CALL Form1 TO Result
        Msgbox Str$( Result )
    End Function

    [This message has been edited by E B Knoppert (edited May 13, 2000).]

  • #2
    The compiler does not support the use of register variables with the TO keyword in most cases. When you "unrem" your second DIM statement, the variable "RESULT&" reverts to being a memory variable as only the 1st two (integer class) variables can be register variables in each sub/function.

    Note, it is possible that the compiler may accept register variables with the TO keyword in future editions of the compiler.

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


    • #3
      Frankly, i don't care much for register variables.

      I think that de compiler should recognize this variable.
      It complains about the misused variable but does not skip it because it's a 'To' variable..

      I.o.w. the ordinary Basic programmer should not be worried about these #register none stuff and should have the poss. to skip this 'low-level' functions at all.


      and.. don't burn me