Skip to search.

Breaking News Visit Yahoo! News for the latest.

×Close this window

libertybasic · The Official Liberty BASIC Support Group

The Yahoo! Groups Product Blog

Check it out!

Group Information

  • Members: 5577
  • Founded: Jan 12, 2001
  • Language: English
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Real people. Real stories. See how Yahoo! Groups impacts members worldwide.

Messages

Advanced
Messages Help
Messages 1028 - 1057 of 46456   Oldest  |  < Older  |  Newer >  |  Newest Start Topic
Messages: Show Message Summaries Sort by Date ^  
#1028 From: "Mike" <mike@...>
Date: Sat Sep 1, 2001 3:27 pm
Subject: Exit while/wend
mike@...
Send Email Send Email
 
Hi all,

Could anyone please confirm whether or not the
following code is safe to use? Is it ok to
exit a while/wend loop by detecting a button
click with 'scan' and then setting the
control value n equal to 0? Or is this a stack
error waiting to happen?

Thanks,
Mike.

nomainwin
button #w.b1, "Test", [test], UL,10,10,30,20
statictext #w.st1, "",10,40,100,20
statictext #w.st2, "",50,13,100,20
open "test" for window as #w
print #w, "trapclose [quit]"
n=1
print #w.st2, "n=";n

[wwloop]
while n=1
     now$=time$()
     print #w.st1, now$
         while now$=time$()
         wend
     scan
wend
wait

[test]
n=1-n
print #w.st2, "n=";n
print #w.st1, ""
if n=1 then [wwloop]
wait

[quit]
close #w
end

#1029 From: John Jacques <john.f.jacques@...>
Date: Sat Sep 1, 2001 4:58 pm
Subject: Will LB2 apps work on LB3?
john.f.jacques@...
Send Email Send Email
 
Hello, will all Liberty BASIC 2.02 programs written using only
internal LB commands work unmodified on LB3?

I'm not talking about API calls or any external usage, just the plain
B.A.S.I.C. commands.

Are some of the commands being taken away or are there any other special
considerations we should make at this time for the programs we are
developing?

Thanks for the info!
John

#1030 From: "A. Watson" <alycewatson@...>
Date: Sat Sep 1, 2001 5:22 pm
Subject: Re: Will LB2 apps work on LB3?
alycewatson@...
Send Email Send Email
 
At 12:58 PM 9/1/01 -0400, you wrote:
>     Hello, will all Liberty BASIC 2.02 programs written using only
> internal LB commands work unmodified on LB3?
>
> I'm not talking about API calls or any external usage, just the plain
> B.A.S.I.C. commands.
>
> Are some of the commands being taken away or are there any other special
> considerations we should make at this time for the programs we are
> developing?

I'm one of the alpha testers.  Programs without api calls ought to work
fine with no modification.  You might need to be careful about duplicating
new "reserved words".  For instance "select" and "case" will be reserved
words and if you have a variable with that name in an LB2 program, you may
have a problem when running it in LB3.  Even for programs with api calls,
there isn't too much modification necessary.

Alyce

#1031 From: John Jacques <john.f.jacques@...>
Date: Sat Sep 1, 2001 5:21 pm
Subject: Re: Will LB2 apps work on LB3?
john.f.jacques@...
Send Email Send Email
 
Ok, thanks!

John


"A. Watson" wrote:

> At 12:58 PM 9/1/01 -0400, you wrote:
> >     Hello, will all Liberty BASIC 2.02 programs written using only
> > internal LB commands work unmodified on LB3?
> >
> > I'm not talking about API calls or any external usage, just the plain
> > B.A.S.I.C. commands.
> >
> > Are some of the commands being taken away or are there any other special
> > considerations we should make at this time for the programs we are
> > developing?
>
> I'm one of the alpha testers.  Programs without api calls ought to work
> fine with no modification.  You might need to be careful about duplicating
> new "reserved words".  For instance "select" and "case" will be reserved
> words and if you have a variable with that name in an LB2 program, you may
> have a problem when running it in LB3.  Even for programs with api calls,
> there isn't too much modification necessary.
>
> Alyce
>
>
> To unsubscribe from this group, send an email to:
> libertybasic-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/

#1032 From: "laz" <lazman2001@...>
Date: Sat Sep 1, 2001 11:12 pm
Subject: Re: Exiting Endless Loop
lazman2001@...
Send Email Send Email
 
--- In libertybasic@y..., "Dave J Baker" wrote:
> Carl,
I think you are doing a good job.
This earns you zero extra bucks, and the warm feeling won't last
long, but I'm glad you're on the planet <g>
  Dave

I think Carl is doing an excellent job!!


>I know this needs to be better documented, but just press Ctrl-
Break.  ;-)

  -Carl

Thanks Carl! I find my self in the endless loop and use the three
finger salute also. The think that I noticed about using this way is
that it closes LB down even if you just end task on the open window.
This will be a real time saver for me. Thanks!!

Everyone have a fun and safe weekend!!
~laz

#1033 From: Chergarj@...
Date: Sun Sep 2, 2001 2:18 pm
Subject: different file extensions
Chergarj@...
Send Email Send Email
 
What do the different extensions to sequential and random access files mean,
and what is necessary to view or print those file types?

If we open or append a file with a basic-program, we may use .txt, which
allows us to view the file in NOTEPAD if we want.  But what about other
types?  How to you view and use .dat file types, and how are they different
from .txt, and what are the other filetypes possible when we deal with files
in liberty BASIC programs?

G C

#1034 From: camp@...
Date: Sun Sep 2, 2001 6:43 pm
Subject: New to LB, How do you do a cd within a program?
camp@...
Send Email Send Email
 
Sorry for the basic question, any hints on directory navagation?  I
want to have the program change directories.  Any pointers would be
helpful.  thanks.

#1035 From: "Eldron Gill" <egill@...>
Date: Sun Sep 2, 2001 9:35 pm
Subject: Re: New to LB, How do you do a cd within a program?
egill@...
Send Email Send Email
 
Could you be a little more specific as to what you want to do?
You can access any drive or directory on your computer with LB....but what do you want to do?
Access a file?  Write to a file? Open filedialog to a specific directory?
Let us know and i bet someone here can help.
 
Eldron
----- Original Message -----
From: camp@...
Sent: Sunday, September 02, 2001 1:43 PM
Subject: [libertybasic] New to LB, How do you do a cd within a program?

Sorry for the basic question, any hints on directory navagation?  I
want to have the program change directories.  Any pointers would be
helpful.  thanks.



To unsubscribe from this group, send an email to:
libertybasic-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

#1036 From: Bubba <andrew@...>
Date: Mon Sep 3, 2001 12:01 am
Subject: Re: New to LB, How do you do a cd within a program?
andrew@...
Send Email Send Email
 
Hi,

	 Liberty BASIC doesn't have a CD command. You can get file and directory
information with the FILES command. Look in the LB help file for more info
on that command.

Hope this helps,

	 -Bubba

#1037 From: camp@...
Date: Mon Sep 3, 2001 1:44 am
Subject: Re: New to LB, How do you do a cd within a program?
camp@...
Send Email Send Email
 
Thanks for your replys, I realized what I needed to do to make the
FILES command do what I wanted.  It's great to have the support for
this language it looks pretty handy.

thanks again,

Scott C.

--- In libertybasic@y..., Bubba <andrew@b...> wrote:
> Hi,
>
>  Liberty BASIC doesn't have a CD command. You can get file and
directory
> information with the FILES command. Look in the LB help file for
more info
> on that command.
>
> Hope this helps,
>
>  -Bubba

#1038 From: John Davidson <johnshomeport@...>
Date: Mon Sep 3, 2001 3:46 am
Subject: Re: different file extensions
johnshomeport@...
Send Email Send Email
 
<P> Yes. you can read dat files, as well as many
others, in in notepad.
<P>To do this you in windows explorer, click on the
dat file you want to read.
<P>You will be presented with the "Open With" dialog.
<P>Scroll down to notepad and click.
<P>Note:
<P>At the bottom is a checkbox to "Always use this
program to open files".
<P>Checking this box will  associate dat files and you
won't see this dialog when clicking on dat
files in windows explorer.
<P>Hope this helps
<P>John
<P> 
<P> 
<P>  <B><I>Chergarj@...</I></B> wrote:
<BLOCKQUOTE style="BORDER-LEFT: #1010ff 2px solid;
MARGIN-LEFT: 5px; PADDING-LEFT: 5px"><FONT
face=arial,helvetica><FONT size=2>What do the
different extensions to sequential and random access
files mean, <BR>and what is necessary to view or print
those file types? <BR><BR>If we open or append a file
with a basic-program, we may use .txt, which
<BR>allows us to view the file in NOTEPAD if we want.
 But what about other <BR>types?  How to you
view and use .dat file types, and how are they
different <BR>from .txt, and what are the other
filetypes possible when we deal with files <BR>in
liberty BASIC programs? <BR><BR>G C</FONT> <BR><!--
|**|begin egp html banner|**| -->
<TABLE border=0 cellPadding=2 cellSpacing=0>
<TBODY>
<TR bgColor=#ffffcc>
<TD align=middle><FONT color=#003399 size=-1><B>Yahoo!
Groups Sponsor</B></FONT></TD></TR>
<TR bgColor=#ffffff>
<TD align=middle width=470>
<TABLE>
<TBODY>
<TR>
<TD align=middle><FONT face=arial
size=-2>ADVERTISEMENT</FONT><BR>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=300>
<TBODY>
<TR>
<TD width=300>
<TABLE border=0 cellPadding=0 cellSpacing=0 width=300>
<FORM
action=http://rd.yahoo.com/M=210544.1579876.3135161.1261774/D=egroupweb/S=170501\
6061:HM/A=778020/R=0/*http://ads.track-star.com/adspace.ts
method=get>
<TBODY>
<TR vAlign=top>
<TD rowSpan=3 width=76><IMG border=0 height=204
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/pic_1.jpg"
width=76></TD>
<TD colSpan=4 width=224><IMG alt="" border=0 height=98
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/pic_2.gif"
width=224></TD></TR>
<TR vAlign=top>
<TD width=74><IMG border=0 height=61
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/pic_3.gif"
width=74></TD>
<TD width=33><IMG border=0 height=61
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/pic_4.gif"
width=33></TD>
<TD bgColor=#ff6699 width=116><IMG align=left border=0
height=61
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/w.gif"
width=8><INPUT name=ts type=hidden
value=1;2;217;107_223_105_264> <INPUT
name=startApplication type=hidden value=%20><FONT
face=Arial,Helvetica,sans-serif
size=2><B>Gender:</B><BR><INPUT name=gender
style="BACKGROUND: #ff6699; COLOR: #000001" type=radio
value=female>Female<BR><INPUT name=gender
style="BACKGROUND: #ff6699; COLOR: #000001" type=radio
value=male>Male</FONT></TD>
<TD bgColor=#cc0066 rowSpan=3 width=1><IMG border=0
height=1
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/w.gif"
width=1></TD></TR>
<TR vAlign=top>
<TD bgColor=#ff6699 width=74><IMG border=0 height=45
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/pic_7.gif"
width=74></TD>
<TD align=middle bgColor=#ff6699 colSpan=2 rowSpan=2
width=149><FONT face=Arial,Helvetica,sans-serif
size=2><B>Weight:</B><BR><INPUT CHECKED
name=weightUnit style="BACKGROUND: #ff6699; COLOR:
#000001" type=radio value=pounds>lbs. <INPUT
name=weightUnit style="BACKGROUND: #ff6699; COLOR:
#000001" type=radio value=kilograms>kg.<BR><INPUT
name=weight size=5> </FONT></TD></TR>
<TR height=17>
<TD bgColor=#ff6699 colSpan=2 width=183><IMG border=0
height=17
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/pic_5.gif"
width=150></TD></TR>
<TR>
<TD colSpan=5 width=300><INPUT border=0 height=28
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/pic_6_11_5.gif"
type=image width=300></TD></TR>
<TR bgColor=#cc0066>
<TD width=76><IMG border=0 height=1
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/w.gif"
width=76></TD>
<TD width=74><IMG border=0 height=1
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/w.gif"
width=74></TD>
<TD width=33><IMG border=0 height=1
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/w.gif"
width=33></TD>
<TD width=116><IMG border=0 height=1
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/w.gif"
width=116></TD>
<TD width=1><IMG border=0 height=1
src="http://us.a1.yimg.com/us.yimg.com/a/di/dietsmart/w.gif"
width=1></TD></TR></FORM></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></T\
BODY></TABLE></TD></TR>
<TR>
<TD><IMG alt="" height=1
src="http://us.adserver.yahoo.com/l?M=210544.1579876.3135161.1261774/D=egroupmai\
l/S=1705016061:HM/A=778020/rand=209331287"
width=1></TD></TR></TBODY></TABLE><!-- |**|end egp
html banner|**| --><BR><TT>To unsubscribe from this
group, send an email
to:<BR>libertybasic-unsubscribe@egroups.com<BR><BR></TT><BR><BR><TT>Your
use of Yahoo! Groups is subject to the <A
href="http://docs.yahoo.com/info/terms/">Yahoo! Terms
of Service</A>.</TT> <BR></BLOCKQUOTE></FONT>

__________________________________________________
Do You Yahoo!?
Get email alerts & NEW webcam video instant messaging with Yahoo! Messenger
http://im.yahoo.com

#1039 From: Chergarj@...
Date: Mon Sep 3, 2001 2:36 am
Subject: program confuses "appending" and "output"
Chergarj@...
Send Email Send Email
 
This failure to function as a file maker and file appender seems peculiar.
Can someone figure out why?

*******************************************************************
Print " S E Q U E N T I A L  F I L E   E X E R C I S E"
Print "We will take in a number of names and 3 test scores"
print "for each name, and write them all to rawgrades.txt"
Print "which will be in the E: drive."
Input "Do you ONLY want to add another name and score set?";A1$
IF A1$="y" or A1$="yes" then [appendonly]

open "rawgrades.txt" for output as #score
input "How many students?  ";n

For I=1 to n
input "Student # "+str$(I)+" ";n$
print #score, n$
     for j=1 to 3
     input "his/her score #"+str$(j)+" ";p
     print #score, p
     next j
next I

close #score

[appendonly]
Print "'y' or 'n', do you want to run another student's scores?"
input A$
IF A$="y" then
open "rawgrades.txt" for append as #morescr
notice "rawgrades.txt is ready for appending"
Input "Additional student name?";n$
print #morescr, n$
for index=1 to 3
input "score #"+str$(index)+" ";p
print #morescr, p
next index
close #morescr
END if

Notice "DONE!"
END
***********************************************
I thought "append" means to put more information into the file.  The actual
results are the following occurrance:
If I run the program and say "n" as the value for A1$, I should be able to
put in information to a new file ,  called "rawgrades.txt".  Checking my
directory shows that the information has been put into a new file, called
"rawgrades."   I then run the program again and say "y" for the value of A1$,
which should take the flow to the [appendonly] label.  Under that I am given
another question to answer: do I really want to add new information to the
file, in effect, to which I say, "y".
When I recheck the file "rawgrades" to be sure that appending has occurred, I
found that the first set of file information has disappeared!

Explain, or give guidance?

G C

#1040 From: clarry@...
Date: Mon Sep 3, 2001 9:22 am
Subject: Question Re: Rounding off fractions of cents
clarry@...
Send Email Send Email
 
Thanks Jay, love the look of the windows format.
Tell me this, to make the program even more user friendly can it be
made to calculate the answer upon pushing ENTER, and even better,
highlight the amount input at the same time so a new amount can be
entered with minimal fuss.

#1041 From: "A. Watson" <alycewatson@...>
Date: Mon Sep 3, 2001 12:04 pm
Subject: Re: program confuses "appending" and "output"
alycewatson@...
Send Email Send Email
 
Without even trying your program, I can point out a possible cause for the
error.  LB2 is a 16-bit language, and as such, it must use the old DOS
standard 8.3 filenames.  Your filename is 9.3.  Try calling it
"rawgrade.txt" instead and see if it works.

The old standard allows for 8 character filenames, then a dot, then a three
letter extension.  To see how this works with LB, try opening a file with a
long name in this little snippet, and see what it returns.  If the filename
is a long one, it will be truncated... looking like this:
"c:\myfiles\longna~1.txt"

Alyce

snip
filedialog "Open longfilename...","*.*",file$
print file$

#1042 From: "A. Watson" <alycewatson@...>
Date: Mon Sep 3, 2001 12:11 pm
Subject: Re: Question Re: Rounding off fractions of cents
alycewatson@...
Send Email Send Email
 
At 09:22 AM 9/3/01 -0000, you wrote:
>  Thanks Jay, love the look of the windows format.
> Tell me this, to make the program even more user friendly can it be
> made to calculate the answer upon pushing ENTER, and even better,
> highlight the amount input at the same time so a new amount can be
> entered with minimal fuss.

I haven't looked at the file, so forgive if I've got it wrong, but...

In a DIALOG WINDOW ONLY, you can give a button the extension "default", as in

button #main.default, "Enter",[enter],UL,10,10

and it will be activated when the user presses ENTER.  Let's assume you
have a textbox for the entry, #main.text.

[enter]
'{do enter calculations here - check for valid input}
print #main.text, "!selectall"
print #main.text, "!setfocus"
wait

The above routine does your calculations, then sets focus to the textbox
and selects all of the text it contains.  What will happen?  When the user
hits the ENTER key in your program, the program does the calculations for
his input, so the next time he types, it will be in the textbox, and since
the text is selected, it will be replaced by his new keystrokes.

(The .default extension is documented in my ebook.)

Alyce

#1043 From: "A. Watson" <alycewatson@...>
Date: Mon Sep 3, 2001 12:20 pm
Subject: Re: Question Re: Rounding off fractions of cents
alycewatson@...
Send Email Send Email
 
At 07:11 AM 9/3/01 -0500, you wrote:

Apologies.  I just checked and the "!selectall" command is only valid for
texteditors, not textboxes.

Alyce

#1044 From: "Eldron Gill" <egill@...>
Date: Mon Sep 3, 2001 1:10 pm
Subject: Re: Question Re: Rounding off fractions of cents
egill@...
Send Email Send Email
 
Here you go!  I gave your window a dialog type so you can use the enter key....then added an api call  ( added [hilitewinfocus] branch) to hilite the text after pressing enter.  I hope Alyce and Jay don't mind me stepping in and helping out!
 
good day,
Eldron
 
----- Original Message -----
From: clarry@...
Sent: Monday, September 03, 2001 4:22 AM
Subject: [libertybasic] Question Re: Rounding off fractions of cents

Thanks Jay, love the look of the windows format.
Tell me this, to make the program even more user friendly can it be
made to calculate the answer upon pushing ENTER, and even better,
highlight the amount input at the same time so a new amount can be
entered with minimal fuss.



To unsubscribe from this group, send an email to:
libertybasic-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.

#1045 From: djbwisc@...
Date: Mon Sep 3, 2001 3:39 pm
Subject: Error in Liberty Help file re: "setfocus"
djbwisc@...
Send Email Send Email
 
Hi,

I am new to Liberty Basic but I love it. I've created a specific data entry and
conversion program with it. I found an error in the help file that I wonder if
anyone knows about.
Here is the section:

Textbox  understands these commands:

     print #handle.ext, "a string"

       This sets the contents of the textbox to be "a string".


     print #handle.ext, "!contents?"

       This fetches the contents of the textbox.  This must be followed by:

     input #handle.ext, varName$


       The contents will be placed into varName$


   print #handle.ext, "setfocus"

     This will cause the textbox to receive the input focus.  This means that any
     keypresses will be directed to the textbox.


"setfocus" should be "!setfocus"  I had to play with it a while before I figured
that one out.

Thanks.

#1046 From: djbwisc@...
Date: Mon Sep 3, 2001 3:47 pm
Subject: Moving between Textboxes on the input page
djbwisc@...
Send Email Send Email
 
Hi,

How I have created an input page with data fields. How to I move between the
fields with either "Enter" or the Tab key?

or am I limited to just the mouse?

Db.

#1047 From: "A. Watson" <alycewatson@...>
Date: Mon Sep 3, 2001 4:51 pm
Subject: Re: Moving between Textboxes on the input page
alycewatson@...
Send Email Send Email
 
Make your window a "dialog" window.  List your textboxes in the order you
want to tab through them.  Note the other message to this group earlier
today that mentions giving a button the extension ".default" to make it
activated when ENTER is pressed.

Alyce

#1048 From: "Tzuriel" <tzuriel@...>
Date: Mon Sep 3, 2001 5:24 pm
Subject: Re: Moving between Textboxes on the input page
tzuriel@...
Send Email Send Email
 
Wow!   Thanks for this bit of information.  Is this covered in the Ebook?  I was
trying to accomplish this with an dll and never knew it was so easy!

*********** REPLY SEPARATOR  ***********

On 9/3/01 at 11:51 AM A. Watson wrote:

giving a button the extension ".default" to make it
>activated when ENTER is pressed.
>
>Alyce








Take it easy,


Tzuriel


CD List http://home.att.net/~CDTrades
CD Covers http://home.att.net/~tapetrees/CDcovers.html

Need stamps?
http://service.bfast.com/bfast/click?bfmid=27893756&siteid=34654728&bfpage=stamp\
s_com

#1049 From: David Beiswenger <djbwisc@...>
Date: Mon Sep 3, 2001 6:16 pm
Subject: Re: Moving between Textboxes on the input page
djbwisc@...
Send Email Send Email
 
Thanks,

Fortunately I only had to change one word. LB is great. I am having trouble with
PRINT USING formats and the
help file is no help. How do I format my printed output in text and decimals
like QBasic can?

Also, is there any way to control where filedialog boxes appear on the screen?

And on a combobox, is there a setting to make it highlight associative choices
as you start typing? Like when you
press "a" the first choice starting with "a" is highlighted?

DB.


9/3/2001 11:51:33 AM, "A. Watson" <alycewatson@...> wrote:

>Make your window a "dialog" window.  List your textboxes in the order you
>want to tab through them.  Note the other message to this group earlier
>today that mentions giving a button the extension ".default" to make it
>activated when ENTER is pressed.
>
>Alyce
>
>
>To unsubscribe from this group, send an email to:
>libertybasic-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>



Dave

#1050 From: "A. Watson" <alycewatson@...>
Date: Mon Sep 3, 2001 7:29 pm
Subject: Re: Moving between Textboxes on the input page
alycewatson@...
Send Email Send Email
 
At 12:24 PM 9/3/01 -0500, you wrote:
<<Is this covered in the Ebook?  I was trying to accomplish this with an
dll and never knew it was so easy!>>

Yes.  I'm currently updating the ebook and one of the improvements will be
smaller sections, so that information is easier to find.

Alyce

Dialog windows, also called dialog boxes are different from other types of
windows in several ways:

1) Dialog boxes can have no menus.  User input must be handled through
controls such as buttons and textboxes.

2) In dialog boxes, but not in other types of windows, a user can press the
tab key and the input focus will cycle through the controls.  In other
words, pressing tab activates each control in turn, in the order the
controls were listed by the programmer.  Pressing shift/tab at the same
time will cycle through the controls in reverse order.  A snippet that
demonstrates this ability will follow this list.

3) Dialog boxes cannot be resized by the program's user.

4) Dialog boxes can be modal.  This means that all input focus is directed
to the modal dialog box until it is closed.

5) A programmer may designate a button in a dialog window with the
extension DEFAULT, and it will be activated when the user presses ENTER.
See the snippet below for an example.

#1051 From: David Beiswenger <djbwisc@...>
Date: Mon Sep 3, 2001 8:32 pm
Subject: Using a Loop to collect textbox data
djbwisc@...
Send Email Send Email
 
Hello,

Is anything like this possible if you have a lot of textboxes to collect data
from:?


FOR I = 1 TO 25

       PRINT #main.textbox+STRING$(I), "!contents?"
       INPUT #main.textbox+STRING$(I), data$(I)

NEXT I


DB.

#1052 From: "A. Watson" <alycewatson@...>
Date: Mon Sep 3, 2001 11:15 pm
Subject: Re: Using a Loop to collect textbox data
alycewatson@...
Send Email Send Email
 
At 03:32 PM 9/3/01 -0500, you wrote:
>  Hello,
>
> Is anything like this possible if you have a lot of textboxes to collect
>data from:?
>
>
> FOR I = 1 TO 25
>
>     ""
>      INPUT #main.textbox+STRING$(I), data$(I)
>
> NEXT I

You cannot do this with native Liberty BASIC commands.  You can do it with
API calls.  You would get handles to all of the textboxes.  If you put the
handles into an array, they would be quite easy to go through in a loop
like you have above.  You would then send each one a message in turn with a
call to GetWindowText.  The function is sampled below, using just one
textbox.  After the call, the text in the box is contained in the variable
entry$.

(FWIW, the example is from my ebook)
Alyce


textbox #main.textbox1, 0,0,30,20

'''code for program

hTextbox=hwnd(#main.textbox1)

calldll #user, "GetWindowTextLength",_
     hTextbox as short,_ 'handle of control
     numChars as short 'number of characters

entry$=space$(numChars)+Chr$(0)
'set pointer to area of memory, add null termination
lenEntry= Len(entry$)

calldll #user, "GetWindowText", _
     hTextbox as word, _ 'handle of control
     entry$ as ptr, _  'pointer to memory address
     lenEntry as ushort,_    'length of text string
     result as ushort         'returns number of characters copied

#1053 From: "A. Watson" <alycewatson@...>
Date: Tue Sep 4, 2001 10:20 am
Subject: Re: Using a Loop to collect textbox data
alycewatson@...
Send Email Send Email
 
At 03:32 PM 9/3/01 -0500, you wrote:
<<Is anything like this possible if you have a lot of textboxes to collect
data from:?
FOR I = 1 TO 25
       PRINT #main.textbox+STRING$(I), "!contents?"
       INPUT #main.textbox+STRING$(I), data$(I)
NEXT I>>

As I told you in my previous reply, the answer is "no".  This construct
won't work:  #main.textbox+STRING$(I)

I've written you a demo to show how to do it with API calls.  It takes a
bit of typing to set up the handle array, but after that, getting text from
all of them takes only a tiny amount of code.  Just copy and paste the
Function into your own program for use.

Alyce

'*****snip*************

'Use freely in your own programs, no credit wanted,
'but do not publish this demo in any other location,
'please!
nomainwin

UpperLeftX=10:UpperLeftY=10
WindowWidth=580:WindowHeight=400

textbox #main.1, 10,10,150,24
textbox #main.2, 10,40,150,24
textbox #main.3, 10,70,150,24
button #main.b, "Get Text",[Text],UL,170,10,100,24
statictext #main.s, "You may type into textboxes.",170,40,200,30
texteditor #main.t, 10,100,550,220
open "Textboxes" for window_nf as #main
print #main, "trapclose [quit]"

'put textbox handles into array:
dim handles(3)
handles(1)=hwnd(#main.1)
handles(2)=hwnd(#main.2)
handles(3)=hwnd(#main.3)

'put sample text in boxes:
print #main.1, "First Textbox Text"
print #main.2, "Second Textbox Text"
print #main.3, "Third Textbox Text"

wait

[quit]
close #main:end

[Text]
     for i = 1 to 3
         print #main.t, "Contents of textbox ";i;":"
         print #main.t, GetText$(handles(i))
         print #main.t, " "
         print #main.t, " "
     next i
     wait


Function GetText$(hTextbox)
     open "user" for dll as #user
     calldll #user, "GetWindowTextLength",_
     hTextbox as short,_    'handle of control
     numChars as short      'number of characters

     entry$=space$(numChars)+Chr$(0)
     'set pointer to area of memory, add null termination
     lenEntry= Len(entry$)

     calldll #user, "GetWindowText", _
     hTextbox as word, _  'handle of control
     entry$ as ptr, _     'pointer to memory address
     lenEntry as ushort,_ 'length of text string
     result as ushort     'returns number of characters copied

     close #user

     GetText$=left$(entry$,result)
END FUNCTION

#1054 From: brian.simonds@...
Date: Tue Sep 4, 2001 11:40 am
Subject: Re: different file extensions
brian.simonds@...
Send Email Send Email
 
Hi

The extensions are up to the programmer there are conventions you can
follow but LB does not care what extension is used for random and
sequential files. I tend to sick with .txt for sequential files
and .dat for random files.

Note it can be difficlt to view random files in NOTEPAD as they don't
have CR/LF at the end of each record the data just wraps around.

BrianS ...

--- In libertybasic@y..., Chergarj@c... wrote:
> What do the different extensions to sequential and random access
files mean,
> and what is necessary to view or print those file types?
>
> If we open or append a file with a basic-program, we may use .txt,
which
> allows us to view the file in NOTEPAD if we want.  But what about
other
> types?  How to you view and use .dat file types, and how are they
different
> from .txt, and what are the other filetypes possible when we deal
with files
> in liberty BASIC programs?
>
> G C

#1055 From: David Beiswenger <djbwisc@...>
Date: Tue Sep 4, 2001 12:42 pm
Subject: OOPS! Found flaw in MAKE TKN
djbwisc@...
Send Email Send Email
 
First off, Thank you very much A.Watson. You're are a Godsend.


Help!,

I accidently picked my sourse code file with ".bas" ext. for the output of the
".TKN" file. I suppose my source code is
lost for good, right?

Also, which it the latest and greatest LB editor for registered users? #19? Why
was coloring integer data dropped in
this version?

Thanks for all the help folks.

DB

#1056 From: "A. Watson" <alycewatson@...>
Date: Tue Sep 4, 2001 12:57 pm
Subject: Re: OOPS! Found flaw in MAKE TKN
alycewatson@...
Send Email Send Email
 
At 07:42 AM 9/4/01 -0500, you wrote:
> Help!,
>
>"""" file. I suppose my source code is
> lost for good, right?

It might not be lost.  Do you have preferences set to make automatic
backups?  Check your program's directory and see if there is a file called
"progname.bak", with the appropriate name for your program, of course!

Alyce

#1057 From: "Neil Tremblay" <a1a46483@...>
Date: Tue Sep 4, 2001 2:01 pm
Subject: Re: program confuses "appending" and "output"
a1a46483@...
Send Email Send Email
 
---- Chergarj@... wrote:
[Non text/plain message body suppressed]

I gave your source code a try and it failed as described. In rechecking
the LB help file I noticed that "append" is no longer included in the
purpose for types of files. I am not sure if this was an over site or
error or change. Only Carl could answer that question.

--
Neil
a1a46483@... - email
http://lcsoftlb.50megs.com
http://lbdev.5u.com


___________________________________________________________
FREE voicemail, email and fax, all in one place.  Sign Up Now!
http://www.mybc.com

Messages 1028 - 1057 of 46456   Oldest  |  < Older  |  Newer >  |  Newest Start Topic
Add to My Yahoo!      XML What's This?

Copyright © 2010 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines NEW - Help