about byref

New to FreeBASIC? Post your questions here.
Post Reply
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

about byref

Post by chung »

Is it true that if i access a variable by byref in a function and the variable moves in memory during the function uses it, there may be an memory error and crash ?

so , if byref is the default access for functions and sub , almost every variables have to be static ?
fxm
Moderator
Posts: 12107
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: about byref

Post by fxm »

Can you provide a specific example of that behavior?
In FreeBASIC, variables whose data can move in memory, such as dynamic arrays or variable length strings, are normally accessible by their descriptors which are at fixed addresses in memory.
chung
Posts: 648
Joined: Jan 16, 2010 20:52
Location: France
Contact:

Re: about byref

Post by chung »

i have no specific example , i just experienced some unexpected abend from time to time in my last program "freewebcar_chung" compiled with the v1.05-win32 version of freebasic . i first thought that google maps was sending sometimes corrupted jpg images as it can happen.
then i have tried with earlier freebasic v1.02.1-win32 and the problem seams to have disappeared , well it works until now ... and crashes after some hours ... sorry for the wrong info
Post Reply