Post by columbo on Jul 31, 2011 11:52:05 GMT -5
I have had LB and LB Workshop for some time now but did not get to do much with it. Now that I am retired, I decided to give it a go and see if I could learn how to do something with it.
I thought I would start out with something simple and slowly expand it as I learn. Following the LB Workshop help file, I created a window with a simple menu containing 2 items. ("Do calculation" and "Exit"). The "Do calculation" pointed to [start] and the "Exit" pointed to [quit]. I compliled the window and it generated the following code.
When I run the program the window is displayed along with the menu. When I click on "Do calculaton" it should go to [start] which I thought would display the words "Yagi Antenna Calculator" but it displays nothing. If I select "Exit" from the menu, that seems to work fine and the program closes the window and exits.
Obviously I have done something wrong here but I'm not sure what? I thought print "Yagi Antenna Calculator" should be something very simple. If you use the print "Yagi Antenna Calculator" without a window it displays fine but doesn't want to do so in the window.
Any help with this?
Thanks
I thought I would start out with something simple and slowly expand it as I learn. Following the LB Workshop help file, I created a window with a simple menu containing 2 items. ("Do calculation" and "Exit"). The "Do calculation" pointed to [start] and the "Exit" pointed to [quit]. I compliled the window and it generated the following code.
'** Created by Liberty BASIC Workshop - 31/07/2011 11:53:28 AM
'** Yagi Antenna Calculator
[InitColors]
'Please use default colors when possible.
ForegroundColor$ = "Black"
BackgroundColor$ = "White"
True = 1 : False = 0
[WindowSetup]
NOMAINWIN
WindowWidth = 771 : WindowHeight = 650
UpperLeftX = INT((DisplayWidth-WindowWidth)/2)
UpperLeftY = INT((DisplayHeight-WindowHeight)/2)
[ControlSetup]
Menu #main, "File", "Do Calculation", [start], "Exit", [quit]
Open "Yagi Antenna Calculator" for Window as #main
#main "trapclose [quit]"
#main "font arial 11"
[loop]
Wait
[quit]
close #main : END
[start]
print "Yagi Antenna Calculator"
Wait
When I run the program the window is displayed along with the menu. When I click on "Do calculaton" it should go to [start] which I thought would display the words "Yagi Antenna Calculator" but it displays nothing. If I select "Exit" from the menu, that seems to work fine and the program closes the window and exits.
Obviously I have done something wrong here but I'm not sure what? I thought print "Yagi Antenna Calculator" should be something very simple. If you use the print "Yagi Antenna Calculator" without a window it displays fine but doesn't want to do so in the window.
Any help with this?
Thanks