Howto use Function Arguments correctly in AB?


Antonio Cambule

Good Evenening,

i'm trying to use a function with arguments like following, but it seems not work as expected:

Code in the function:


Arguments in the Arguments-List: [WarningMsg] and [AValue]

----

Call from Event, somewhere else:

Edit:
I want to input two values and append the second value to the first value using a linebreak
I expect to get the values of the variables [WarningMsg] and [ValidationMessage] values into the argument variables
[WarningMsg] and [AValue]


DecSoft

Hola Antonio,

I think I must to apologize... certainly this is something that may can be improved in the future, however, rigth now we can get this kind of issue when try to update an app's variable from a function, if we use the same name in some of the function's arguments.

The solution of course is to rename the function's argument, so we can get the things working as expected. I remember you ask something to me in relation with AB functions, and I forget to comment you this possible issue, then my apologizes.

Maybe until I can't do something about can be a good idea to document this into the program's help. For now, please, download and take a look at this prepared application sample, because I think you can view working what you wanted. Note how I rename the "[WarningMsg]" function's argument to be "[AWarningMsg]".



Antonio Cambule

i see. Sure that works in this case, but you're right that needs improvement.

The idea is to provide the functions two values, one that will be extended and the other that extends, without knowing the outer variables, so that i could use AddLine for any variable i put in, and do not need to know it's global name.

So, here we are again with use of globals :|


DecSoft

Hello Antonio,

i see. Sure that works in this case, but you're right that needs improvement.

The idea is to provide the functions two values, one that will be extended and the other that extends, without knowing the outer variables, so that i could use AddLine for any variable i put in, and do not need to know it's global name.

So, here we are again with use of globals :|

I think that, with a little of care, we can do the job (as we see in the sample application, prefixing the app's function's arguments in some well knowed way). Certainly this is not exactly a question related with global variables... I say behind the scenes is not a question like that, but how AB parse the app's and app's functions code. Anyway yes, probably I must try to look into this more deeply Antonio.


Everybody can read the DecSoft support forum for learning purposes, however only DecSoft customers can post new threads. Purchase one or more licenses of some DecSoft products in order to give this and other benefits.

This website uses some useful cookies to store your preferences.

I agree. Hide this note. Give me more information.