Page 1 of 1

PAGES ETC.

Posted: Sun Jan 14, 2018 10:34 pm
by Gpjma
Hello all.
Can I get some clarification please regarding the use of PAGES. I have read the excellent manual and looked over the code snippet on the forum although I haven't entered and run the code.
I have this code in a simple programme
PAGE C$ SET
PAGE C$ COLOR .3,.3,.3,1
BUTTON B$ TEXT "CALCULATE" AT 70,600 SIZE 140,40
FOR I= 1 TO 100 !NEXT I

GOTO 10
When I run this code the C$ Page appears but the button that I want there isn't.
I am sure its a simple thing but I cant see it unfortunately.
Also in this snippet I have a time delay, ie FOR I = 1 TO 100. This is to delay the return to line 10 but regardless of value the return is instantaneous.
Hope that you can advise.

Cheers and thanks :(
GPJMA

Re: PAGES ETC.

Posted: Mon Jan 15, 2018 1:45 pm
by Henko
Gpjma wrote:
Sun Jan 14, 2018 10:34 pm
Hello all.
Can I get some clarification please regarding the use of PAGES. I have read the excellent manual and looked over the code snippet on the forum although I haven't entered and run the code.
I have this code in a simple programme
PAGE C$ SET
PAGE C$ COLOR .3,.3,.3,1
BUTTON B$ TEXT "CALCULATE" AT 70,600 SIZE 140,40
FOR I= 1 TO 100 !NEXT I

GOTO 10
When I run this code the C$ Page appears but the button that I want there isn't.
I am sure its a simple thing but I cant see it unfortunately.
Also in this snippet I have a time delay, ie FOR I = 1 TO 100. This is to delay the return to line 10 but regardless of value the return is instantaneous.
Hope that you can advise.

Cheers and thanks :(
GPJMA
Hi,

In the presented piece of code , the button name b$ is empty (""), and causes a runtime error. If b$ is not empty, then the button is shown.

An empty for-next loop with 100 iterations takes less than 1 millisecond, i guess.
Use the PAUSE X statement, X being the # of seconds to pause, i.e. PAUSE 0.5