1380:VALUE ERROR: ....

MiServer is Dyalog's APL-based web development framework

1380:VALUE ERROR: ....

Postby Gantois on Tue Feb 21, 2017 2:47 pm

Hi !

what could I do to avoid the following error:
1380:VALUE ERROR: No result was provided when the context expected one

DoAction[28] q_numq←(1+⍎⍕q_numq)⌊iprova.TotalQuestoes idprova

This error occurs when the user has no action in browser for some period of time. I think I have to take action in "onSessionEnd" to "close" the section variables active, but I don't know how to do this.

Thanks,
Marco
Gantois
 
Posts: 80
Joined: Thu Apr 17, 2014 9:44 am

Re: 1380:VALUE ERROR: ....

Postby kai on Wed Feb 22, 2017 2:13 pm

You need to look at ⎕VFI.

However, the statement ⍎⍕q_numq means that something is wrong here. If the variable is numeric, something the name seams to suggest, then there is no need to make it text and then execute the text.

If it is text then there is no need for the ⍕.

If you don't know whether it is numeric or not then make sure that you do.
User avatar
kai
 
Posts: 137
Joined: Thu Jun 18, 2009 5:10 pm
Location: Hillesheim / Germany

Re: 1380:VALUE ERROR: ....

Postby Gantois on Wed Feb 22, 2017 11:47 pm

Hi Kai,

Thanks for your response.
My problem is not specifically this instruction but the fact that an error occurs whenever the user has no action in browser for some period of time. this can occurs in another instruction using variables passed between server and browser.

Greetings
Gantois
 
Posts: 80
Joined: Thu Apr 17, 2014 9:44 am

Re: 1380:VALUE ERROR: ....

Postby Brian|Dyalog on Fri Apr 07, 2017 3:54 pm

Hi Marco,

The situation is probably that the user's session timed out. When that happens, all the instances of pages that are kept with the user's session are expunged. However, the browser doesn't know anything about what happens on the server side, so, it just submits the request.
When the request is received by the server, it creates a new instance of the page (but of course, without the variables that where set up in the previous instance). That's the reason for the VALUE ERROR.

Here are a couple of ways to address this.
  1. Code defensively - check for the existence of the variables, or provide an error trap, that will have the user log in again, or do whatever to reestablish the environment he needs to run in.
  2. Create a constructor for the page that sets a flag to indicate this is a new page instance. Then check that flag when the page's code is executed.

    Code: Select all
      ∇make
    :Access Public
    :Implements Constructor
      NewPage←1
      ∇

    Then in your page's code, do something like:
    Code: Select all
    :If NewPage=1
      :If   ⍝ we're just rendering the page for the first time
            ⍝ or we don't have variables whose existence we depend on
        NewPage←0
        ⍝ Normal processing here
      :Else
        ⍝ redirect the user or reestablish the variables here
      :EndIf
    :EndIf

I hope this helps!
/Brian
User avatar
Brian|Dyalog
 
Posts: 116
Joined: Thu Nov 26, 2009 4:02 pm
Location: West Henrietta, NY

Re: 1380:VALUE ERROR: ....

Postby Gantois on Tue Apr 11, 2017 11:38 am

Thanks Brian
Att, Marco
Gantois
 
Posts: 80
Joined: Thu Apr 17, 2014 9:44 am


Return to MiServer

Who is online

Users browsing this forum: No registered users and 1 guest