* *

Coding

Welcome, Guest. Please login or register.
Did you miss your activation email?
November 18, 2017, 12:41:33 PM

Login with username, password and session length

Menu

Members
Stats
  • Total Posts: 12175
  • Total Topics: 1736
  • Online Today: 52
  • Online Ever: 195
  • (February 11, 2014, 01:46:08 PM)
Users Online
Users: 0
Guests: 33
Total: 38
Baidu (5)

Author Topic: Program termination  (Read 3298 times)

0 Members and 1 Guest are viewing this topic.

Offline PK

  • Newbie
  • *
  • Posts: 13
  • Bananas: 0
  • Gender: Male
  • I haven't set any personal text yet
Program termination
« on: August 30, 2013, 01:34:31 AM »
$main program
        |
window1 - (program can be stopped with built in  closer
        |
procedure for window1 - (program can be stopped by setting run = 0)
        |
global program 2
        |
window2 - (program can not be stopped with built in  closer)
        |
procedure for vwindow2 - (program can not be stopped  wiuth built in closer or by setting run = 0)

Any suggestions as to what I havedone wrong would be appreciated

Thanks

Offline Larry McCaughn

  • Head Monkey
  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
  • Bananas: 4
  • Gender: Male
Re: Program termination
« Reply #1 on: August 30, 2013, 06:02:05 AM »
you'll have to post all the code.
Admin - Here and @ Ionic Wind Software Forums
Author of Custom Button Designer, Custom Chart Designer, Snippet Manager, and IWB+ (A Visual Designer for IWBasic 2.x/3.x)

Offline PK

  • Newbie
  • *
  • Posts: 13
  • Bananas: 0
  • Gender: Male
  • I haven't set any personal text yet
Re: Program termination
« Reply #2 on: August 30, 2013, 08:04:06 PM »
Is there a way of posting the code without having to type it in?

Offline Larry McCaughn

  • Head Monkey
  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
  • Bananas: 4
  • Gender: Male
Re: Program termination
« Reply #3 on: August 30, 2013, 08:20:22 PM »
paste it
or put the source files in a zip and attach it.
« Last Edit: August 30, 2013, 10:49:58 PM by Larry McCaughn »
Admin - Here and @ Ionic Wind Software Forums
Author of Custom Button Designer, Custom Chart Designer, Snippet Manager, and IWB+ (A Visual Designer for IWBasic 2.x/3.x)

Offline PK

  • Newbie
  • *
  • Posts: 13
  • Bananas: 0
  • Gender: Male
  • I haven't set any personal text yet
Re: Program termination
« Reply #4 on: August 31, 2013, 01:23:59 AM »
Sorry to be a nuisance but copy/paste will not work and i can not find any way to attach a file to a post.

Offline Larry McCaughn

  • Head Monkey
  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
  • Bananas: 4
  • Gender: Male
Re: Program termination
« Reply #5 on: August 31, 2013, 01:30:41 AM »
The following lines of code are copied and pasted:
 RegisterButtonSuperclass()
 openwindow w1,0,0,300,300,@sysmenu,0,"Caption",&w1_handler
 int r=12
 CONTROL w1,@BUTTON,"Button1",6,r,80,30,0x50010000,1
 CONTROL w1,@BUTTON,"Button2",104,r,80,30,0x50010000,2
 CONTROL w1,@BUTTON,"Button3",198,r,80,30,0x50010000,3
 r=50
 CONTROL w1,@RGNBUTTON,"Button1",6,r,87,30,0x50010000,1024
 CONTROL w1,@RGNBUTTON,"Button2",104,r,87,30,0x50010000,1025
 CONTROL w1,@RGNBUTTON,"Button3",198,r,87,30,0x50010000,1026
and I have attached a zip of a source file so I'm not understanding what your problem is..
« Last Edit: August 31, 2013, 01:31:15 AM by Larry McCaughn »
Admin - Here and @ Ionic Wind Software Forums
Author of Custom Button Designer, Custom Chart Designer, Snippet Manager, and IWB+ (A Visual Designer for IWBasic 2.x/3.x)

Offline PK

  • Newbie
  • *
  • Posts: 13
  • Bananas: 0
  • Gender: Male
  • I haven't set any personal text yet
Re: Program termination
« Reply #6 on: August 31, 2013, 03:58:01 AM »
set up as a project

$MAIN
$INCLUDE "TestGlobals.eba"
AUTODEFINE "Off"
   OPENWINDOW TestA,0,0,1600,800,@SIZE|@MINBOX|@MAXBOX,0,"Test A Window",&TestMain
   CONTROL TestA,@BUTTON,"Continue",350,600,60,20,@TABSTOP|@CTLBTNDEFAULT,1
   CONTROL TestA,@BUTTON,"Exit",700,600,50,20,@TABSTOP|@CTLBTNDEFAULT,2
   Run = 1
   WAITUNTIL Run = 0
END

GLOBAL SUB TestMain()
   DEF Dum1 as INT
   DECLARE EXTERN Test1()
   SELECT @MESSAGE
      CASE @IDCLOSEWINDOW
         Run=0   
      CASE @iDCONTROL
      SELECT @CONTROLID
         CASE 1
            Dum1 = MESSAGEBOX(TestA,"Case A-1","Case 1A")
            GOSUB Test1
         CASE 2
            Dum1 = MESSAGEBOX(TestA,"Case A-2","Case 2A")
            CLOSEWINDOW TestA
            Run = 0
      ENDSELECT
   ENDSELECT
ENDSUB
____________________end of prog 1____________________

GLOBAL SUB Test1()
$INCLUDE "TestGlobals.eba"
   SHOWWINDOW TestA,@SWHIDE
   OPENWINDOW TestB,0,0,1600,800,@SIZE|@MINBOX|@MAXBOX,0,"Test B Window",&Test1Main
   CONTROL TestB,@BUTTON,"Continue",350,600,60,20,@TABSTOP|@CTLBTNDEFAULT,1
   CONTROL TestB,@BUTTON,"Exit",700,600,50,20,@TABSTOP|@CTLBTNDEFAULT,2
   Run2 = 1
   WAITUNTIL Run2 = 0
   SHOWWINDOW TestA,@SWRESTORE
ENDSUB

GLOBAL SUB Test1Main()
$INCLUDE "TestGlobals.eba"
   DEF Dum3 AS INT
   SELECT @MESSAGE
      CASE @IDCLOSEWINDOW
         Run2 = 0   
      CASE @iDCONTROL
      SELECT @CONTROLID
         CASE 1
            Dum3 = MESSAGEBOX(TestB,"Case B-1","Case 1B")
         CASE 2
            Dum3 = MESSAGEBOX(TestB,"Case B-2","Case 2B")
            CLOSEWINDOW TestB
            Run2 = 0
      ENDSELECT
   ENDSELECT
_______________________-end of prog 2 ________________
'global variables accessable to all modules
PROJECTGLOBAL "on"
   INT Run
   INT Run2
   WINDOW TestA
   WINDOW TestB
PROJECTGLOBAL "OFF"

Offline Larry McCaughn

  • Head Monkey
  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
  • Bananas: 4
  • Gender: Male
Re: Program termination
« Reply #7 on: August 31, 2013, 12:30:55 PM »
for starters you can have only one WAITUNTIL in the project.
you had both window handlers with the same name
you had your $include statements in the wrong locations
I tried to maintain the general structure you started with to minimize confusion but your overall structure is not the way I would have done it but that is okay.
 

Code: [Select]
$MAIN
AUTODEFINE "Off"
$INCLUDE "TestGlobals.eba"
 
 
 OPENWINDOW TestA,0,0,1600,800,@SIZE|@MINBOX|@MAXBOX,0,"Test A Window",&TestMain
   CONTROL TestA,@BUTTON,"Continue",350,600,60,20,@TABSTOP|@CTLBTNDEFAULT,1
   CONTROL TestA,@BUTTON,"Exit",700,600,50,20,@TABSTOP,2
   INT Run = 1
   WAITUNTIL Run = 0
 CLOSEWINDOW TestA
END

SUB TestMain(),INT
   SELECT @MESSAGE
 case @IDCREATE
   centerwindow TestA
      CASE @IDCLOSEWINDOW
         Run=0   
      CASE @iDCONTROL
      SELECT @CONTROLID
         CASE 1
            MESSAGEBOX(TestA,"Case A-1","Case 1A")
            Test1()
         CASE 2
            MESSAGEBOX(TestA,"Case A-2","Case 2A")
            Run = 0
      ENDSELECT
   ENDSELECT
 return 0
ENDSUB
____________________end of prog 1____________________

$INCLUDE "TestGlobals.eba"
GLOBAL SUB Test1()
   SHOWWINDOW TestA,@SWHIDE
   OPENWINDOW TestB,0,0,1600,800,@SIZE|@MINBOX|@MAXBOX,0,"Test B Window",&TestB_handler
   CONTROL TestB,@BUTTON,"Continue",350,600,60,20,@TABSTOP|@CTLBTNDEFAULT,1
   CONTROL TestB,@BUTTON,"Exit",700,600,50,20,@TABSTOP,2
ENDSUB

SUB TestB_handler(),int
   SELECT @MESSAGE
  case @IDCREATE
   centerwindow TestB
      CASE @IDCLOSEWINDOW
   SHOWWINDOW TestA,@SWRESTORE
   CLOSEWINDOW TestB 
      CASE @iDCONTROL
      SELECT @CONTROLID
         CASE 1
            MESSAGEBOX(TestB,"Case B-1","Case 1B")
         CASE 2
            MESSAGEBOX(TestB,"Case B-2","Case 2B")
    SHOWWINDOW TestA,@SWRESTORE
            CLOSEWINDOW TestB
      ENDSELECT
   ENDSELECT
 return 0
endsub
_______________________-end of prog 2 ________________
'global variables accessable to all modules
PROJECTGLOBAL "on"
   WINDOW TestA
   WINDOW TestB
PROJECTGLOBAL "OFF"
DECLARE EXTERN Test1()
« Last Edit: September 02, 2013, 09:33:35 AM by Larry McCaughn »
Admin - Here and @ Ionic Wind Software Forums
Author of Custom Button Designer, Custom Chart Designer, Snippet Manager, and IWB+ (A Visual Designer for IWBasic 2.x/3.x)

Offline BillBo

  • Newbie
  • *
  • Posts: 20
  • Bananas: 0
Re: Program termination
« Reply #8 on: September 02, 2013, 01:34:08 AM »
LarryMc,

How do you copy code that in a reply window? QB64.net has a "select" and at thinBasic.com you just double click on the code. Sure is a pain to use the mouse to copy it from top to bottom.

Bill

Offline Larry McCaughn

  • Head Monkey
  • Administrator
  • Sr. Member
  • *****
  • Posts: 259
  • Bananas: 4
  • Gender: Male
Re: Program termination
« Reply #9 on: September 02, 2013, 09:35:26 AM »
when the code is not flagged as code then you have to copy it like plain text.
when it is flagged as code you simply click "select" and then control-c
 
Admin - Here and @ Ionic Wind Software Forums
Author of Custom Button Designer, Custom Chart Designer, Snippet Manager, and IWB+ (A Visual Designer for IWBasic 2.x/3.x)

Offline BillBo

  • Newbie
  • *
  • Posts: 20
  • Bananas: 0
Re: Program termination
« Reply #10 on: September 02, 2013, 11:25:44 AM »
Thanks, Larry.
Bill

Offline PK

  • Newbie
  • *
  • Posts: 13
  • Bananas: 0
  • Gender: Male
  • I haven't set any personal text yet
Re: Program termination
« Reply #11 on: September 10, 2013, 08:02:06 PM »
Thanks for your help in solving my problem'

PK

 

To link to us use this code/button on your site

http://www.codingmonkeys.com/images/cm_link.gif

ShoutBox!

 

lurkalot

September 20, 2017, 01:57:54 PM
Hey that's my job. Didn't choose this username for nothing you know.  :)
 

