Page 1 of 1

FBC Compiler error

Posted: Tue Jan 27, 2009 1:14 pm
by Mentat
I got an error message "Aborting due to runtime error 12 ("segmentation violation" signal)" when I tried to compile something. It didn't give a line number or anything, it just says that. What does it mean? Is the code I'm trying to compile bringing up the error, or is the compiler itself having the error?

Posted: Tue Jan 27, 2009 5:48 pm
by Nodtveidt
That's an error in the compiler itself. It means the compiler is trying to access memory it doesn't have access to, and it's bailing. Likely a buffer error.

Posted: Tue Jan 27, 2009 5:54 pm
by Mentat
It went away after I fixed some syntax errors. I was typing => instead of ->. Still, that was odd since the compiler didn't flag that as an error.

Posted: Tue Jan 27, 2009 6:10 pm
by Nodtveidt
Still, you might want to send the source causing that problem to the devs. It could be indicative of a legitimate problem with the compiler.

No wonder FB sucks.

Posted: Tue Jan 27, 2009 6:16 pm
by burger2227
QB uses >=. FB uses -> ? That don't sound right :wink:

Re: No wonder FB sucks.

Posted: Tue Jan 27, 2009 6:31 pm
by Mentat
burger2227 wrote:QB uses >=. FB uses -> ? That don't sound right :wink:
I used it like this

Code: Select all

const packSize as integer = 5

type dog
 dim age as integer
end type

dim pack(1 to packSize) as dog
dim oldest as dog ptr

'... blah blah blah, do stuff with dogs' ages

'Find oldest dog in pack
oldest = @pack(1)
for i as integer = 2 to packSize
 'compare age
 if oldest=>age < pack(i) then oldest = @pack(i)
next i

end 

Posted: Tue Jan 27, 2009 8:59 pm
by Imortis
@Clippy:
-> is the pointer dereference operator.
Like the period is used to access the parts of a type.
If you are accessing the points of a type ptr, then you use ->

Code: Select all

Type test
     a as integer
end type

dim variable as test
dim variable_ptr as test ptr

'@ means Address of
variable_ptr = @variable

variable.a = 4

print variable_ptr->a