FbEdit, new IDE for FreeBASIC written in FreeBASIC

User projects written in or related to FreeBASIC.
Post Reply
dasyar
Posts: 372
Joined: Dec 04, 2008 15:31

Post by dasyar »

Is anybody else having this problem with 1.0.7.2? When I use 'make', it looks like it complies the file without any errors, but when I use the 'Go' to start it, the program does not appear as a Command Prompt window, I have the Windows GUI setting. Also, when I go to the projects folder, and double click on the program icon, it does not appear as a window. It seems like the previous version did not have this problem. I also tried compiling it with the Windows Console setting, the same problem occurs. When I use a 'do loop' in the program, the program is running, because I have to use task manager to kill the program. So, it looks like you get an executable file that does not open up as a console window. Now, I know that there is nothing wrong with the program because, when I use the FreeBASIC compiler directly, the the program opens up in a console window.
KetilO
Posts: 416
Joined: Sep 22, 2005 21:48
Location: Norway
Contact:

Post by KetilO »

Hi dasyar

Common mistakes when creating a Windows Console project:

1. You have selected Windows GUI.
Solution: Select Windows Console.
2. Your Console window closes before you even noticed it started.
Solution: Add an Input at the end of your program or check the Start cmd.exe on Project Options.

Does this help?

KetilO
dasyar
Posts: 372
Joined: Dec 04, 2008 15:31

Post by dasyar »

Nope.

If I understand correctly, when you choose 'Windows GUI', it gets compiled as 'fbc -s gui xxxx.bas', that is what I am looking for. I am trying to avoid the two console windows when you compile using 'fbc xxxx.bas', which would be the 'Windows Console' selection.

My program contains either a 'do loop', or a 'sleep 5000' command. I think five seconds is long enough to see the window open up, and stay opened.

I never had this problem with your previous version, I cannot figure out what is going on.
KetilO
Posts: 416
Joined: Sep 22, 2005 21:48
Location: Norway
Contact:

Post by KetilO »

Hi dasyar

The output window will show the command used to compile your project.
What does it show?

KetilO
rdc
Posts: 1745
Joined: May 27, 2005 17:22
Location: Texas, USA
Contact:

Post by rdc »

dasyar wrote:Nope.

If I understand correctly, when you choose 'Windows GUI', it gets compiled as 'fbc -s gui xxxx.bas', that is what I am looking for. I am trying to avoid the two console windows when you compile using 'fbc xxxx.bas', which would be the 'Windows Console' selection.
This may not be your problem, however I'll throw it out anyway. You only want to use the -s gui option if you are compiling a graphics app. That is creating a window using the Screen(res) command. If you don't create a screen, you won't see anything, but your app will still be running.

If your app takes some input commands you need to do that after you create the screen or the same problem occurs.
Cherry
Posts: 358
Joined: Oct 23, 2007 12:06
Location: Austria
Contact:

Post by Cherry »

"Windows GUI": NO Console window. You need WinAPI or Screen(res) to display something.

"Windows Console": ONE Console window. You can use Print to display something.
dasyar
Posts: 372
Joined: Dec 04, 2008 15:31

Post by dasyar »

The problem that I was having has been resolved, as usual "Operator ERROR". Thanks for the help.
Rens
Posts: 256
Joined: Jul 06, 2005 21:09

Post by Rens »

Hi KetilO,

There is a problem with tabs. When i load a source file after saving, the tab spacing is different compared to what i see on the screen before saving.

I have checked the spacing with notepad++. I think the problem lies at using TTF fonts. Always trouble to get things properly aligned.

Hopefully you can fix it, so i can printout source files as i see them in your editor.
KetilO
Posts: 416
Joined: Sep 22, 2005 21:48
Location: Norway
Contact:

Post by KetilO »

Hi Rens

Can't make it happend here. What font are you using?
Is Expand tabs in Code Editor Options checked?
Did you open and save the file in a program that converts tabs to spaces?

There might be a difference between tabs and spaces, depending on number of spaces in a tab.

KetilO
AGS
Posts: 1284
Joined: Sep 25, 2007 0:26
Location: the Netherlands

Post by AGS »

This must be one of the most active projects in terms of reactions.

I wonder, KetilO, if your editor is on it's way to becoming the 'default' FreeBASIC editor. FB IDE 2 (as opposed to FB IDE 1 at http://fbide.freebasic.net/).

FBEdit is looking good, KetilO :)
Rens
Posts: 256
Joined: Jul 06, 2005 21:09

Post by Rens »

Hi KetilO,

I'm using arial normal 12. Expand tabs is not checked. This makes no difference.

Here is a snippet of the code i'm using. Especially the character = and what's behind it, is very often not well aligned. Maybe this is a problem???

Note:

As you know there is a problem posting code to this board. The code is never well aligned as before posting. Maybe the same problem?

I've tried to duplicate the problem with the snippet below after selecting, aligning, saving and loading it, but now i have no problem.
This is driving me insane!

Code: Select all

	COMPUTERPLUS					= 1
	PCHALNOORD					= 2
	SUPERWARE						= 3
	THESYSTEMS						= 4
	
	NAAM(COMPUTERPLUS)			= "COMPUTERPLUS "
	NAAM(PCHALNOORD)			= "PCHALNOORD   "
	NAAM(SUPERWARE)				= "SUPERWARE    "
	NAAM(THESYSTEMS)			= "THESYSTEMS   "	

Dinosaur
Posts: 1507
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Post by Dinosaur »

Hi all

This is not a bug, being a tidy freak it annoys me.

Using the + and - to expand and collapse routines, allows me to see all my routines in a module, and just expand the one I need.

This works great, except on routines with ASM. Then it collapses to the first label it encounters. Trying to collapse the ASM doesnt work either. It doesnt seem to recognise End Asm.

It would be really nice if I could collapse the asm block seperately, which may solve the full routine collapse as well.

Regards
KetilO
Posts: 416
Joined: Sep 22, 2005 21:48
Location: Norway
Contact:

Post by KetilO »

Hi Dinosaur

No problems here with asm blocks / labels.
Could you post an example that fails?

KetilO
Dinosaur
Posts: 1507
Joined: Jul 24, 2005 1:13
Location: Hervey Bay (.au)

Post by Dinosaur »

Hi Ketil0

This routine is particularly messy to collapse.

Code: Select all

