April 26, 2024, 10:20:52 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Some questions by this IWBasic newbee

Started by arono, December 24, 2016, 01:38:59 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

arono

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

Brian

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

LarryMc

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.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

arono

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?

LarryMc

3.x currently doesn't have a working debugger. LarryS opted to work on the 64bit version instead.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

arono

Would it be safe to run the latest 2.x version to do debugging and 3.x to code and non-debug compiling/execution?

LarryMc

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.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

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
When all else fails, get a bigger hammer.

fasecero

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  :)

ckoehn

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

arono

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.

billhsln

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
When all else fails, get a bigger hammer.

ckoehn

{ALT}{TAB} switches between open windows.

Later,
Clint

ckoehn

January 20, 2017, 01:21:07 PM #13 Last Edit: January 20, 2017, 06:44:13 PM by ckoehn
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