COMO OBTENER EL RESULTADO - Forum

Forum Navigation
You need to log in to create posts and topics.

COMO OBTENER EL RESULTADO

@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...

 

Hi @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]

 

luishp has reacted to this post.
luishp

Hi @roccocogliano

 

THANKS!!!!, Fix my problem and new found OK!

Best Regards

 

@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]

 

luishp has reacted to this post.
luishp

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.