Sub AddsControl
Dim As Integer Cmnd,Value,Az,Bz,DataAddr,StatAddr,CtrlAddr
Dim As UInteger Count
'Type Additive has 5 x Liquid, but this is foreground task.
With Liquid
    Select Case .StepNbr
        Case -1
           'This is free waiting for next  Task.
        Case 0  'unused step
            .StepNbr = -1
        Case 1  'Target is pulse count (mL in this case)
            If .Target < 10 Then 
                    .StepNbr = -1
                Else    
                    .StepNbr = 2
            EndIf
        Case 2  'Set the 8254 for the Target (mL = Counts)
            Value = .Target
            DataAddr = .DataAddr
            Asm
                MOV		DX,[DataAddr]				
                MOV     BX,[Value]                 	
                MOV     CX,200                  	
                MOV     AL,BL                   	
                Out     DX,AL                   	
            OUTSET1:
                LOOP    OUTSET1
                MOV     AL,BH                   	
                Out     DX,AL                  		
                MOV		[VALUE],BX					
            End Asm
            .StepNbr = 3
        Case 3  'Set RESET Relay On, at Manu Meter.
            Az = Inp(.ResetAddr)
            Bz = Az Or .ResetBit
            Out .ResetAddr,Bz
            .StartTime = Times.mSec
            .StepNbr = 4
        Case 4  'Time Manu Reset to OFF
            If Times.mSec - .StartTime > 500 Then
                Az = Inp(.ResetAddr)
                Bz = Az And (Not .ResetBit)
                Out .ResetAddr,Bz
                .StartTime = Times.mSec
                .StepNbr = 5
            EndIf
        Case 5  'After RESET, allow some settling Time
            If Times.mSec - .StartTime > 1000 Then
                If .GoFlag > 0 Then                 
                    .StartTime = Times.mSec
                    .StepNbr = 6
                EndIf
            EndIf
        Case 6  'Set START output on Manu ON
            Az = Inp(.StartAddr)
            Bz = Az Or .StartBit
            Out .StartAddr,Bz
            .StartTime = Times.mSec
            .StepNbr = 7
        Case 7  'Time Manu Start to OFF
            If Times.mSec - .StartTime > 500 Then
                Az = Inp(.StartAddr)
                Bz = Az And (Not .StartBit)
                Out .StartAddr,Bz
                .StartTime = Times.mSec
                .StepNbr = 8
            EndIf
        Case 8  'Read Status to see if Pulses seen yet.
            If Times.mSec - .StartTime > 5000 Then
                CtrlAddr  = .CtrlAddr
                DataAddr  = .DataAddr
                Cmnd      = .LatchBits
                Asm
                    MOV		DX,[CtrlAddr]  				
                    MOV		AL,[Cmnd]     				
                    OUT     DX,AL                   	
                    MOV		CX,200						
                    XOR		AX,AX
                STATUS0:
                    LOOP	STATUS0
                    MOV		DX,[DataAddr]    			
                    IN		AL,DX						
                    AND		AL,&b11000000               
                    ROL		AL,2                        
                    MOV		[VALUE],AX					   
                End Asm
            EndIf
            .Status  = Value
            If .Status = 0 Then                         
                .StepNbr = 9
                .Message = "Flowing"
            EndIf
            If .Status = 1 Then .Message = "No Flow Yet"
        Case 9  'Hang around for 100%
            CtrlAddr = .CtrlAddr
            DataAddr = .DataAddr
            Cmnd     = .LatchBits
            Asm
                    MOV		DX,[CtrlAddr]				
                    MOV		AL,[Cmnd]       			
                    OUT     DX,AL                   	
                    MOV     CX,200                  	
                INPUT0:
                    LOOP    INPUT0
                    MOV		DX,[DataAddr]				
                    IN      AL,DX                   	
                    MOV		BL,AL						
                    MOV     CX,200                  	
                INPUT1:
                    LOOP    INPUT1                  	
                    IN      AL,DX                   	
                    MOV		BH,AL						
                    MOV		[VALUE],BX					
            End Asm
            IF VALUE > .Target THEN COUNT = (65535 - VALUE) + .Target
            IF VALUE < .Target AND VALUE > 0 THEN COUNT = (.Target - VALUE)
            IF ((COUNT / .Target) * 100) < 100 THEN .PercentAdd = (COUNT / .Target) * 100 ELSE .PercentAdd = 100          
            If .PercentAdd = 100 Then 
                .Message = "Target made"
                .StartTime = Times.mSec
                .StepNbr = 10
            EndIf
        Case 10 'Wait for OUT relay ON
            If Times.mSec - .StartTime > 500 Then
                CtrlAddr  = .CtrlAddr
                DataAddr  = .DataAddr
                Asm
                    MOV		DX,[CtrlAddr]  				
                    MOV		AL,[Cmnd]   				
                    OUT     DX,AL                   	
                    MOV		CX,200						
                    XOR		AX,AX
                STATUS1:
                    LOOP	STATUS1
                    MOV		DX,[DataAddr]    			
                    IN		AL,DX						
                    AND		AL,&b11000000               
                    ROL		AL,2                        
                    MOV		[VALUE],AX					     
                End Asm
            EndIf
            .Status  = Value
            If .Status = 2 Then                         
                .StepNbr = 11
                .Message = "Pump Stopped"   
            EndIf
        Case 11 'Wait here on completion to prevent a restart
    End Select
End With
End Sub

Regards
KetilO
Posts: 416
Joined: Sep 22, 2005 21:48
Location: Norway
Contact:

Post by KetilO »

Hi Dinosaur

It is the Loop instruction that causes problems.
In your case I recomend disabling the FB Do Loop block until I can find a solution to the problem. Edit the FbEdit.ini and comment the block.

[Block]
.
.
;14=do!loop,Loop,,,0
.
.
.

KetilO
Post Reply