So, for example, what in Actionscript 3 can be written as:
var a:Number = aClass.myFunction(myVariable1,
myVariable2);
in RealBasic has to be written as:
Dim a As Double = AClass.MyFunction(MyVariable1,MyVariable2)
A problem is that if the line becomes too long, it will extend beyond the width of the editor and be harder to read. Many times this occurs because you have to add
CType
tags to avoid compilation warnings. For example, if MyFunction
accepts only Single type variables and MyVariable1
and MyVariable2
are Double type variables, your line will look like:Dim a As Double = AClass.MyFunction(CType(MyVariable1,Single),CType(MyVariable2,Single))
which makes the code slightly less readable.
Hence, a solution is to modify
AClass
adding an intermediate function that accepts Double variables and then calls the original function.
No comments:
Post a Comment