Larry McCaughn

September 19, 2017, 12:24:13 AM
lurking in the shadows, lurkalot.
 

lurkalot

September 16, 2017, 04:39:43 PM
Good evening all.  Where is everyone?
 

lurkalot

September 12, 2017, 12:57:36 PM
Good to hear, it's nice to see a empty error log. ;)
 

Blue Steel

September 12, 2017, 05:04:25 AM
running sites log files overnight heres the result (I know mainly spiners) "There are currently no error log entries." :)
 

lurkalot

September 12, 2017, 03:19:33 AM
Morning all.  :)
 

Blue Steel

September 12, 2017, 01:12:33 AM
Let it all out ..
these are the things I can't do without  ;)

MikeHart

September 11, 2017, 11:14:22 PM
SHOUT SHOUT  :)
 

GWS

September 11, 2017, 08:16:02 PM
Shouting is Go !  ;D
 

Blue Steel

September 11, 2017, 06:54:02 PM
gradually getting there
 

lurkalot

September 11, 2017, 05:22:46 PM
Yay, you found it.  ;)
 

Larry McCaughn

September 11, 2017, 01:07:13 PM
looks like you're making good progress
 

Blue Steel

September 07, 2017, 10:34:19 PM
yay recent topics are working again in the center of the home page :)
 

Larry McCaughn

July 12, 2017, 05:46:33 PM
Blue Steel is back running the show.  Maybe he'll be able to build some steam in the ole place!
 

Blue Steel

June 26, 2017, 04:58:41 AM
hope i didn't scare too many of you
 

Blue Steel

June 26, 2017, 04:58:12 AM
Boo, i'm still here alive and well , see my post in introductions

MikeHart

July 25, 2016, 01:43:24 AM
That sounds cool. Have to chekc out IWBasic in the next days.
 

Larry McCaughn

July 22, 2016, 11:47:00 PM
I'm hoping to issue a new maintenance release to the IWBasic 3.x IDE in the next few weeks and Larry Sikes has released an update to the Linux version of IWBasic and is currently working on the 64bit version of IWBasic.  Progress should speed up since he has retired and has apparently resolved his m

MikeHart

July 19, 2016, 02:53:02 PM
Anything interesting going on around BASIC?
 

Larry McCaughn

July 18, 2016, 09:14:12 AM
Hello Mike

MikeHart

July 16, 2016, 04:33:25 PM
Hi there all!
 

pistol350

June 24, 2016, 03:41:10 AM
Hello all!
I'm still around although less active!
 

Blue Steel

September 08, 2013, 09:34:55 AM
first page of games in arcade are fixed. only 12 more pages to go
 

Blue Steel

September 08, 2013, 08:41:09 AM
Cleared all highscores on the games . i've been asked to see if i can fix them all. please PM me if you find a game in the arcade that doesn't work, there are way too many for me to go through each and every game.