Liberty BASIC Community Forum
« FAQ - frequently asked questions »

Welcome Guest. Please Login or Register.
Jan 23rd, 2018, 7:31pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1 2 3  Notify Send Topic Print
 sticky  Author  Topic: FAQ - frequently asked questions  (Read 1840 times)
Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14918
exclamation FAQ - frequently asked questions
« Thread started on: Aug 31st, 2004, 1:38pm »

We see many of the same questions arise over and over. Please add answers to these frequently asked questions to this thread. Some frequently asked questions are:

how do I make a standalone program?
why don't my graphics show?
why do my graphics disappear?
can I trap keystrokes in a textbox?
how do I make a window full screen?

Why don't my graphics show?

By default, the graphics drawing pen is in the UP position. Be sure to issue a DOWN command before issuing drawing commands, sprite commands, or drawbmp commands.
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
Alex L.
Guru
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1384
xx Re: FAQ - frequently asked questions
« Reply #1 on: Aug 31st, 2004, 4:59pm »

Why do my graphics dissappear?


This is probably because you have not issued a "FLUSH" command.
User IP Logged

David Conner
Guru
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 549
xx Re: FAQ - frequently asked questions
« Reply #2 on: Aug 31st, 2004, 5:07pm »

How do I make a window full screen?

Code:
WindowWidth=DisplayWidth
WindowHeight=DisplayHeight

Open "Window" for window as #1
#1 "Trapclose [quit]"
wait

[quit]
close #1: end 


How do I make a standalone program?

You purchase the GOLD version of LB. Once you have done that, copy the following files into a new directory, somewhere else, etc.

vbas31w.sll
vgui31w.sll
voflr31w.sll
vthk31w.dll
vtk1631w.dll
vtk3231w.dll
vvm31w.dll
vvmt31w.dll
run400.exe

and a copy of your TKN file.

Rename run400 to the name of your TKN, and you are all set!

Can I trap keystokes in a textbox?

Yes, but it requires some fairly complex API calls.
« Last Edit: Aug 31st, 2004, 5:08pm by David Conner » User IP Logged

--David
kcmonkeyman
New Member
Image


member is offline

Avatar




PM


Posts: 0
xx Re: FAQ - frequently asked questions
« Reply #3 on: Aug 31st, 2004, 5:07pm »

How Do I Make A Stand Alone Program?

If You Are A Registered Gold Version User (yes you have to be a gold...) Open The Program You Want To Turn Into A "Stand Alone" Program, Goto The Run Menu And Goto The SubMenu "Make A *.TKN File" It Will Show A File Dialog Input The Name Of The Tkn File You Want. e.g. "Program.tkn". Copy These Files From The Liberty Basic Folder Into Your Own Folder For You Program You Just "Tokenized"

run400.exe
VBAS31W.SLL
VGUI31W.SLL
VOFLR31W.SLL
VTHK31W.DLL
VTK1631W.DLL
VTK3231W.DLL
VVM31W.DLL
VVMT31W.DLL
and Your TKN

Finnaly Rename The run400.exe Into The Name Of Your Tkn File. For Example IF The Tkns Name Is "Program.tkn"
Rename The run400.exe to "Program.exe" Then Run The "Program.exe" And Whalah! (or however you spell it...) cheesy
User IP Logged

Alex L.
Guru
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1384
xx Re: FAQ - frequently asked questions
« Reply #4 on: Aug 31st, 2004, 5:12pm »

Can I trap keystrokes in a textbox?

Yes! You will need a DLL called WMLiberty.DLL by Brent Thorn. You need an understanding of:

Callbacks
The Windows API
DLL Calls in general
WMLiberty.dll

Watch out for a youth newsletter article about trapping messages in various LB controls in a future issue.
« Last Edit: Aug 31st, 2004, 5:12pm by Alex L. » User IP Logged

David Conner
Guru
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 549
xx Re: FAQ - frequently asked questions
« Reply #5 on: Aug 31st, 2004, 5:16pm »

Where can I find some beginner tutorials?

The first place to look is in the LB tutorial, which ships with the package. For LB 3 it is in the Helpfile, LB 4, Go to the Help menu and click on Liberty BASIC Tutorial.

Another great resource is Alyce Watson's LB 4 Companion. It is a GREAT bargain at only $15.00, and can be found here. http://alycesrestaurant.com/companion.htm

