PDA

View Full Version : Overprotective SB-Compiler



NewsArchive
11-05-2013, 12:51 AM
Hi Friedrich,

after updateing SB to V8.1 Build 4227, I can't compile some of my
projects. The compiler says, that there are some undefined variables,
but thats not true. Look at this small example:


------ Compiler output -------

Your Project Name-5.sb8(28): error GEN1006: Reference to variable
%[L]EICAR% has not been previously defined.

------------------------------

------ Script -------

25) #set compiler variable [L] = "TEST"
26) Set Variable %[L]LINE% to ""
27) Set Variable %[L]TESTFILE% to ""
28) Set Variable %[L]LINE% to FUNCTION:Get Line "1" from "%[L]TESTFILE%"

------------------------------

Demo Script attached.

Thanks for your help.
Markus

NewsArchive
11-05-2013, 02:52 AM
Marcus,

> after updateing SB to V8.1 Build 4227, I can't compile some of my
> projects. The compiler says, that there are some undefined variables,
> but thats not true. Look at this small example:

Yes, the following fix is responsible for this behavior:

---
FIX : [SB#3-11022] IDE: The "Handle Text File Operation..." script
function did not check for undefined runtime and compiler
variables.
---

I agree. The compiler is overprotective and checks all specified variables.
In your case, you have a "%[L]EICAR%" variable defined in Line 28
("Advanced" field). Because the "Get Line" option does not make use of this
variable, it does not really make sense to do the variable check here.

You have to remove that variable and then it compiles fine. I have already
changed it in our latest internal source codes so the variable check is only
performed for the "Find Line", "Insert Line" and "Replace Line" operations.

BTW, there is a bug in the "Handle Text File Operation" dialog. If you
switch the Operation, it does not directly display the previously defined
related value in the "Advanced" field. We have to fix this for the next
maintenance build.

To remove the %[L]EICAR% variable in your demo project, you have to do the
following:

1. Switch Operation to "Find Line"
2. Click "OK" button
3. Re-open the dialog and remove the variable in the "Advanced" field
4. Switch Operation back to "Get Line"

Friedrich

NewsArchive
11-05-2013, 02:53 AM
Thanks.

Markus Zander