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: 5578
  • 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 43786 - 43824 of 46481   Oldest  |  < Older  |  Newer >  |  Newest Start Topic
Messages: Show Message Summaries Sort by Date ^  
#43786 From: "Gordon" <dutch_gordon@...>
Date: Sat Oct 1, 2011 2:58 pm
Subject: Re: Do I feel like a twit
dutch_gordon
Send Email Send Email
 
what about;

confirm "an other chart";yn$
print yn$

Gordon

--- In libertybasic@yahoogroups.com, "Stefan Pendl" <pendl2megabit@...> wrote:
>
> >
> > Bill VERY SWEET.  I looked at your tutorial.  I knew
> > something like that could be done.
> > What I did, was it wrong??
> > Kurt
> >  
>
> Your initial way was not wrong, it was just not able to allow multiple ways to
say yes or no.
>
>
> ---
> Stefan Pendl
> http://stefanpendl.runbasichosting.com/
>
> Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
> Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe
>
> Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/
>
> Books at http://www.lulu.com/ and http://www.amazon.com/
> Alyce Watson ... APIs for Liberty BASIC
> Carl Gundel .... Beginning Programming with Liberty BASIC
>
> Windows 7 Home Premium 64-bit SP1
> AMD Turion X2 RM-70 2GHz, 4GB RAM
>

#43787 From: "hmatlock9978" <hmatlock9978@...>
Date: Sun Oct 2, 2011 12:14 am
Subject: new kid to programming
hmatlock9978
Send Email Send Email
 
Hello group
thank you for accepting me.
I would like to know a starting place for a sixty seven old man.
any help will be a big help.
                I hope to here from you soon and thankyou.
                              hmatlock9978@...

#43788 From: RipSaw <rij4360@...>
Date: Sun Oct 2, 2011 2:01 am
Subject: Re: new kid to programming
rij4360
Send Email Send Email
 
Mr. Matlock,  There are several tutorials around Bill Lopez is the best there
is.   Many have helped me and no nasty comments in return. JohnF in UK is also
tops. Dave Speck has helped. Many have offered helped me.  Have you had any
programming at all?
God Bless you.  Kurt - Bethlehem PA

From: hmatlock9978 <hmatlock9978@...>
To: libertybasic@yahoogroups.com
Sent: Saturday, October 1, 2011 8:14 PM
Subject: [libertybasic] new kid to programming


 
Hello group
thank you for accepting me.
I would like to know a starting place for a sixty seven old man.
any help will be a big help.
I hope to here from you soon and thankyou.
hmatlock9978@...




[Non-text portions of this message have been removed]

#43789 From: RipSaw <rij4360@...>
Date: Sun Oct 2, 2011 2:08 am
Subject: Re: new kid to programming
rij4360
Send Email Send Email
 
Mr. Matlock, Garry Passmore, Stefan Pendl and Marc have offered help and advice.
The best is here.
My advice, dont be a hero, when tired walk away.  I made a bunch of foolish
mistakes the other day.
Kurt

From: hmatlock9978 <hmatlock9978@...>
To: libertybasic@yahoogroups.com
Sent: Saturday, October 1, 2011 8:14 PM
Subject: [libertybasic] new kid to programming


 
Hello group
thank you for accepting me.
I would like to know a starting place for a sixty seven old man.
any help will be a big help.
I hope to here from you soon and thankyou.
hmatlock9978@...




[Non-text portions of this message have been removed]

#43790 From: "Stefan Pendl" <pendl2megabit@...>
Date: Sun Oct 2, 2011 7:36 am
Subject: RE: new kid to programming
pendl2megabit
Send Email Send Email
 
>
> Hello group
> thank you for accepting me.
> I would like to know a starting place for a sixty seven old man.
> any help will be a big help.
>                I hope to here from you soon and thankyou.
>

Welcome to the group.

Liberty BASIC ships with a tutorial, which you can access from the help menu of
the editor.
This is usually a good starting point for anyone starting to use LB.

