Variable late binding? (And the new AB compiler syntax checker)


Guest

Look at the code below.
I created two ABScript functions.
1. SetIni - to save data in localstorage using the "SetOption" supplied by App Builder
2. GetIni - to retrieve data in localstorage using the "GetOption" supplied by App Builder

Example Use:
Functions:

Why did I create these functions?
SetIni:
If I use GetOption with a variable in first parameter, it does not work, I think binding of the variable does not happen when lower function is called.
I always find that I have to use SetVar to link Comment and I, and then use the result of that in GetOption.

GetIni
I found out with the GetIni function, that I cannot define a parameter by address, therefore still need two lines to get the job done.
If I change:
to
the value is not filled into iOptionValue.Value.


I guess it would be better for me to create my functions/procedures as java functions rather than ab functions?


DecSoft

Hello,

Honestly I am not totally sure that understand perfectly what you means. Please, can you provide me a little sample application that explains "what-you-expect" and "what-you-get"? I will take a look at that in order to fix the bug if any. Please use the Upload section of the forum or just send me a zip file to: info AT davidesperalta DOT com.



Samuel Vanneste

Hello at all,

Well, @Fakie, I have tried to reproduce the issue but was unable to get the troubles because I do use another way to do the things. Passing by reference, seems to work but the usage of the Return command in ABScript, is perhaps, what is the cause of the problem (Return is for returning using JavaScript, if I recall correctly).

I am attaching my demo app if you want to try : MyApp.zip

Another elegant way could be to store an object as a sole option's line instead of multiple ones.


DecSoft

Hello to all,

(Return is for returning using JavaScript, if I recall correctly).

That's correct!

Another elegant way could be to store an object as a sole option's line instead of multiple ones.

Another possible way too is to store objects/arrays using the StrSerialize and StrUnserialize actions.



Guest

Thanks for demo svanneste.
I got my program working, seems like I was reading old documentation, where setoption does not use a "String" as third parameter.

It was late at night, and I was rambling a bit.
Since we do not have real syntax checking in app builder, I am battling to find my bugs... Seems as if the best bet is to develop a very small bit in each .ab file, and then later add them all together.

ie. If you have a extra space in your setvar declaration, it can cause problems

I've decided to upgrade my internet explorer - so my view in appbuilder works. This does help a lot.
(I tend to forget to run the "inspect" when testing in Chrome.)


DecSoft

Hello to all,

Since we do not have real syntax checking in app builder, I am battling to find my bugs...

If you double click an action and they doesn't appear well in the action's editor, then the action's is not well formed. Anyway I will look into a possible syntax check in AB: I certainly think possible to do something about this.



DecSoft

Hello to all,

Here introducing the new App Builder's compiler syntax checker:


2017.6 (01/18/2017)

* Introducing the new App Builder's runtime syntax information. In combination with the App Builder's compiler syntax checker App Builder place now information about malformed actions in runtime in the integrated debugger console and others browsers' console.

* Introducing the new App Builder's compiler syntax checker. The Compiler syntax checker inform us about malformed App Builder's actions syntax when debug or build our apps. The App Builder's compilers (both visual and command line) place now in the log error messages when find some malformed action.

https://www.youtube.com/watch?v=S9Jf7DulAak

Hope this can be useful for all us!

http://getappbuilder.com/



Guest

You're a star David!


DecSoft

Hello to all,

You're a star David!

Thanks you for your kindly words!


Todo el mundo puede leer el foro de soporte de DecSoft para aprender del mismo, sin embargo, sólo los clientes de DecSoft pueden abrir nuevos hilos. Compre una o más licencias de productos de DecSoft y obtendrá este y otros beneficios.

Este sitio utiliza "cookies" útiles para almacenar sus preferencias.

Bien. Ocultar esta nota. Obtener más información.