Vous êtes sur la page 1sur 3

3.

> doc > gb2togb3

Previous Next Edit Rename Undo Refresh Search Administration


Documentation History

Porting from Gambas 2 to Gambas 3


This table tries to take an inventory of all incompatible changes between Gambas 2 and Gambas 3. When the IDE project converter does an automatic conversion, it inserts a comment beginning with the string [ G B 2 : X X X X ], where X X X X is the four letters wizard identifier describing which conversion occured. Wizard Symptom identifier
A R R D

Details When declaring a dimensioned array you have to use the NEW keyword now.

Gambas 2 Gambas 3
D I Ms C o m m a n dA SS t r i n g [ 5 ]

"Syntax error" on array declaration

D i ms C o m m a n dA sN e wS t r i n g [ 5 ]

B C O L

"Unknown symbol 'BackColor'..." error

The BackColor property in the Control class has been removed. Use Background instead. The UdpSocket.Bind() method cannot take a Port argument anymore. Use the Port property instead.

M y L a b e l . B a c k C o l o r=C o l o r . B a c k g r o u n d

M y L a b e l . B a c k g r o u n d=C o l o r . B a c k g r o u n d

B I N D

"Too many arguments" error with UdpSocket.Bind()

h B r o a d c a s t E v e n t . B i n d ( 0 )

h B r o a d c a s t E v e n t . P o r t=0 h B r o a d c a s t E v e n t . B i n d ( )

C L N G

"Unknown identifier 'CLng'" error

The CLng() function synonymous has been removed. Use CLong() instead.

C L n g ( . . . )

C L o n g ( . . . )

C S N G

"Unknown identifier 'CSng'" error

The CSng() function synonymous has been removed. Use CSingle() instead.

C S n g ( . . . )

C S i n g l e ( . . . )

C F L T

"Unknown identifier 'CFlt'" error

The CFlt() function synonymous has been removed. Use CFloat() instead.

C F l t ( . . . )

C F l o a t ( . . . )

D B G V

"Unknown symbol The GridView property of the 'GridView' in class 'DataBrowser'" error DataBrowser control has been renamed as View.

D a t a B r o w s e r L o g . G r i d V i e w

D a t a B r o w s e r L o g . V i e w

D M R G*

"DrawingArea.Merge The M y D r a w i n g A r e a . M e r g e=T R U E DrawingArea.Merge is deprecated" does nothing warning message anymore. You can remove it. 'N o t h i n g SQL errors with database methods Arguments of DB.Exec() and DB.Subst() above nine now must be enclosed with {} now.
M y C o n n e c t i o n . E x e c ( " U P D A T Ed e v i c e s" " S E Tn a m e=& 1 ,m o d u l e=& 2 ," " i n t e r f a c e=& 3 ,a d d r e s s=& 4 ," " l o c a t i o n=& 5 ,l a b e l=& 6 ," " l a b e l 2=& 7 ,l a b e l 3=& 8 ," " v a l u e=& 9 ,o f f i c o n=& 1 0 ," " o n i c o n=& 1 1 " )

D S U B*

M y C o n n e c t i o n . E x e c ( " U P D A T Ed e v i c e s" " S E Tn a m e=& 1 ,m o d u l e=& 2 ," " i n t e r f a c e=& 3 ,a d d r e s s=& 4 ," " l o c a t i o n=& 5 ,l a b e l=& 6 ," " l a b e l 2=& 7 ,l a b e l 3=& 8 ," " v a l u e=& 9 ,o f f i c o n=& { 1 0 } ," " o n i c o n=& { 1 1 } " ) F C O L

"Unknown symbol 'ForeColor'..." error

The ForeColor M y L a b e l . F o r e C o l o r=C o l o r . R e d property in the Control class has been removed. Use Foreground instead. M y L a b e l . F o r e g r o u n d=C o l o r . R e d

F N T H

"Not an object" error Font.Height is now a F o n t . H e i g h t ( " t e x t " ) property. The old while using Font.Height() Font.Height method has been renamed F o n t . T e x t H e i g h t ( " t e x t " ) Font.TextHeight(). "Unknown symbol 'Width'" error while using Font.Width The Font.Width() method has been renamed Font.TextWidth().
F o n t . W i d t h ( " t e x t " )

F N T W

F o n t . T e x t W i d t h ( " t e x t " )

F R M T*