If the menu entry does not seem to launch the tutorial follow the instructions
below.

For 32-bit Windows:

1) Select "File => Open"
2) Enter "%ProgramFiles%" as the file name and hit open
3) Open the "Liberty BASIC v4.04" folder
4) Open the file "lb4tutorial.lsn"

For 64-bit Windows the steps are the same except you enter "%ProgramFiles(x86)%"
in step 2).

If you have installed LB into a folder different from the default location, you
need to browse there.


---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

#43792 From: "d.levinsson" <d.levinsson@...>
Date: Thu Oct 6, 2011 10:28 am
Subject: USB Serial interface to DAQ DLP-IO20 from Liberty Basic
d.levinsson
Send Email Send Email
 
Hello!

I have purchased the DLP-IO20 DAQ and wants to use it for heating control in my
sunpower enviroment.

I wonder if annyone using LB has any experiance of 'talking/listening' to the
unit.

I have made efforts to send commands  but i get no response.
The DLP-IO20 is working fine using the testprogram from audon.co.uk.

Aprishiate any help and tips.

Dag Levinsson

#43793 From: "Rod" <rodbird@...>
Date: Thu Oct 6, 2011 1:04 pm
Subject: Re: USB Serial interface to DAQ DLP-IO20 from Liberty Basic
rod_bird001
Send Email Send Email
 
Have you established a serial connection?, I read this in the manual.

"Note: If you are utilizing the dual-mode drivers from FTDI (CDM2.x.x) and you
want to use the Virtual
COM Port (VCP) drivers, then it may be necessary to disable the D2XX drivers
first via Device Manager.
To do so, right click on the entry under USB Controllers that appears when the
DLP-IO20 is connected,
select Properties, select the Advanced tab, put a check in the option for "Load
VCP" and click OK. Then
unplug and replug the DLP-IO20, and a COM port should appear in Device Manager
under Ports (COM
& LPT)."

--- In libertybasic@yahoogroups.com, "d.levinsson" <d.levinsson@...> wrote:
>
> Hello!
>
> I have purchased the DLP-IO20 DAQ and wants to use it for heating control in
my sunpower enviroment.
>
> I wonder if annyone using LB has any experiance of 'talking/listening' to the
unit.
>
> I have made efforts to send commands  but i get no response.
> The DLP-IO20 is working fine using the testprogram from audon.co.uk.
>
> Aprishiate any help and tips.
>
> Dag Levinsson
>

#43794 From: "Rod" <rodbird@...>
Date: Thu Oct 6, 2011 1:16 pm
Subject: Re: USB Serial interface to DAQ DLP-IO20 from Liberty Basic
rod_bird001
Send Email Send Email
 
Once you know the com port number assigned by windows change comX in this code
and try it.

'substitute the com port you find has been assigned
open "comX:9600,n,8,1,ds0,cs0,rs" for random as #com
timer 500, [send]
wait

