PDA

View Full Version : Local variable namespacs



NewsArchive
07-08-2010, 01:28 AM
Hi Friedrich,

with a few tricks, I'm creating local namespaces for my variables in my
include scripts to prevent, that an accidental double used variable name
(in my include script and my main scirpt) affects each other.

To do this with with include script calls over more than one "level" or
with recursive include script calls, I need one of the following
possibilities:

- increment and decrement a compiler variable
- create a guid in a compiler variable at compile time (must be possible
multiple times)

Do you see a chance to add any of these features?

Thanks in advance
Markus

p.s: As a work around, I can do this with "run..." and "get ini value"
and an external programm, but this is very ugly...

NewsArchive
07-08-2010, 01:29 AM
Me again,

I think, I can do this only with increment and decrement a compiler
variable. The GUID seems not to be the right way.

Markus

NewsArchive
07-08-2010, 01:33 AM
Hi Markus,

> I think, I can do this only with increment and decrement a compiler
> variable. The GUID seems not to be the right way.

We are doing something similar to this with #def (see attached screenshot).

Friedrich

NewsArchive
07-08-2010, 01:33 AM
Hi Friedrich,

you just prevent to add a script twice. Thats not what I mean.

I do something like that:
#set compiler variable [L] = "EXIT"
Set Variable %[L]EXITCODE% to "%VAL1%"

The problem is, when I call an include script in an include script, I
have to save the contents of [L] bevor I set the new value and to
restore the previous value of [L] at the and of the include script.

Can you see, what I want to do?

Markus

NewsArchive
07-08-2010, 01:34 AM
Hi Markus,

> I do something like that:
> #set compiler variable [L] = "EXIT"
> Set Variable %[L]EXITCODE% to "%VAL1%"

Hmm, interesting method. I had no idea this would work. Yes, I see what
you are trying to do. I'll have to give it some thoughts...

Friedrich

NewsArchive
07-08-2010, 01:34 AM
Hi Fridrich,

I've found a small problem:

I can use my variable %[L]_KERNEL32DLL% in "Load DLL", but not in "Free
DLL". It always jumps to "%_SB_WIZHWND%".

Could you check this please?

Thanks in advance.
Markus

NewsArchive
07-08-2010, 01:35 AM
Solved. I have to select it in the combobox. I can not type its name.
Strange.

Markus

NewsArchive
07-08-2010, 01:36 AM
Hi Markus,

> I think, I can do this only with increment and decrement a compiler
> variable.

Added!

--
Friedrich Linder
Lindersoft
www.lindersoft.com
+1.954.252.3910

SetupBuilder is Windows 7 installation -- "point. click. ship"

-- Official Comodo Code Signing and SSL Certificate Partner

NewsArchive
07-08-2010, 01:36 AM
Great! Thanks.

Markus

NewsArchive
07-15-2010, 01:27 AM
Fix works in your actual build.

Markus

NewsArchive
07-15-2010, 01:37 AM
> I'll have to give it some thoughts...

Do you have already a result of your thougts?

Have you seen, how I use this in my project (DBUpdater) yesterday?

Markus

NewsArchive
07-15-2010, 01:37 AM
Hi Markus,

> > I'll have to give it some thoughts...
>
> Do you have already a result of your thougts?
>
> Have you seen, how I use this in my project (DBUpdater) yesterday?

This one?

> IMPROVEMENT: IDE: Add "Increment" and "Decrement" Value Options to
> the "#set compiler variable..." directive.

Friedrich

NewsArchive
07-15-2010, 01:38 AM
Hi Friedrich,

your inc/dec improvement is already in use. Thank you for that. I
thought you will give some thoughts to my idea, how I create Local
variable namespaces.

An example can be found in my include scripts from monday (or tuesday?),
you will see movefiles.sbi, which calls "writelog.sbi" and
"erroroccured.sbi" which on its part calls "exit.sbi". All have there
own namespace.

By the way. This brings two suggentions to my mind. I will open new
threads for that.

Markus

NewsArchive
07-15-2010, 01:38 AM
Hi Markus,

> your inc/dec improvement is already in use. Thank you for that. I thought
> you will give some thoughts to my idea, how I create Local variable
> namespaces.

I gave your "increment and decrement a compiler variable" suggestion some
thoughts :)

Friedrich

NewsArchive
05-06-2011, 01:29 PM
Hi Friedrich,

you know my solution for local namespaces. But it would be much nicer,
if I could do this with the IDE directly instead of "durch die Brust ins
Auge".

What do you think?

Markus

NewsArchive
05-06-2011, 01:29 PM
Hi Markus,

> you know my solution for local namespaces. But it would be much nicer, if
> I could do this with the IDE directly instead of "durch die Brust ins
> Auge".

How would you like to see this implemented?

Friedrich

NewsArchive
05-06-2011, 01:57 PM
Perhaps like this:

%abcd% is a normal global variable.

§abcd§ is a variable, which is only valid in the (include) script it is
used. Subsequent or recursive calls to the same include script will see
the same variable instance. If the same variable name is used in an
other include script, it has it's own instance.

&abc& is a variable which is only valid in a concrete call of an include
script. Subsequent or recursive calls to the same include script as well
as the same variable name in an other include script will see it's own
instance of the variable.

Markus

NewsArchive
05-07-2011, 12:25 PM
Hi Markus,

> Perhaps like this:
>
> %abcd% is a normal global variable.
>
> §abcd§ is a variable, which is only valid in the (include) script it is
> used. Subsequent or recursive calls to the same include script will see
> the same variable instance. If the same variable name is used in an other
> include script, it has it's own instance.
>
> &abc& is a variable which is only valid in a concrete call of an include
> script. Subsequent or recursive calls to the same include script as well
> as the same variable name in an other include script will see it's own
> instance of the variable.

Thank you. I have saved this message for possible future consideration.
It's an interesting idea, but requires a compiler modification.

Friedrich

NewsArchive
06-28-2012, 10:40 AM
Hi Friedrich,

any news about this?

Markus

NewsArchive
06-28-2012, 10:51 AM
>
> any news about this?
>

No, sorry.

Friedrich