One of the best resources around is the LB Newsletter! (http://babek.info/libertybasicfiles/lbnews) Check out the Beginners' Tutorials by Brad Moore, and if you want to learn game programming, the Game Programming series by Richard Ryles. I suggest looking at most of the articles. It might take you a while, but you don't have to do it in one day!
« Last Edit: Dec 4th, 2004, 1:27pm by David Conner » User IP Logged

--David
David Conner
Guru
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 549
xx Re: FAQ - frequently asked questions
« Reply #6 on: Aug 31st, 2004, 5:22pm »

I'm new to LB. Where should I start?

Look at the post above this one called 'Where can I find some beginner tutorials?' Also, DO NOT and I emphasize this, try to start with the very big projects like API and DLLs. (Trust me, I tried when I first started LB, and didn't like my results. So I started over, and used the tutorials, and now it is so much easier and FUN!) Start simple, and grow into the APIs and such.

User IP Logged

--David
Alyce Watson
Administrator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Female
Posts: 14918
xx Re: FAQ - frequently asked questions
« Reply #7 on: Aug 31st, 2004, 5:51pm »

Can I have sprites in more than one graphicbox?

How do I print text to the printer?

Can I print text and graphics at the same time?

Can I have a button that is activated automatically when the user hits ENTER?

Can I use handle variables when opening files?

Is it okay to use "goto" from within a loop?

How do I print ascii characters?

The contents of a textbox are retrieved as a string, but I need a number. How can I do that?
User IP Logged

Alyce
Liberty BASIC Workshop - a complete IDE for Liberty BASIC


Alyce's Restaurant
for Liberty BASIC code, tools and references
David Conner
Guru
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 549
xx Re: FAQ - frequently asked questions
« Reply #8 on: Aug 31st, 2004, 6:06pm »

Can I have sprites in more than one graphicbox?

No. LB only permits one graphicbox or graphics window per program to have sprites.

Is it ok to use GOTO from within a loop?

No because the loop doesn't finish an iteration. Instead use EXIT FOR or EXIT WHILE (whichever type of loop you are using.)


How do I print ASCII characters?

Using the CHR$() function. For instance, to print a sign, use CHR$(169).

The contents of a textbox are contained in a string, but I need a number. How do I do that?

Get the contents, and use the VAL function to convert it to a number.

s$="12"
s=VAL(s$)

(edit to fix error, "contents of a string are" should be "contents of a textbox are")
« Last Edit: Sep 1st, 2004, 4:22pm by Alyce Watson » User IP Logged

--David
kcmonkeyman
New Member
Image


member is offline

Avatar




PM


Posts: 0
xx Re: FAQ - frequently asked questions
« Reply #9 on: Aug 31st, 2004, 6:09pm »

HOW DO I PRINT ASCII CHARACTERS?

To Print The Ascii value of a character use asc("LETTER HERE")

To Print The Char Value Use chr$(ascii value here!)

example to print a space use chr$(32)

heres a good site for an ascii table...
http://www.asciitable.com/
« Last Edit: Aug 31st, 2004, 6:13pm by kcmonkeyman » User IP Logged

JohnDavidson
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 2480
xx Re: FAQ - frequently asked questions
« Reply #10 on: Aug 31st, 2004, 6:30pm »

Quote:
heres a good site for an ascii table...
http://www.asciitable.com/


Or download LBAscii at http://www.geocities.com/johnshomeport/

John
User IP Logged

John Davidson
e-me: johnshomeport@yahoo.com
Comming Soon: http://johnshomeport.com
Did ya Libby yet? http://lblibby.com/



David Conner
Guru
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 549
xx Re: FAQ - frequently asked questions
« Reply #11 on: Aug 31st, 2004, 6:40pm »

How do I print text to the printer?

One way is to retrieve the contents of the texteditor, or string or whatever you are getting text from, and then print it using LPRINT. This method is probably the most simple, and there are better ways availible! Use PRINTERDIALOG to give the user options.

Code:
Input "Enter a string. "; s$
PrinterDialog
LPRINT s$
Dump
Print "Text printed!"
End 

User IP Logged

--David
David Conner
Guru
ImageImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 549
xx Re: FAQ - frequently asked questions
« Reply #12 on: Aug 31st, 2004, 6:48pm »

Can I use handle variables with files?

No.
« Last Edit: Sep 1st, 2004, 4:24pm by Alyce Watson » User IP Logged

--David
Alex L.
Guru
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1384
xx Re: FAQ - frequently asked questions
« Reply #13 on: Aug 31st, 2004, 7:04pm »

Can I have a button that is activated automatically when the user hits ENTER?

Only in a DIALOG window.

To do this, you can make the extension of the control's handle "default". So a button called #dialog.default if #dialog was the handle of a dialog window would be the default button in the window, or the button that is automatically pressed when ENTER is hit.
User IP Logged

Alex L.
Guru
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1384
xx Re: FAQ - frequently asked questions
« Reply #14 on: Aug 31st, 2004, 7:07pm »

Can I print text and graphics at the same time?

If you mean have a window where text and graphics appear, then yes. I graphics window can use various commands to draw graphics, and can draw text to a graphics window with Code:
#window.graphicbox, "|Text Here"
 
User IP Logged

Pages: 1 2 3  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls