Post by dragonjim on Mar 19, 2018 2:26:41 GMT 1
PLEASE POST NEW BUG REPORTS TO A DIFFERENT THREAD.
Sjouke Hamstra has performed marvels over the past few years squashing bugs within the IDE and in the accompanying OCX runtime binary file.
However, there are still some bugs that persist and, if they are to be found in the Compiler, then they may continue to exist for some time to come as Sjouke has no immediate plans to fix them.
A list (not exhaustive) of the existing bugs are as follows:
The following bugs were fixed in OCX/Runtime v 2.341
This list will be updated as necessary.
Sjouke Hamstra has performed marvels over the past few years squashing bugs within the IDE and in the accompanying OCX runtime binary file.
However, there are still some bugs that persist and, if they are to be found in the Compiler, then they may continue to exist for some time to come as Sjouke has no immediate plans to fix them.
A list (not exhaustive) of the existing bugs are as follows:
- Array elements as ByRef arguments - Array elements cannot be passed by reference to some GFA-BASIC commands. The following is not accepted by the editor ("internal: Assignop 20 with ELEM_VAR_KLAM"):
GetWinRect nr%, x%(nr%), y%(nr%), w%(nr%), h%(nr%)
[Origin of the problem: COMPILER (syntax parser)] - Bool in a Type
Every eighth bool variable in a row isn’t accessed correctly as, when you access it, it changes the bits in the 7 previous Boolean variables as well.Type BoolTrouble
a0 As Bool
a1 As Bool
a2 As Bool
a3 As Bool
a4 As Bool
a5 As Bool
a6 As Bool
a7 As Bool
EndType
Dim bl As BoolTrouble
bl.a0 = True ' Ok for .a0 to .a6
bl.a7 = False ' .a7 Fatal, changes all others also
Workaround: Avoid grouping eight Boolean variables in a row inside a User-defined Type; if i1 As Int32 - or something similar - was inserted between any of the Boolean variables listed in the example above, the problem would no longer occur.
[Origin of the problem: COMPILER] - Comparing to a Date type - It is not possible to compare datatypes other than Date or Double with another Date. For this reason, the following comparison will fail: If somedate% > Date Then Print "Date in the Future"
[Origin of the problem: COMPILER] - Date array in a Type
It is not possible to add a Date array to a Type definition; instead use an array of Double as, internally, a Date is stored as a Double.Type TEST
Dat(10) As Date
EndType
Local tTest As TEST
tTest.Dat(1) = CDate("01.01.2007 12:00")
Trace tTest.dat(1) ' Compiler Error
// Workaround:
Type ArrDate
Dat(10) As Double
EndType
Local t As ArrDate
' Convert a Dat type to Double:
t.Dat(0) = CDbl(CDate("01-01-2010"))
' Use: convert back to Date:
Trace CDate(t.Dat(0)) ' 01.01.2010 (OK)
[Origin of the problem: COMPILER] - Comparing to a Date type - It is not possible to compare datatypes other than Date or Double with another Date. For this reason, the following comparison will fail: If somedate% > Date Then Print "Date in the Future"
[Origin of the problem: COMPILER] - Len and Variant Arrays - When an element of an array of Variant – Dim vntarray() As Variant - holds a string the Len function does not return the string length but the size of the Variant datatype (16) instead. This is in contrast with the length returned from a normal Variant variable that is assigned a string as show below:
Debug.Show
Global vs = "abcdefghijklmnopqrstuvwxyz"
Global va(2) : va(0) = vs
Trace Len(vs) ' 26 (OK)
Trace Len(va(0)) ' 16 (<=>sizeof(Variant))
Workaround: Use Len(Str(va(0)) instead.
[Origin of the problem: COMPILER] - Don’t use a 16-bit integer as a Function return type.
[Origin of the problem: COMPILER] - Use explicit ByRef arguments in a Sub
For a Sub taking arguments ByRef is the default setting and ByRef can be left out in the Sub declaration. However, this is VB-compatibility mode and works only with VB compatible code, i.e. code that expects this behavior. GFABASIC code does not expect implicit ByRef arguments and so you should add ByRef explicitly to list of arguments. See also: Post on Sub and ByRef argumentsSub MySub(ByVal arg1%, ByRef arg2$) ' Explicit ByRef/ByVal
[Origin of the problem: COMPILER] - Graphics - All graphics related commands use floating-point arguments (Single or Double). Using other datatypes forces the compiler to insert type conversion code. This sometimes fails for Byte and Word datatypes. For instance, do not use graphic commands like PCircle x, y, r where x or y or r is a Byte or Word datatype.
[Origin of the problem: COMPILER] - Button Captions - The property Button.Caption = str$ is not implemented.
[Origin of the problem: RUNTIME] - Multiple use of IsExe - Using the IsExe function more than once in a program can cause an unexpected error.
Workaround: Use IsExe only once to set a global variable at the start of the program, for instance:Global Bool AsExe = IsExe
[Origin of the problem: COMPILER]
The following bugs were fixed in OCX/Runtime v 2.341
- Reading :Files - File reading commands that take a variable like Input var, Line Input var$ cannot be combined with byte reading functions like Inp|(#), Inp%(#), etc, and also Input$(n,#).
- ScaleLeft, ScaleTop - These Form properties stored and returned values in pixels rather than native values.
This list will be updated as necessary.