Weekly Qbasic and Qb64 Lesson Topics
March 29, 2024, 08:51:51 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
   Home   Help Search Arcade Links Staff List Login Register  
Pages: 1 [2] 3 4 ... 10
 11 
 on: April 23, 2021, 11:19:40 am 
Started by Anthony.R.Brown - Last post by Anthony.R.Brown
QB64 Is Fantastic! especially the 64 bit version!...so nothing wrong there the problem with the www.qb64.org/forum is that they done away with the Off Topic section, without asking any of the members! ? just like that!!! as if all the work the members done,posting threads etc. was for nothing!
You tell me ? why would anyone want to be on a site like that! ?


A.R.B

 12 
 on: February 09, 2021, 09:33:18 am 
Started by Anthony.R.Brown - Last post by Anthony.R.Brown
Hi Everyone

I left The JOKE! Forum https://www.qb64.org/forum because they got rid of the Off Topic Thread Completely! Huh Sad
Plus there was a lot of in House Arguing regarding the best way to run Program Competitions Etc. Sad
How do others feel about the Forum ?



Anthony.R.Brown 

 13 
 on: February 20, 2020, 12:36:19 am 
Started by kanga85 - Last post by kanga85
I formerly printed in QB64 to LPT1, but now I have a USB printer.   This claims to to be at USB001, but I cannot find the correct code to print to it.   Open "O", #1, LPT1 used to work, but now Open "O", #1, USB001 fails to send anything to the USB printer.    What code should I use?   
Thanks for any help

 14 
 on: February 14, 2020, 05:16:47 am 
Started by kanga85 - Last post by kanga85
In a QB64 program I have the line:
Open "O:, #1, "LPT1:"
used to print to an old HP LaserJet connected through a printer port.   
The Laser Jet has now collapsed and I now have a newer printer (Brother HL 2130) connected through a USB port.
What code do I now need to 'Open' the line to the USB printer.
Thanks for any help.

p.s.  This is an old program, first written in Basic in 1975 for a Hitachi Peach, subsequently changed for Windows, XP, through to Windows 10, and now compiled in QB64.

 15 
 on: June 18, 2018, 08:05:58 am 
Started by parsec - Last post by parsec
Hi,
I have a problem rounding numbers: why

PRINT CLNG(90.7755 * 1000) / 1000 = 90.776

and instead

PRINT CLNG(90.7754 * 1000) / 1000 = 90.77500000000001?

I'm becoming crazy!
Thanks a lot!!

fabio


 16 
 on: June 17, 2018, 10:55:59 am 
Started by parsec - Last post by parsec
Hello!
I live in the wonderful Italy and my English is very terrible, but now I can use the web to have assistance, not like when I started using basic program, when dinosaurs wandered around... Sad
If someone want to correct my English texts is welcome! ...In exchange I could teach how to cook a very tasty spaghetti!! Cheesy Cheesy
So, I came in this forum to have some answer about this program since I didn't used it since dozens years ago...

Fabio

 17 
 on: January 12, 2018, 06:42:18 am 
Started by PhilAJ - Last post by PhilAJ
Hope someone can help me - I have a little QB64 program that loads a website - passing details from the command line. This works fine - BUT - it leaves the command window open.

Anybody know how I can close this automatically once the web page loaded.

My code is; (actual webpage changed)

SHELL "http://www.bbc.co.uk"

I have tried using _HIDE and _SHELLHIDE but don't seem to work.

ANy help appreciated.

Phil

 18 
 on: January 03, 2018, 11:29:36 am 