Unexpected spaces In Gambas 3, nonF o r m a t ( N u m b e r ," # # # # " ) printed with Format$ used formatting characters in the Format() function are replaced with F o r m a t ( N u m b e r ," # " ) spaces, whereas they were ignored in Gambas 2. Just use less formatting characters. Exceeding digits will be printed anyway.

I M G S*

"Too many arguments" error with Image.Stretch() method

The Image.Stretch() method does not have its third argument anymore. Remove it.
I N CB o o l e a n or D E CB o o l e a n isn't

M y I m a g e=M y I m a g e . S t r e t c h ( 6 4 ,6 4 ,T R U E )

M y I m a g e=M y I m a g e . S t r e t c h ( 6 4 ,6 4 )

I N C B*

"Boolean incrementation is deprecated" warning message

allowed anymore. Use B o o l e a n=N o t B o o l e a n instead.

I N CB o o l e a n D E CB o o l e a n

B o o l e a n=N o tB o o l e a n I S T Y

"Type mismatch" error when using I s B o o l e a n ( ), I s S t r i n g ( ), or any I s < T y p e > ( ) function

The I s < T y p e > ( ) I FI s B o o l e a n ( V a l u e )T H E N. . . functions have been I FI s B y t e ( V a l u e )T H E N. . . completely I FI s S h o r t ( V a l u e )T H E N. . . I FI s N u m b e r ( V a l u e )T H E N. . . redesigned in . . . Gambas 3. Instead of checking the datatype of an expression, they I fT y p e O f ( V a l u e )=g b . B o o l e a nT H E N. . . now check if a string I fT y p e O f ( V a l u e )=g b . B y t eT H E N. . . can be safely I fT y p e O f ( V a l u e )=g b . S h o r tT H E N. . . converted to a I fT y p e O f ( V a l u e )< =g b . F l o a tT H E N. . . . . . specific datatype with the V a l ( ) function. Use TypeOf() to do the check instead.

O P E N

"Unexpected OPEN" The OPEN error with the OPEN instruction syntax has changed. instruction

O P E Ns B a s e D i r& /" l o g s "& /s M a i n L o g F i l eF O RA P P E N DA S# h M a i n L o g F i l e

h M a i n L o g F i l e=O p e ns B a s e D i r& /" l o g s "& /s M a i n L o g F i l eF o rA p p e n d

O V E R*

"Class.Symbol is badly overridden in class OtherClass" error

When you reimplement a symbol in an inherited class, Gambas 3 now checks that the declaration of the symbol in the child class is compatible with the one in the parent class. Either fix the symbol declaration in the child class, or use another name for that symbol.

'I n s i d eaf o r m P r i v a t eD e l e t eA sB u t t o n

'I n s i d eaf o r m P r i v a t eb t n D e l e t eA sB u t t o n

P P R O

"Missing AS" error in a property definition using the PUBLIC keyword.

The PUBLIC keyword is not allowed anymore in property definitions. Property are always public. All test functions ending with a question mark have been removed. Use the synoymous function beginning with "Is" instead.

P U B L I CP R O P E R T YL i n e C o l o rA SI n t e g e r

P r o p e r t yL i n e C o l o rA sI n t e g e r

Q U E S

"Unknown identifier 'xxxx?'" error

D i r ? ( . . . ) N u l l ? ( . . . ) I n t e g e r ? ( . . . ) . . .

I s D i r ( . . . ) I s N u l l ( . . . ) I s I n t e g e r ( . . . ) . . .

Q U O T

"Unknown identifier 'Quote'" error

The Quote and Unquote class have been removed. Replace Quote.Shell by Shell$().

Q u o t e . S h e l l ( " . . . " )

S h e l l $ ( " . . . " )

S L A Y

"Type mismatch. Integer[] expected" error with the Splitter.Layout property

The Splitter.Layout M y S p l i t t e r . L a y o u t=" 5 0 0 , 5 0 0 " property now takes an array of integer instead of a string of comma-separated M y S p l i t t e r . L a y o u t=[ 5 0 0 ,5 0 0 ] values. gb.Text is deprecated and replaced by gb.IgnoreCase.
g b . T e x t

T E X T

"gb.Text is deprecated" warning message

g b . I g n o r e C a s e

*This incompatibility is not automatically handled by the IDE import wizard.

Vous aimerez peut-être aussi