
Quote from joferar333 on July 11, 2023, 10:56 am@Luishp
He creado una rutina para poder determinar una franja horaria.. pero no logro poder tomar el resultado y convertirlo en una variable para poder usar
dentro de la app...
He creado una rutina para poder determinar una franja horaria.. pero no logro poder tomar el resultado y convertirlo en una variable para poder usar
dentro de la app...


Quote from roccocogliano on July 11, 2023, 11:14 amHi @joferar333 ,
You can use a variable outside the beginjs ... endjs block and refer to it with '$App' in block.e.g.setvar [fasciaoraria] "" beginjs var now = new Date(); var hour = now.getHours(); if (hour >= 0 && hour < 8) { $App.fasciaoraria = "anterior" } else { $App.fasciaoraria = "actual" } endjs .. now [fasciaoraria] contains your value jsalert [fasciaoraria]
Hi @joferar333 ,
setvar [fasciaoraria] ""
beginjs
var now = new Date();
var hour = now.getHours();
if (hour >= 0 && hour < 8) {
$App.fasciaoraria = "anterior"
} else {
$App.fasciaoraria = "actual"
}
endjs
.. now [fasciaoraria] contains your value
jsalert [fasciaoraria]

Quote from joferar333 on July 11, 2023, 11:26 amHi @roccocogliano
THANKS!!!!, Fix my problem and new found OK!
Best Regards
Hi @roccocogliano
THANKS!!!!, Fix my problem and new found OK!
Best Regards

Quote from roccocogliano on July 11, 2023, 11:32 am@joferar333 however you don't need javascript to do what you want to do. e.g.
setvar [fasciaoraria] "" SetVar [ora] [NAB.Hour24] IfEx [ora] >= 0 and [ora] < 8 setvar [fasciaoraria] "anterior" else setvar [fasciaoraria] "actual" endif jsalert [fasciaoraria]
@joferar333 however you don't need javascript to do what you want to do. e.g.
setvar [fasciaoraria] ""
SetVar [ora] [NAB.Hour24]
IfEx [ora] >= 0 and [ora] < 8
setvar [fasciaoraria] "anterior"
else
setvar [fasciaoraria] "actual"
endif
jsalert [fasciaoraria]

Quote from joferar333 on July 11, 2023, 10:18 pmHola @roccocogliano
Thanks once again, you're right, I hadn't thought about it... but I implemented it that way and it was perfect.
I abuse your generosity if you can and when you can take a look at this post
https://visualneo.com/forum/topic/ejecuta-sentencia-y-suma-columna-perfecto-pero-muestra-el-resultado-malformado-en-la-variable
I am stopped since I need to be able to achieve this situation to be able to continue with the development of an app
I executed the action and added the column of the perfect table but the variable that brought me was not the number of the sum but also brackets and others...
(as seen in the video...)
@luishp corrected me and sent a routine to add to it and from there it no longer adds to me...
There is the source attached to the post, which is very, very small since it only focuses on that function, maybe you can give me some light, I will also wait for Luis to verify what is wrong in the routine that causes it not to be executed.
Once again a thousand thanks and a cordial hug from Argentina.
Hola @roccocogliano
Thanks once again, you're right, I hadn't thought about it... but I implemented it that way and it was perfect.
I abuse your generosity if you can and when you can take a look at this post
https://visualneo.com/forum/topic/ejecuta-sentencia-y-suma-columna-perfecto-pero-muestra-el-resultado-malformado-en-la-variable
I am stopped since I need to be able to achieve this situation to be able to continue with the development of an app
I executed the action and added the column of the perfect table but the variable that brought me was not the number of the sum but also brackets and others...
(as seen in the video...)
@luishp corrected me and sent a routine to add to it and from there it no longer adds to me...
There is the source attached to the post, which is very, very small since it only focuses on that function, maybe you can give me some light, I will also wait for Luis to verify what is wrong in the routine that causes it not to be executed.
Once again a thousand thanks and a cordial hug from Argentina.