[send]
'ping the controller
timer 0
packet$=chr$(hexdec("02")+chr$(hexdec("27")
print #com, packet$;
timer 200, [read]
wait

[read]
timer 0
dataRead$ = input$(#com, lof(#com))
if dataRead$="Y" then
     print "successs"
else
     print "fail"
end if


close #com
end


--- In libertybasic@yahoogroups.com, "Rod" <rodbird@...> wrote:
>
> Have you established a serial connection?, I read this in the manual.
>
> "Note: If you are utilizing the dual-mode drivers from FTDI (CDM2.x.x) and you
want to use the Virtual
> COM Port (VCP) drivers, then it may be necessary to disable the D2XX drivers
first via Device Manager.
> To do so, right click on the entry under USB Controllers that appears when the
DLP-IO20 is connected,
> select Properties, select the Advanced tab, put a check in the option for
"Load VCP" and click OK. Then
> unplug and replug the DLP-IO20, and a COM port should appear in Device Manager
under Ports (COM
> & LPT)."
>
> --- In libertybasic@yahoogroups.com, "d.levinsson" <d.levinsson@> wrote:
> >
> > Hello!
> >
> > I have purchased the DLP-IO20 DAQ and wants to use it for heating control in
my sunpower enviroment.
> >
> > I wonder if annyone using LB has any experiance of 'talking/listening' to
the unit.
> >
> > I have made efforts to send commands  but i get no response.
> > The DLP-IO20 is working fine using the testprogram from audon.co.uk.
> >
> > Aprishiate any help and tips.
> >
> > Dag Levinsson
> >
>

#43795 From: "randygardner12" <randygardner12@...>
Date: Thu Oct 6, 2011 2:53 pm
Subject: Probably a dumb question about LINE INPUT and the len(n$) function.
randygardner12
Send Email Send Email
 
I have text file that I get every day, but the beginning of each line has an
unwanted character (spaces & numbers).   So what I want to do is strip off that
character.  Below is what I tried but it only works for the first line.  Can
anybody tell me what I am doing wrong?

'............................................
    '1st way:

    open "C:\Documents\Text_files\Source_Text.txt" for input as #rawtext
    open "C:\Documents\Text_files\PARSE_Text.txt" for output as #parstext

    WHILE EOF(#rawtext) = 0

          LINE INPUT #rawtext, n$
          length=len(n$)
          PRINT #parstext, right$(n$, (length-1))
    WEND

    CLOSE #rawtext
    CLOSE #parstext

    'I have tried it two ways but get the same results. ............

'2nd Way -----------------------------------------------

     open "C:\Documents\Text_files\Source_Text.txt" for input as #rawtext
    open "C:\Documents\Text_files\PARSE_Text.txt" for output as #parstext

    WHILE EOF(#rawtext) = 0

       LINE INPUT #rawtext, n$
       PRINT #parstext, right$(n$, (len(n$)-1))
    WEND

    CLOSE #rawtext
    CLOSE #parstext

'---------------------------------------------
Below is a compressed version of what the source file looks like:

1                       Chapter
0IF65                  Chapter1           PAGE 00000001
010/05    18:39   FOR OCT   05, 2011
2                       Chapter
1Born in 1923 in Buckhead, Georgia,
  Dickey spent a year at Clemson University before
0enlisting in World War II in 1942. As a member of
  the 418th Night Fighter Squadron,
  Dickey flew more than 100 combat missions in the
  Pacific Theater, and it was during
1this time that he began to experiment with poetry.
  After the war, he finished his
3degree at Vanderbilt University. Although he
  started writing poetry in 1947,
0Dickey did not become a full-time poet until
1                       Chapter
0IF65                  Chapter2        PAGE 00000004
010/05    18:39   FOR OCT   05, 2011
                        Chapter
1Writing ad copy for much of the 1950s,
  Dickey secured a place for himself in the
3world of advertising and business. However,
7after the publication of his first book,

#43796 From: David Salter <dws2468@...>
Date: Thu Oct 6, 2011 3:27 pm
Subject: RE: Probably a dumb question about LINE INPUT and the len(n$) function.
dws2468
Send Email Send Email
 
Try changing to "WHILE NOT EOF(#rawtext)" and without the "=0"













To: libertybasic@yahoogroups.com
From: randygardner12@...
Date: Thu, 6 Oct 2011 14:53:15 +0000
Subject: [libertybasic] Probably a dumb question about LINE INPUT and the
len(n$) function.






I have text file that I get every day, but the beginning of each line has an
unwanted character (spaces & numbers). So what I want to do is strip off that
character. Below is what I tried but it only works for the first line. Can
anybody tell me what I am doing wrong?

'............................................
'1st way:

open "C:\Documents\Text_files\Source_Text.txt" for input as #rawtext
open "C:\Documents\Text_files\PARSE_Text.txt" for output as #parstext

WHILE EOF(#rawtext) = 0

LINE INPUT #rawtext, n$
length=len(n$)
PRINT #parstext, right$(n$, (length-1))
WEND

CLOSE #rawtext
CLOSE #parstext

'I have tried it two ways but get the same results. ............

'2nd Way -----------------------------------------------

open "C:\Documents\Text_files\Source_Text.txt" for input as #rawtext
open "C:\Documents\Text_files\PARSE_Text.txt" for output as #parstext

WHILE EOF(#rawtext) = 0

LINE INPUT #rawtext, n$
PRINT #parstext, right$(n$, (len(n$)-1))
WEND

CLOSE #rawtext
CLOSE #parstext

'---------------------------------------------
Below is a compressed version of what the source file looks like:

1 Chapter
0IF65 Chapter1 PAGE 00000001
010/05 18:39 FOR OCT 05, 2011
2 Chapter
1Born in 1923 in Buckhead, Georgia,
Dickey spent a year at Clemson University before
0enlisting in World War II in 1942. As a member of
the 418th Night Fighter Squadron,
Dickey flew more than 100 combat missions in the
Pacific Theater, and it was during
1this time that he began to experiment with poetry.
After the war, he finished his
3degree at Vanderbilt University. Although he
started writing poetry in 1947,
0Dickey did not become a full-time poet until
1 Chapter
0IF65 Chapter2 PAGE 00000004
010/05 18:39 FOR OCT 05, 2011
Chapter
1Writing ad copy for much of the 1950s,
Dickey secured a place for himself in the
3world of advertising and business. However,
7after the publication of his first book,






[Non-text portions of this message have been removed]

#43797 From: "Stefan Pendl" <pendl2megabit@...>
Date: Thu Oct 6, 2011 5:06 pm
Subject: RE: Probably a dumb question about LINE INPUT and the len(n$) function.
pendl2megabit
Send Email Send Email
 
>
> '............................................
> '1st way:
>
> open "C:\Documents\Text_files\Source_Text.txt" for input as #rawtext
> open "C:\Documents\Text_files\PARSE_Text.txt" for output as #parstext
>
> WHILE EOF(#rawtext) = 0
>
> LINE INPUT #rawtext, n$
> length=len(n$)
> PRINT #parstext, right$(n$, (length-1))
> WEND
>
> CLOSE #rawtext
> CLOSE #parstext
>

I prefer the following use of the EOF() function, since it resembles the
sentence: "While not at the end-of-file of ...".
In addition I prefer to close the file opened last as the first one, like first
in, last out.

'---code start (watch for line wraps)

     open "C:\Documents\Text_files\Source_Text.txt" for input as #rawtext
     open "C:\Documents\Text_files\PARSE_Text.txt" for output as #parstext

     WHILE NOT(EOF(#rawtext))
         LINE INPUT #rawtext, n$
         length=len(n$)
         PRINT #parstext, right$(n$, (length-1))
     WEND

     CLOSE #parstext
     CLOSE #rawtext

'---code end

---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

#43798 From: "BruceB" <bruceoboast@...>
Date: Fri Oct 7, 2011 7:19 pm
Subject: Cursor position.
bruceoboast
Send Email Send Email
 
I need to find the current cursor position so that I can continue from that
point after writing information to a specific spot on the screen.  In QuickBasic
I would use CSRLIN and POS(0) to find the position.

Thanks Bruce

#43799 From: "Stefan Pendl" <pendl2megabit@...>
Date: Sat Oct 8, 2011 12:06 am
Subject: RE: Cursor position.
pendl2megabit
Send Email Send Email
 
>
> I need to find the current cursor position so that I can
> continue from that point after writing information to a
> specific spot on the screen.  In QuickBasic I would use
> CSRLIN and POS(0) to find the position.
>

Sorry, there is nothing similar in LB, since the mainwin is not a real console
window.


---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

#43800 From: Gary Passmore <garpmore@...>
Date: Sat Oct 8, 2011 12:57 pm
Subject: Re: Cursor position.
garpmore
Send Email Send Email
 
What about the graphics command  #handle "posxy x y"? 
...from the world according to GaRPMorE


________________________________
From: Stefan Pendl <pendl2megabit@...>
To: libertybasic@yahoogroups.com
Sent: Friday, October 7, 2011 8:06 PM
Subject: RE: [libertybasic] Cursor position.



 

>
> I need to find the current cursor position so that I can
> continue from that point after writing information to a
> specific spot on the screen.  In QuickBasic I would use
> CSRLIN and POS(0) to find the position.
>

Sorry, there is nothing similar in LB, since the mainwin is not a real console
window.

---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM




[Non-text portions of this message have been removed]

#43801 From: "Stefan Pendl" <pendl2megabit@...>
Date: Sat Oct 8, 2011 1:03 pm
Subject: RE: Cursor position.
pendl2megabit
Send Email Send Email
 
> >
> > I need to find the current cursor position so that I can
> > continue from that point after writing information to a
> > specific spot on the screen.  In QuickBasic I would use
> > CSRLIN and POS(0) to find the position.
> >
>
> What about the graphics command  #handle "posxy x y"? 
>

The OP did not tell us where he likes to receive the cursor position, but from
the commands mentioned I assumed it is the mainwin.

Sure the graphics control has all the commands to get the information.


---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

#43803 From: "BruceB" <bruceoboast@...>
Date: Mon Oct 10, 2011 6:26 am
Subject: Re: Cursor position.
bruceoboast
Send Email Send Email
 
The mainwin would be the place, I guess.  How do I use the command and where can
I find more information about it?

Bruce

--- In libertybasic@yahoogroups.com, "Stefan Pendl" <pendl2megabit@...> wrote:
>
> > >
> > > I need to find the current cursor position so that I can
> > > continue from that point after writing information to a
> > > specific spot on the screen.  In QuickBasic I would use
> > > CSRLIN and POS(0) to find the position.
> > >
> >
> > What about the graphics command  #handle "posxy x y"? 
> >
>
> The OP did not tell us where he likes to receive the cursor position, but from
the commands mentioned I assumed it is the mainwin.
>
> Sure the graphics control has all the commands to get the information.
>
>
> ---
> Stefan Pendl
> http://stefanpendl.runbasichosting.com/
>
> Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
> Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe
>
> Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/
>
> Books at http://www.lulu.com/ and http://www.amazon.com/
> Alyce Watson ... APIs for Liberty BASIC
> Carl Gundel .... Beginning Programming with Liberty BASIC
>
> Windows 7 Home Premium 64-bit SP1
> AMD Turion X2 RM-70 2GHz, 4GB RAM
>

#43804 From: "Stefan Pendl" <pendl2megabit@...>
Date: Mon Oct 10, 2011 4:43 pm
Subject: RE: Cursor position.
pendl2megabit
Send Email Send Email
 
> > > >
> > > > I need to find the current cursor position so that I can
> > > > continue from that point after writing information to a
> > > > specific spot on the screen.  In QuickBasic I would use
> > > > CSRLIN and POS(0) to find the position.
> > > >
> > >
> > > What about the graphics command  #handle "posxy x y"? 
> > >
> >
> > The OP did not tell us where he likes to receive the cursor
> position, but from the commands mentioned I assumed it is the mainwin.
> >
> > Sure the graphics control has all the commands to get the
> information.
> >
>
> The mainwin would be the place, I guess.  How do I use the
> command and where can I find more information about it?
>

There is no possibility in the mainwin to retrieve the cursor position.

You would have to track the position on your own.

Sorry, but the command mentioned can only be used in a graphics control or
window.


---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

Top-posting:
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?

#43805 From: "Stefan Pendl" <pendl2megabit@...>
Date: Mon Oct 10, 2011 4:50 pm
Subject: RE: Treasure Hunt (game)
pendl2megabit
Send Email Send Email
 
>
> In the game below, the aim is to locate treaure spots. Red
> means too far, white is near, and green means located. The
> program ends abruptly before all 5 spots are located. Could
> anyone tell me what is wrong, what is missing?
>

There was a wait missing.


'---code start (watch for line wraps)

     nomainwin

     WindowWidth = 500 : WindowHeight = 500
     UpperLeftX = INT((DisplayWidth-WindowWidth)/2)
     UpperLeftY = INT((DisplayHeight-WindowHeight)/2)

     graphicbox #w.g, 0, 0, 495, 495

     open "Treasure Hunt!" for window as #w
     #w "trapclose [quit]"
     #w.g, "home ; down; fill black"
     gosub [FlashTheRndmSpots]
     #w.g, "discard"
     cursor crosshair :hit=0

[InputLoop]
     #w.g "setfocus"
     #w.g "when leftButtonDown [check]"
     wait

[check]
     ux=MouseX:uy=MouseY
     for spot=1 to 5
         px(spot)=sqr((tx(spot)-ux)^2+(ty(spot)-uy)^2) 'px=proximity
     next
     sort px(),1,5 :lowestpx=px(1)
     c$="black" :s$="3"
     if lowestpx>20 and lowestpx<=50 then c$="white"
     if lowestpx>50 then c$="red"
     if lowestpx<=20 then c$="green" :s$="6" :hit=hit+1
     #w.g "down; color ";c$; ";size ";s$
     #w.g "set ";ux;" ";uy
     #w.g "flush"
     if hit<5 then wait

     #w.g "discard"
     for spot=1 to 5
         #w.g "color pink; circle 4; place ";tx(spot);" ";ty(spot)
         #w.g "flush"
     next
     wait

[quit]
     cursor normal
     close #w
     end
     '-----------------------------------------------
[FlashTheRndmSpots]
     for spot=1 to 5
         tx(spot)=1+int(rnd(0)*485) :ty(spot)=1+int(rnd(0)*485)
         for y=1 to 8
             print #w.g, "color white; size ";y
             print #w.g, "set ";tx(spot);" ";ty(spot)
             call pause 20
             print #w.g, "fill black"
         next
         for y=8 to 1 step-1
             print #w.g, "color white; size ";y
             print #w.g, "set ";tx(spot);" ";ty(spot)
             call pause 20
             print #w.g, "fill black"
         next
     next
     return

sub pause millisec
     calldll #kernel32,"Sleep",millisec as ulong,result as void
end sub

'---code end

---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

#43806 From: "Stefan Pendl" <pendl2megabit@...>
Date: Mon Oct 10, 2011 5:00 pm
Subject: RE: Treasure Hunt (game)
pendl2megabit
Send Email Send Email
 
>
>     #w.g "discard"
>     for spot=1 to 5
>         #w.g "color pink; circle 4; place ";tx(spot);" ";ty(spot)
>         #w.g "flush"
>     next
>     wait
>

One more thing, I would put the flush after the next, since it does not make
sense to flush inside a loop.


---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

#43811 From: "Stefan Pendl" <pendl2megabit@...>
Date: Wed Oct 12, 2011 8:15 am
Subject: RE: CSRLIN...
pendl2megabit
Send Email Send Email
 
>
> I look forward to meeting LB5 because Carl has promised to
> include Color for the mainwin.
> If it's not too much trouble, may I request that he includes
> the commands,CSRLIN and POS(0).
> Together with the existing LOCATE, the pair would complement
> printing anywhere in the mainwin screen. As is, I may not
> know where to `locate' if I don't know the `csrlin' or `pos(0)'
>

If you have a static layout of your mainwin screen, then you just need LOCATE.


---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

#43813 From: "Eric" <epankoke@...>
Date: Wed Oct 12, 2011 6:10 pm
Subject: Re: Treasue Hunt
styskul
Send Email Send Email
 
I don't think you should have to stop anyone from clicking.  Instead, set some
kind of variable as "true" when it is okay to click, and "false" as soon as
clicking should no longer be valid.  Once the variable is "false", just don't
run the code in the click routine any more.

--- In libertybasic@yahoogroups.com, "green8819" <green8819@...> wrote:
>
> Richard has pointed out that he can't close the window because I use 
[#w,"disable"].
>
> In fact, I was doubtful whether I could disable the whole and only window. But
there was no problem with my XP computer. I used [#w,"disable"] because I don't
know how else to stop users clicking more points after `END' appears. If anyone
knows how to stop the clicking, please share.
>
> Thanks Richard.
>

#43814 From: "Stefan Pendl" <pendl2megabit@...>
Date: Wed Oct 12, 2011 7:25 pm
Subject: RE: Treasue Hunt
pendl2megabit
Send Email Send Email
 
>
> Richard has pointed out that he can't close the window
> because I use  [#w,"disable"].
>
> In fact, I was doubtful whether I could disable the whole and
> only window. But there was no problem with my XP computer. I
> used [#w,"disable"] because I don't know how else to stop
> users clicking more points after `END' appears. If anyone
> knows how to stop the clicking, please share.
>

Issue the when event without an event handler argument and you turn it off.
It is all in the help file.


---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

#43815 From: "jimpitt98" <jimpitt98@...>
Date: Wed Oct 12, 2011 9:33 pm
Subject: Boolean
jimpitt98
Send Email Send Email
 
I'm a newcomer, so pls be patient.
I need to know if there's any way I can string a number of boolean
comparisons together without running a long, long line.  Like
if (a>b)and(b>c)and(d>f)...etc. In other words is there something I can put at
the end of a line to indicate there's more to come?

Thanks!
jimpitt98

#43816 From: David Speck <MedelecInstruments@...>
Date: Wed Oct 12, 2011 11:45 pm
Subject: Re: Boolean
dspeck13021
Send Email Send Email
 
Jim,

LB lines can be concatenated with the underscore "_" character, i. e.

if  (a>b) and _
      (b>c) and _
      (d>f)...

This is often done with the long string of arguments to .DLL calls to
make them easier to comprehend.

Dave



On 10/12/2011 5:33 PM, jimpitt98 wrote:
> I'm a newcomer, so pls be patient.
> I need to know if there's any way I can string a number of boolean
> comparisons together without running a long, long line.  Like
> if (a>b)and(b>c)and(d>f)...etc. In other words is there something I can put at
the end of a line to indicate there's more to come?
>
> Thanks!
> jimpitt98


[Non-text portions of this message have been removed]

#43817 From: Brandon Parker <nukesrus21@...>
Date: Wed Oct 12, 2011 11:52 pm
Subject: RE: Boolean
nukesrus21
Send Email Send Email
 
jimpitt98,

Welcome to Liberty BASIC!!

You can use the line continuation character (_     aka. underscore).  Is that
what you are looking for?

If (a>b)and _
    (b>c)and _
    (d>f) Then

'Do Something

End If

{:0)

Brandon



To: libertybasic@yahoogroups.com
From: jimpitt98@...
Date: Wed, 12 Oct 2011 21:33:08 +0000
Subject: [libertybasic] Boolean






I'm a newcomer, so pls be patient.
I need to know if there's any way I can string a number of boolean
comparisons together without running a long, long line. Like
if (a>b)and(b>c)and(d>f)...etc. In other words is there something I can put at
the end of a line to indicate there's more to come?

Thanks!
jimpitt98






[Non-text portions of this message have been removed]

#43819 From: "Stefan Pendl" <pendl2megabit@...>
Date: Thu Oct 13, 2011 7:55 am
Subject: RE: Boolean
pendl2megabit
Send Email Send Email
 
>
> I'm a newcomer, so pls be patient.
> I need to know if there's any way I can string a number of boolean
> comparisons together without running a long, long line.  Like
> if (a>b)and(b>c)and(d>f)...etc. In other words is there
> something I can put at the end of a line to indicate there's
> more to come?
>


See "Help => Liberty BASIC Help => Language Syntax and Usage => Logic and
Structure => Logical Line Extension".


---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

#43820 From: "Stefan Pendl" <pendl2megabit@...>
Date: Thu Oct 13, 2011 8:05 am
Subject: RE: Treasure Hunt
pendl2megabit
Send Email Send Email
 
>
> It's supposed to be really over.But....
> The END message hides clicked points under it. But I want to
> see the points as well.
> Sorry for troubling again. Any brilliant suggestions?
>
> I will post a new version when it's really over.
>

Don't know how you display your end message, but using a notice box is not the
way I would go.

If you write it directly into the graphics area, you can use STRINGWIDTH to know
the length of the text on screen.
Now that you know the area occupied by the text through its width and height,
you can calculate the best position by calculating a
virtual rectangle with the lower right hand corner at the treasure points.

For each of those rectangles you check, if the top left hand corner is still in
the graphics area and that there is no treasure
point position inside of it.

Another way would be making a sprite and let it float around.
The sprite is easy to create on the fly, since it is just text, black on white
for the mask and white or any other color on black
for the display.


---
Stefan Pendl
http://stefanpendl.runbasichosting.com/

Liberty BASIC 4.04 Pro ... http://www.libertybasic.com/assist.html
Liberty BASIC 4.04 ....... http://www.libertybasic.com/lb404setup.exe

Liberty BASIC Bug Tracker ... http://libertybasicbugs.wikispaces.com/

Books at http://www.lulu.com/ and http://www.amazon.com/
Alyce Watson ... APIs for Liberty BASIC
Carl Gundel .... Beginning Programming with Liberty BASIC

Windows 7 Home Premium 64-bit SP1
AMD Turion X2 RM-70 2GHz, 4GB RAM

#43822 From: "RipSaw" <rij4360@...>
Date: Thu Oct 13, 2011 5:12 pm
Subject: Sprites
rij4360
Send Email Send Email
 
I am looking for VERY simple examples of Liberty Basic Sprites.
I do not need Sprites colliding, passing in front or behind.

I have been looking at Sprite help files insode Liberty Basic.

Please can anyone help me?

Ripsaw

#43823 From: "Rod" <rodbird@...>
Date: Thu Oct 13, 2011 8:03 pm
Subject: Re: Sprites
rod_bird001
Send Email Send Email
 
Start here and follow the series. They are well written and easy to follow.

http://lbpe.wikispaces.com/sprite1

--- In libertybasic@yahoogroups.com, "RipSaw" <rij4360@...> wrote:
>
> I am looking for VERY simple examples of Liberty Basic Sprites.
> I do not need Sprites colliding, passing in front or behind.
>
> I have been looking at Sprite help files insode Liberty Basic.
>
> Please can anyone help me?
>
> Ripsaw
>

#43824 From: RipSaw <rij4360@...>
Date: Thu Oct 13, 2011 8:39 pm
Subject: Re: Re: Sprites
rij4360
Send Email Send Email
 
Rod where are u?? may I call u via voice?  I am there now, Kurt


From: Rod <rodbird@...>
To: libertybasic@yahoogroups.com
Sent: Thursday, October 13, 2011 4:03 PM
Subject: [libertybasic] Re: Sprites


 
Start here and follow the series. They are well written and easy to follow.

http://lbpe.wikispaces.com/sprite1

--- In libertybasic@yahoogroups.com, "RipSaw" <rij4360@...> wrote:
>
> I am looking for VERY simple examples of Liberty Basic Sprites.
> I do not need Sprites colliding, passing in front or behind.
>
> I have been looking at Sprite help files insode Liberty Basic.
>
> Please can anyone help me?
>
> Ripsaw
>




[Non-text portions of this message have been removed]

Messages 43786 - 43824 of 46481   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