FiveWeb question

FiveWeb question

Postby Otto » Thu May 02, 2013 8:54 am

Hello Antonio,
is FiveWeb Syntax casesensitiv.


MsgInfo is working
@ 120, 160 BUTTON "One" SIZE 80, 50 OF oDlg ACTION MsgInfo( "test" )

msginfo compiles but then when you click on the button the button does not show a box.
@ 120, 160 BUTTON "One" SIZE 80, 50 OF oDlg ACTION msginfo( "test" )

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6135
Joined: Fri Oct 07, 2005 7:07 pm

Re: FiveWeb question

Postby Antonio Linares » Thu May 02, 2013 9:06 am

Otto,

Local actions (on the client side) are performed using javascript and javascript is case sensitive
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb question

Postby Otto » Thu May 02, 2013 9:14 am

Hello Antonio,
where do you suggest to look up the right spelling.
As you get no error this is for a beginner a pitfall.

Thank you for your work on FIVEWEB.
I decided yesterday to re-write our online booking with FiveWeb.

Best regards,
Otto
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6135
Joined: Fri Oct 07, 2005 7:07 pm

Re: FiveWeb question

Postby Antonio Linares » Thu May 02, 2013 1:03 pm

Otto,

The best tool that I use to check javascript errors, etc. is Chrome itself, as it has a wonderful sort of debugger/inspector that is fantastic! :-)

Just right click on a web page from Chrome and select "inspect element" and there you have a great "Console" option where you see javascript errors, etc.

Besides that, the web is plenty of javascript docs, just google for javascript "something" and you will get tons of info :-)

I will help you with FiveWeb as much as I can. Its not a perfect tool yet but with the help of FiveWeb users it will grow and become a great tool like FiveWin is :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb question

Postby Otto » Thu May 02, 2013 7:39 pm

Hello Antonio,

Otto.prg add data

If there is a space on the left or between the names the program errors out.
I made the tests with Chrome.
Best regards,
Otto

http://localhost/Cgi-bin/otto.exe?add:one%20space:one%20space:one%20space
********************************************************************
mod harbour - Vamos a la conquista de la Web
modharbour.org
https://www.facebook.com/groups/modharbour.club
********************************************************************
User avatar
Otto
 
Posts: 6135
Joined: Fri Oct 07, 2005 7:07 pm

Re: FiveWeb question

Postby Antonio Linares » Thu May 02, 2013 8:17 pm

Otto,

I think I know whats going on: When you call your EXE with spaces for params, then the app is receiving several params:

function Main( cParam1, cParam2, ... )

If they are all together, then we only get:

function Main( cParams )

thats where the error comes from. We could modify FiveWeb to detect and use both ways :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb question

Postby kokookao2007 » Sat May 18, 2013 2:48 am

hi Antonio :

I have a question for Fiveweb.

After edit value of tget , can't display new value.

Anything I miss ?

#include "FiveWeb.ch"

function Main()

local oDlg, cTEST:="TEST1234 ",oGET

DEFINE DIALOG oDlg TITLE "Hello FiveWeb" SIZE 600, 400

@ 20, 20 GET oGET VAR cTEST OF oDlg SIZE 300, 40

@ 120, 370 BUTTON "ok" SIZE 120, 50 OF oDlg ACTION ( msginfo( cTEST ) ,oDlg:END() )

ACTIVATE DIALOG oDlg

return nil


Change Value 'TEST1234' to 'TEST5678, msginfo() still display 'TEST1234' .
-------------
best regards
kokoo Kao
User avatar
kokookao2007
 
Posts: 59
Joined: Thu May 17, 2007 8:27 am

Re: FiveWeb question

Postby Antonio Linares » Sat May 18, 2013 6:43 am

Kokoo,

There is something important to learn about FiveWeb:

When you execute your code, xbase is translated into whatever and works :-) but you are no longer in your PRG execution. It happened, then you got your result and you are working locally, using javascript. So think about this: where is the variable defined ? In the PRG. And that code was already processed. Similar like when we create a dialog and run it as non modal. The variables are gone, out of scope :-)

