IonicWind Software

IWBasic => General Questions => Topic started by: arono on December 24, 2016, 01:38:59 PM

Title: Some questions by this IWBasic newbee
Post by: arono on December 24, 2016, 01:38:59 PM
Some questions I need help with.  Thanks in advance for any help you can provide.....

Once the Find pop-up window appears in the IDE screen, it covers up portions of my program code and it cannot be moved elsewhere on the screen as EBasic allowed.   Is there something I can do about this?  The Replace pop-up does allow for relocation but not Find.

Also, it would be nice (at least for me) if you could enter a string into the Find What field of the Find pop-up and then press Return, it could automatically do a Find First search rather than having to grab the mouse and click on Find First. 

The WAITKEY command does not pause my Windows-type program.  It's coded like this:  FLUSHKEYS:  WAITKEY

I have a program I imported from an Ebasic program.  I have this command it:
OPENWINDOW w,0,0,1600,1024,@MINBOX|@MAXBOX,0,"Test",&mainw   
It looks fine to me but I am getting the following warning messages which I don't understand:
File: t:\testbat.iwb (376) Warning: Argument 9 (mainw) does not match the declaration of IWBWNDPROC
Different return type: none, should be int
File: T:\IWBDev3\bin\iwbstd.incc (10) Warning: See previous declaration of IWBWNDPROC
Title: Re: Some questions by this IWBasic newbee
Post by: Brian on December 24, 2016, 02:22:52 PM
Your SUB mainw should be coded as:
SUB mainw(),INT
This subroutine should end with
RETURN 0
ENDSUB

Your FLUSHKEYS code, if indeed it is working like a GOSUB, should be
coded as FLUSHKEYS()

Brian
Title: Re: Some questions by this IWBasic newbee
Post by: LarryMc on December 24, 2016, 05:35:11 PM
Quote from: arono on December 24, 2016, 01:38:59 PM
Once the Find pop-up window appears in the IDE screen, it covers up portions of my program code and it cannot be moved elsewhere on the screen as EBasic allowed.   Is there something I can do about this?
No, But I probably can. I'll look into it and see how much trouble it will be to fix it.

Quote from: arono on December 24, 2016, 01:38:59 PM
Also, it would be nice (at least for me) if you could enter a string into the Find What field of the Find pop-up and then press Return, it could automatically do a Find First search rather than having to grab the mouse and click on Find First. 
Sounds like a reasonable request.  I'll look in to that as well.

Quote from: arono on December 24, 2016, 01:38:59 PM
The WAITKEY command does not pause my Windows-type program.  It's coded like this:  FLUSHKEYS:  WAITKEY
You say a "Windows-type" program. I don't know exactly what you mean by that.
The FLUSHKEYS and WAITKEY commands only work in 2D windows created with either the CREATESCREEN or ATTACHSCREEN command.

So, to help you I need more information or better yet a sample program that shows the problem.
Title: Re: Some questions by this IWBasic newbee
Post by: arono on December 26, 2016, 09:24:10 AM
Thanks for looking into my FIND wishes Larry.
Also, I had forgotten about the ATTACHSCREEN command which I have added.  WRITETEXT is working now.

I'm using the DEBUG option for the first time and according to the Help file, should work about the same as Ebasic.  However, I'm having the following problems:

   I inserted a STOP command, selected the BUILD menu and Build Single menu option, checked the Debug Build box and pressed the Create button.  The program was compiled.  Then I clicked the Debug Start/Continue button but nothing happened.  I then went to the Build menu and the Debug menu option was grayed out.  Apparently I'm not in debug mode .  Am I forgetting something?
Title: Re: Some questions by this IWBasic newbee
Post by: LarryMc on December 26, 2016, 09:28:35 AM
3.x currently doesn't have a working debugger. LarryS opted to work on the 64bit version instead.
Title: Re: Some questions by this IWBasic newbee
Post by: arono on December 26, 2016, 01:56:33 PM
Would it be safe to run the latest 2.x version to do debugging and 3.x to code and non-debug compiling/execution?
Title: Re: Some questions by this IWBasic newbee
Post by: LarryMc on December 26, 2016, 10:36:39 PM
IWB 2.5 was an interim version while I was working on the new IDE for IWB 3.x so it doesn't have a working debugger either.
I believe IWB2.0  may have had a working debugger. If not then IWB 1.737 was the last version which in essence was identical to EB 1.737.

But regardless; you can do a lot of debugging with a console window.  I vary seldom ever used debug when it was available and don't really miss it myself.

I wrote the entire IWB 3.x IDE in IWB without the use of debug mode.
Title: Re: Some questions by this IWBasic newbee
Post by: billhsln on December 27, 2016, 08:57:18 AM
When writing windows programs, I would open a console window and print stuff to it while the program was running to see where the problem might be.  You could also open a file and write to it, but file output is not as flexible as the console window.

Bill
Title: Re: Some questions by this IWBasic newbee
Post by: fasecero on December 27, 2016, 04:53:42 PM
QuoteWhen writing windows programs, I would open a console window and print stuff to it while the program was running to see where the problem might be.

that's my method too  :)
Title: Re: Some questions by this IWBasic newbee
Post by: ckoehn on December 30, 2016, 08:54:43 AM
It doesn't seem to work to print to a console window and a regular window at the same time.
Using the code below does work.  There is a link somewhere on this forum that mentions this.  I think it was from Paul.  I had to modify the code he had because I was getting some errors.


$INCLUDE "windowssdk.inc"

'You need to close the console window before ending the program
CLOSECONSOLE
END

'---- print text to console window -----------
SUB PrintConsole(text as string)
       STATIC UINT stdout
UINT charwritten

IF stdout=0
OPENCONSOLE
stdout=GetStdHandle(-11)
ENDIF
WriteConsole(stdout,text+"\n",len(text)+2,&charwritten,0)
ENDSUB


Later,
Clint
Title: Re: Some questions by this IWBasic newbee
Post by: arono on January 03, 2017, 10:22:36 AM
Thanks ckoehn for the info.  I tried this and it works.  I can see the Windows window and the console window is on top of it and is the focus.  However, when I then click anywhere on the Windows window, it becomes the focus, the console window disappears and I don't know how to switch between the two.  Is there a keyboard command to do this or how to do it programmatically?

THanks.
Title: Re: Some questions by this IWBasic newbee
Post by: billhsln on January 03, 2017, 08:01:31 PM
When I have a window and a console open, I make sure that I can click on either by moving them to a position that allows me to click on them independently.  That way I can switch between the window and console screen.

Bill
Title: Re: Some questions by this IWBasic newbee
Post by: ckoehn on January 04, 2017, 08:49:46 AM
{ALT}{TAB} switches between open windows.

Later,
Clint
Title: Re: Some questions by this IWBasic newbee
Post by: ckoehn on January 20, 2017, 01:21:07 PM
I want to update this thread.  The snippet below will make the console window be on top where it is always visible.

$INCLUDE "windowssdk.inc"

'You need to close the console window before ending the program
CLOSECONSOLE
END

'---- print text to console window -----------
SUB PrintConsole(text as string)
        STATIC UINT stdout
UINT charwritten

IF stdout=0
OPENCONSOLE
stdout=GetStdHandle(-11)
SetWindowPos(FindWindow("ConsoleWindowClass",0),HWND_TOPMOST,0, 0, 0, 0,SWP_NOMOVE | SWP_NOSIZE)
ENDIF
WriteConsole(stdout,text+"\n",len(text)+2,&charwritten,0)
ENDSUB


Later,
Clint