Hello everyone,
What is the best way to find the following problems with calling by
reference in the software:
function MyFunctioOne () as logic
local nVar: = 0 as int
MyFunctioTwo (@nVar)
or
MyFunctioTwo (nVar)
return (true)
function MyFunctioTwo (nVar ref real8) as logic
....
nVar: = 1234.56
return (true)
Thanks in advance for the reply!
Best regards.
Georgi Georgiev
Hello everyone,
What is the best way to find the following problems with calling by reference in the software:
function MyFunctioOne () as logic
local nVar: = 0 as int
MyFunctioTwo (@nVar)
or
MyFunctioTwo (nVar)
return (true)
function MyFunctioTwo (nVar ref real8) as logic
....
nVar: = 1234.56
return (true)
Thanks in advance for the reply!
Best regards.
Georgi Georgiev
When you don't pass the a variable by reference correctly, the compiler
will give you a warning:
Automatic Reference Generation: 51200.
Just make sure Warnings is at least set to Low and Warnings as Errors is checked in the compiler options of the particular option.
This will report all the issues at compile time and you will need to
correct.
Jamal
On 12/18/2020 3:07 AM, georg...@gmail.com wrote:
Hello everyone,
What is the best way to find the following problems with calling by
reference in the software:
function MyFunctioOne () as logic
local nVar: = 0 as int
MyFunctioTwo (@nVar)
or
MyFunctioTwo (nVar)
return (true)
function MyFunctioTwo (nVar ref real8) as logic
....
nVar: = 1234.56
return (true)
Thanks in advance for the reply!
Best regards.
Georgi Georgiev
Thank you for the answer Jamal,
Warnings are set on All and Warnings as Errors is checked on each application.
However, I found an error with calling by reference.
The compiler does not give an error if you have a variable of type int, for example, and call it by reference in a function in which it is described as real8.
Any idea about that?
Merry Christmas,
George
Thank you for the answer Jamal,
Warnings are set on All and Warnings as Errors is checked on each application.
However, I found an error with calling by reference.
The compiler does not give an error if you have a variable of type int, for example, and call it by reference in a function in which it is described as real8.
Any idea about that?
Merry Christmas,
George
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 39:54:12 |
Calls: | 6,648 |
Files: | 12,193 |
Messages: | 5,329,408 |