Instead of your code, try:

MsgInfo( oGET.Value )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb question

Postby kokookao2007 » Mon May 20, 2013 12:38 am

Hi Antonio:

Thank you for Explanation about Fiveweb.

Tried: msginfo(oGet.Value) ==> compiler error

Tried: msginfo(oGet:nValue) ==> Return Null
-------------
best regards
kokoo Kao
User avatar
kokookao2007
 
Posts: 59
Joined: Thu May 17, 2007 8:27 am

Re: FiveWeb question

Postby Antonio Linares » Mon May 20, 2013 6:20 am

Javascript is case sensitive, so you have to write it exactly like this:

MsgInfo( oGet.value )
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb question

Postby codemaker » Wed May 22, 2013 12:30 am

Antonio Linares wrote:Kokoo,

There is something important to learn about FiveWeb:

When you execute your code, xbase is translated into whatever and works :-) but you are no longer in your PRG execution. It happened, then you got your result and you are working locally, using javascript. So think about this: where is the variable defined ? In the PRG. And that code was already processed. Similar like when we create a dialog and run it as non modal. The variables are gone, out of scope :-)

Instead of your code, try:

MsgInfo( oGET.Value )

Yes, this is a very good explanation of what kind of problems we are dealing with, when trying to use the special libraries to design web application.
Practically, each dialog we create and show on the screen, we can imagine/consider as having one HTML with a FORM in it. So once the dialog is shown on the screen, it's like we show the HTML with a form and we cannot go back to this dialog, unless we call the same function again. In this case it is not recursive call like in ordinary desktop application.

From the same reason we cannot see PRIVATE defined variable in a lower function - if we have function:
FUNCTION One()
PRIVATE abc
DEFINE DIALOG oDlg
@ 1,1 GET oGet VAR abc OF oDlg
@ 2,1 BUTTON oBut ACTION checkit()
ACTIVATE DIALOG oDlg
// We are actually here and returned to the calling function!!!!!!!
RETURN(NIL)

FUNCTION Checkit()
? abc // undefined!
RETURN(NIL)
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Re: FiveWeb question

Postby Antonio Linares » Wed May 22, 2013 7:20 am

Boris,

Anyhow we can send info from the client to the server too, so we could update the variable and send it back to the server, but we need to manage "sessions" for that. Something that we have not implemented yet.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb question

Postby kokookao2007 » Wed May 22, 2013 7:27 am

HI Antonio:

MsgInfo( oGET.Value )

Compiler error :
Compiling...
testget.prg(15) Error E0030 Syntax error "syntax error at '.'"
Harbour 3.2.0dev (Rev. 18805)
Copyright (c) 1999-2013, http://harbour-project.org/
Compiling 'testget.prg'...
1 error

No code generated.
* Compile errors *
-------------
best regards
kokoo Kao
User avatar
kokookao2007
 
Posts: 59
Joined: Thu May 17, 2007 8:27 am

Re: FiveWeb question

Postby Antonio Linares » Wed May 22, 2013 8:41 am

Kokko,

You have to call it from the ACTION of a control
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41462
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: FiveWeb question

Postby codemaker » Wed May 22, 2013 10:54 am

Antonio Linares wrote:Boris,

Anyhow we can send info from the client to the server too, so we could update the variable and send it back to the server, but we need to manage "sessions" for that. Something that we have not implemented yet.

You're right Antonio.
But this would require to change the programming logic. In such case we must relay on pure client/server logic to not refresh the entire user's screen every time we need the info about some variable or we change and save variables. On the server there must be an EXE which will receive the requests and deliver back the updated info to the user's screen (something like Data browse in Flex is doing)
Years ago I designed some app (licensing system) which communicates with some EXE running on server and sending back the new info after the request has been managed. Socket class.

Anyway, we all are eager to see the results for FiveWeb you are working on.
Speed it up Antonio, we need it :)
User avatar
codemaker
 
Posts: 208
Joined: Wed Dec 03, 2008 4:48 pm
Location: Belgrade, Serbia

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: richard-service and 135 guests