Started by Luke - Last post by Luke
I discovered a QB64 work around for the Fundamental Problem. just above the Z$=input (LOC(2),#2) statement i added line ON ERROR GOTO EHandler. Then at the end of the program I put
EHandler: 
errfile$ = _INCLERRORFILE$
RESUME NEXT

I used LOC for length of input record b/c LOF always =0. The EOF=-1 always generates an INPUT PAST END OF FILE error. This way the program steps over the error and continues.
It may not be the best way but it works for me.
As for the every other letter read. I jury rigged the output message of the A/D with spaces to output the characters in the position captured by the input command. Weird but it works and I am continuing with my project not really understanding why it's that way.

 19 
 on: December 18, 2017, 03:06:58 pm 
Started by Luke - Last post by Luke
When one opens a com port to read a serial data buffer the open command automatically sets the EOF, LOC, and LOF to no message state.
I.E. the statement OPEN "COM3: 9600,n,8,1" for INPUT AS #1 will set EOF=-1. When attempt is made to obtain data from the com buffer with the INPUT statement you get an INPUT PAST END error because EOF=-1.
When you open the com port with the FOR RANDOM option then an attempt to obtain data with a GET statement you get a BAD RECORD LENGTH error due to LOF=0.
I have yet to find a way around this problem.

I have an A/D converter connected to a 1.2 V battery that has placed the message:   Voltage = 1.2* in the buffer. If I open FOR INPUT and upon the INPUT PAST END OF FILE error a DO YOU WANT TO CONTINUE dialog box appears. IF I select YES I get Vlae=12. That is every other character in the buffer. I altered the A/D output spacing to shift things by one space at the beginning and I get otg.2* . I.E the missing letters. Although not correct by any means it gives me confidence that the correct message is sitting in the buffer. I just can't read it because of the above defined problem.
Has anyone else encountered this problem? Is it due to my particular version compiler? Is there a "work around?"

I discovered a QB64 work around for the Fundamental Problem. just above the Z$=input (LOC(2),#2) statement i added line ON ERROR GOTO EHandler. Then at the end of the program I put
EHandler: 
errfile$ = _INCLERRORFILE$
RESUME NEXT

I used LOC for length of input record b/c LOF always =0. The EOF=-1 always generates an INPUT PAST END OF FILE error. This way the program steps over the error and continues.
It may not be the best way but it works for me.








 20 
 on: December 13, 2017, 06:26:41 pm 
Started by Luke - Last post by Luke
I am getting "bad record length" error at the GET #1, ,m$ statement in the following QB64 code. I can't seem to find exactly how I should go about reading the message posted in the com port buffer by Arduino when all I asked for is A/D voltage on analog pin 4.
Any Ideas?
OPEN "Com3:9600,n,8,1,ds0,cs0,rs" FOR RANDOM AS #1
_DELAY .5 '                                       Delay to let Com Port settle
FIELD #1, 50 AS m$

t1 = TIMER '                                     Start time for getdata

getdata:
bytes% = LOC(1) '                             Check receive buffer for data
IF bytes% = 0 THEN GOTO getdata '         After thousands of getdata cycles it continues
PRINT "Bytes="; bytes '                            Bytes remain at 0
DO UNTIL EOF(1)
    GET #1, , m$ '                             BAD RECORD LENGTH ERROR
    PRINT "LEN(m$)= "; LEN(m$) '               Length of m$ = 10
    IF INSTR(m$, "*") > 0 THEN GOTO duh '    Never finds End of Message (*)
LOOP

IF bytes% = 0 THEN GOTO getdata
t2 = TIMER '                                         End time, Have data
DeltaT = t2 - t1 '                                   How long did it take?
GOTO stepover

duh:
PRINT "DUH instr= "; INSTR(m$, "*") '               Never hits this line
stepover:

tmp$ = "DeltaT= #.### Seconds Until LOC(1) > 0" '    Various times arround 0.66 Sec
PRINT USING tmp$; DeltaT
PRINT "m$ Received= "; m$ + "&" '                 Prints 10 spaces No Data
PRINT "endofdata= "; endofdata '                  endofdata=0, Never got "*"
PRINT "ctr= "; ctr, CHR$(13) '            Show number of times you pressed continue
CLOSE #1

Arduino Code sending info is the following:

 if ( cmd == 2)//getanalog
   {
        int sensorValue = analogRead(pin);//
        delay(10);
        float voltage= sensorValue*(5.0/1023.0);
        Serial.print("Voltage =");
        Serial.print(voltage);
        Serial.print(",");
        Serial.print("*");

The asterisk should be in the buffer indicating the end of my message.
 

Pages: 1 [2] 3 4 ... 10
Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy