V8 beta

Previous topic - Next topic

Slydog

The link in the first post is to version 8.050, but the current beta is 8.064.
I understand that you just download the older version, and run an update from GLBasic and it will find and install the lastest beta.
Except, my computer at work might have a firewall setup (or other security) and GLBasic keeps saying I have the latest version.

Is there a manual / alternative way to install the 8.064 update?  Is it available as a file?
Not a problem as I do my programming from home, would just like the new Extended Type features at work in case I need to do a quick edit to see / test something.

And, am I the only one who gets errors clicking any of the links in the 'Web' menu?
It comes up as this (in Firefox):
http://\\www.glbasic.com\main.php/?site=news&lang=en
The slashes are the wrong ones (plus 2 additional).
No problem, as I know where to go by hand, just wondering.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

MrTAToad

The links work here okay - what browser are you using ?

Slydog

#167
I use Firefox (3.6.3).

I'm in Canada, could it be a regional thing (it shouldn't because URLs are universal).
Or other setting?  (ha, but what?  Security?)

Do your URLs come out as: (slashes backwards, with preceding slashes too, without the 'http://')
\\www.glbasic.com\main.php

That may explain my update problem too perhaps, as maybe the update URL is causing a problem.

But I also use Firefox on both my home computers and update works fine.
But, I can't remember checking the 'Web' menu's other links, I'll try tonight when I get home.  (I'm 6 hours behind Germany!)

[Edit]
In case it matters, I use XP at work, and Windows 7 at home.
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]


Slydog

Yep, the links work fine from home, but I'm using 8.064 (and 8.050 at work because I can't upgrade).
My current project (WIP) :: TwistedMaze <<  [Updated: 2015-11-25]

Hatonastick

So does this mean v8 is out of beta now?  Just saw this at the top of the forum: *NEW* Current Version:  8.078 release (get setup).

Where do we get it from?  I realise I might be a bit early in asking this as from the looks of it Kitty hasn't had time to update the official website download yet. :)

If it's not out of beta, I'm guessing I just go to the usual beta download link.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Quentin

did you already try the normal update function within the editor? This worked for the last beta updates.

Ian Price

#172
You can't update from v7.XXX to the new v8.XXX via the usual "INTERNET UPDATE" method - GLBasic produces an error message and bugs out (on Windows 7 anyway). Looking at the site's log file, versi 8.050 was non-beta and it's been updated a couple of times since. The new download is available here - http://www.glbasic.com/main.php?lang=en&site=download It states that it's v7, but it is actually v8.
I came. I saw. I played.

Quentin

right, I took it that some version of 8.0xx Beta was already installed :)

MrTAToad

Yes, but not for the latest version (assuming the version number is correct :) )

jaywat

#175
Editing my post about 6th or 7th time...

Kitty, I've been testing GLB_ON_PAUSE and GLB_ON_RESUME which you implemented per my bug report here.

First: unlike GLB_ON_QUIT, typing the sub name in lowercase isn't automatically being converted to upper case and recognised, but assuming you put them in upper case, they're being recognised.

Also, these subs don't get called when in debug mode. Is that by design for some reason?

Now, my main issue is, what am I supposed to PUT in GLB_ON_PAUSE?

Here's why I'm asking: With my test code on windows, I successfully put it into pause, but then the app would absolutely not come out of pause. So much so, that using task manager to shut it wouldn't. I managed to shut GLBasic Editor, but the app was still open! No amount of convincing task manager would close it, all it did was bring the app window back up, albeit the title still said <paused>. Worse still, it limited my mouse movement to some little corner of the screen. In the end, I had to reboot my pc!

Now, I *think* I may know why...

in my GLB_ON_PAUSE, after writing a timestamp to a log file, I did:

WHILE TRUE

HIBERNATE

WEND

