Page 1 of 1

Anybody having issue with web-debugging?

Posted: Friday 29th April 2022 11:06am
by crevilla
Hello,

A couple of days ago I got an update for gambas. Since then, when I press "play" in my web-project, instead of opening the browser using gambas internal web server, it just shows me the html text in the debug window below in the IDE.
¿Is it not possible anymore to test web apps?

However, if I compile and place the .gambas file in my htdocs directory, it plays nicely and does what it is supposed to do.

I feel more lost than a penguin in Vegas...

Re: Anybody having issue with web-debugging?

Posted: Friday 29th April 2022 1:46pm
by cogier
Can you post an example of your code?

Re: Anybody having issue with web-debugging?

Posted: Friday 29th April 2022 9:55pm
by crevilla
I used the pre-defined form that you get once you create a new web project. Nothing added.

Code: Select all

'Gambas class file
Export

Public Sub WebButton1_Click()
  Message("This is a message box.")
End

Public Sub WebTimer1_Timer()
  WebLabel1.Text = Format(Now, "hh:nn:ss")
End

Public Sub WebForm_Open()
  WebTimer1_Timer
End

Re: Anybody having issue with web-debugging?

Posted: Saturday 30th April 2022 12:46pm
by cogier
You need to switch on the HTTP server. From the Debug Menu select Configuration.. and turn on the HTTP server.

Image

I changed your code slightly: -
' Gambas class file

Export

Public Sub WebButton1_Click()

  Message("This is a message box.")

End

Public Sub WebTimer1_Timer()

  WebLabel1.Text = Format(Now, "hh:nn:ss")

End

Public Sub WebForm_Open()

  WebTimer1.Start

End
Forum tip: - Use the 'gb' button when adding code, it looks better.
Image

Re: Anybody having issue with web-debugging?

Posted: Saturday 30th April 2022 9:44pm
by crevilla
THANK YOU!

You are a life saver, and will do code button next time.