Because I figured I had to *do* something while paused... but as we know, using SHOWSCREEN while the app is a background task on iPhone kills the app stone dead. But I forgot that if you write a while loop with no showscreen, it tends to kill the app (didn't know if you knew that? always happens to me). And that's why I think my app killed itself so badly - it was paused, but crashed, and could neither continue execution nor be made to exit. Mind you, it'd really help if it could be made that if I screw up the code that badly it didnt require a reboot to continue!

I'm about to try it without a while loop at all. I'll update here in a few minutes or longer if I have to reboot again! :p

EDIT 4: Ok. If you put a while loop in GLB_ON_RESUME *with* showscreen, the app hangs before it ever starts (I wanted to print 'press a key to continue...' or whatever)

So, my test code atm, JUST writing a log file with a time stamp when I pause, when I resume and when I quit is working fine, but it hangs quite nastily if GLB_ON_PAUSE or GLB_ON_RESUME has any kind of loop.


[EDIT 5: Ok, the mouse problem reoccurred when I tried to circumnavigate the problem with using a while loop in GLB_ON_RESUME by using a PRINT, SHOWSCREEN then MOUSEWAIT instead. It seems to create problems. The mouse cursor gets locked to a part of the screen, and at the same time, it exhibits the same crash problem. Basically, SHOWSCREEN in GLB_ON_RESUME is a definite no-no - it causes the app to crash before it even executes the first time, and apparently so is MOUSEWAIT.  Also, GLB_ON_RESUME is being called the instant the app starts (and failing if I have a loop in there).]

I think I can work round that by setting flags and testing the code elsewhere, but (a) some clarification on what you can and cant do with GLB_ON_RESUME and GLB_ON_PAUSE would be nice, and (b) if you can, prevent nasty hang protection if I do something I shouldn't in code!

Does GLB_ON_PAUSE only fire once and halt at the end of code execution within it? therefore I don't need any kind of loop? And after GLB_ON_RESUME, the app would continue from where it left off? If so, in practice, I don't need ANY code, if I just want to pause and resume from where I was? Right?

If that's not how they work, please explain! Thanks.

Even if that is how they work, I think there's a few problems with them atm.

[EDIT... whatever... I've lost count... :

Oh hang on... because of how it's explained in the user manual, I assumed that GLB_ON_RESUME and GLB_ON_PAUSE were only called *IF* AUTOPAUSE TRUE was set... but that's not the case. They're being called ANYWAY. So it may be the combination of AUTOPAUSE and having SHOWSCREEN/MOUSEWAIT that's screwing things up. But I digress... I'll await some responses from Kitty!]

-----

Here's some lame but useful test code, especially since you cannot debug these new SUBs. It includes 3 commented out ways to kill your app (and possibly your pc...), and also conclusively proves that GLB_ON_RESUME is being called BEFORE the app starts the first time through. Do feel free to try with and without AUTOPAUSE TRUE set, too!

Code (glbasic) Select

AUTOPAUSE TRUE
GLOBAL logfile$
GLOBAL pause$
GLOBAL resume$
GLOBAL quit$
GLOBAL time$
GLOBAL hasResumed


logfile$ = PLATFORMINFO$("DOCUMENTS") + "/logfile.dat"

start:

getDetails()

hasResumed = FALSE // if you remove this, you'll see that hasResumed, which is only set TRUE in GLB_ON_RESUME, is true when the app is first executed.
WHILE TRUE
IF hasResumed = TRUE
PRINT "Successfully resumed!",0,0
ENDIF
showDetails()
SHOWSCREEN
WEND


FUNCTION getDetails:

INIOPEN logfile$
pause$ = "PAUSE LOG: " + INIGET$("PAUSE","PAUSE")
resume$ = "RESUME LOG: " + INIGET$("RESUME","RESUME")
quit$ = "QUIT LOG: " + INIGET$("QUIT","QUIT")
INIOPEN ""

ENDFUNCTION


FUNCTION showDetails:

LOCAL logExist

logExist = DOESFILEEXIST(logfile$)

IF logExist = FALSE
PRINT "NO LOG FILE!",0,20
ELSEIF logExist = TRUE
PRINT "LOG FILE FOUND...",0,20
PRINT "Results of last test...",0,40
PRINT pause$,0,70
PRINT resume$,0,100
PRINT quit$,0,130
ENDIF

ENDFUNCTION


SUB GLB_ON_RESUME:

time$ = MID$(PLATFORMINFO$("TIME"),11,-1)
INIOPEN logfile$
INIPUT "RESUME","RESUME","GLB_ON_RESUME @ " + time$
INIOPEN ""

hasResumed = TRUE


// NEVER, EVER DO THIS!!!!
// PRINT "I have successfully resumed from pause!",0,0
// PRINT "Touch to resume...",0,20
// SHOWSCREEN
// MOUSEWAIT



// AND NEVER, EVER DO THIS!!!

//WHILE TRUE
// PRINT "I have successfully resumed from pause!",0,0
// PRINT "Touch to resume...",0,20
// SHOWSCREEN // testing showscreen called WITHIN resume.... nope, that doesnt work!
//WEND

getDetails()

ENDSUB

SUB GLB_ON_PAUSE:

hasResumed = FALSE
time$ = MID$(PLATFORMINFO$("TIME"),11,-1)
INIOPEN logfile$
INIPUT "PAUSE","PAUSE","GLB_ON_PAUSE @ " + time$
INIOPEN ""


// WATCH, WHILE I KILL YOUR APP DEAD...

// WHILE TRUE
// HIBERNATE
// WEND

ENDSUB

SUB GLB_ON_QUIT:

time$ = MID$(PLATFORMINFO$("TIME"),11,-1)
INIOPEN logfile$
INIPUT "QUIT","QUIT","GLB_ON_QUIT @ " + time$
INIOPEN ""

ENDSUB

MrTAToad

#176
By the looks of it, PAUSE is called once when the window loses focus (and not just minimised) whilst RESUME is called twice when the window has focus again.  No idea why its twice  :blink:

Would be nice if those two subroutines were available in debug mode.

As far as I can tell, it looks like the program will stay in a suspension loop once the pause routine has finished.  It might be best to treat these like ON_QUIT and not do any graphics or such like once called.

Here's a little test program for you :

Code (glbasic) Select
GLOBAL a%,b%,c%

AUTOPAUSE TRUE

a%=0
b%=0
c%=0

WHILE TRUE
PRINT "MAIN LOOP:"+a%+" ON_PAUSE:"+b%+" ON_RESUME:"+c%,0,0
SHOWSCREEN
HIBERNATE
INC a%
WEND

SUB GLB_ON_PAUSE:
INC b%
ENDSUB

SUB GLB_ON_RESUME:
INC c%
ENDSUB


You will notice that the ON_RESUME variable increases twice after a window has been restored.  However, if you compile for full screen then the ON_RESUME variable only increases once.


jaywat

#177
Quote from: MrTAToad on 2010-Aug-24
As far as I can tell, it looks like the program will stay in a suspension loop once the pause routine has finished.  It might be best to treat these like ON_QUIT and not do any graphics or such like once called.

I would agree this makes sense for GLB_ON_PAUSE, but I would have thought the point of GLB_ON_RESUME was that the program has resumed execution now, and therefore it would be entirely reasonable to display a 'click to resume' screen or something. I mean, ok, I can set a 'hasResumed' flag in GLB_ON_RESUME and jump to a pause screen from elsewhere in the code, but still, it seems that really, GLB_ON_RESUME actually HASNT resumed when it fires, or surely a SHOWSCREEN wouldnt have such dire consequences for your app?

The reason for doing the code example I did is because it's most close to what I actually want to do. That is: on an iPhone, I want to support PAUSE and RESUME from multi-tasking. Which, by the looks of it, for a straight PAUSE/RESUME, I literally wouldn't need to execute any code, other than save the game state.

Why even do that? Well, what if they put it into pause (ie, multi-tasking bar) and then never resume the app, but kill it instead? I can't save if they never resume. So I want to save on pause, and IF there's a savestate file, reload ONLY when the app is restarted afresh, NOT on RESUME. Although since GLB_ON_RESUME is called when the app is started fresh, I explicitly have to code round that.

That's not to mention that iPhone seems to treat ANY exit as a pause, rather than a quit, if the device is multi-tasking capable.

I think I still *could* do right now, assuming it works on iPhone. Just got to be extremely careful about how I code it to not do any of the things that will crash the app!

Hatonastick

#178
Quote from: Quentin on 2010-Aug-24
right, I took it that some version of 8.0xx Beta was already installed :)
Yup which it is.  However running the updater on mine (currently version 8.064) it says it's up-to-date.  What Ian has posted was the information I was after ie. that even though the download webpage says 7 it is in fact 8.  Download limits + slow broadband speed = I like to make sure before I grab 130Mb or so. :)

PS Congratulations Gernot on such an awesome amount of work you've done on the upgrade from version 7 to 8.  :good: :booze:
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

MrTAToad

#179
QuoteI mean, ok, I can set a 'hasResumed' flag in GLB_ON_RESUME and jump to a pause screen from elsewhere in the code, but still, it seems that really, GLB_ON_RESUME actually HASNT resumed when it fires, or surely a SHOWSCREEN wouldnt have such dire consequences for your app?
Quite a few operating systems like to cause trouble when a windows focus is lost (DirectX being one of them).  For Apple machines, like ON_QUIT, you've probably only got a few microseconds to do anything before your program is forced to be minimised.

Setting a flag for the main program to deal with is probably the best way of maintaining compatibility (and ease) across all platforms.

Would be good to get it up and running for Mac and Linux too!