Search found 8 matches

by WAGNERLIP
Feb 04, 2022 17:00
Forum: Hardware Interfaces / Communication
Topic: FreeBasic reading COMx: port
Replies: 4
Views: 3657

Re: FreeBasic reading COMx: port

Hi, reading FreeBasic documentation I found (and remember from old BASIC) the LOF, LOC, EOF from opened files/devices, and I will try, never used for COM ports, only for data files.

Post Edit: Tested all, no good, could not make it work to anticipate if data is there to be read or not.
by WAGNERLIP
Feb 04, 2022 16:09
Forum: Hardware Interfaces / Communication
Topic: FreeBasic reading COMx: port
Replies: 4
Views: 3657

FreeBasic reading COMx: port

Hi, I wrote a simple code for reading an optical touchscreen that sends coordinates serially in 8 bytes +CRNL via a FTDI chip USB to the PC. The code is working nicely and drawing on a Screen21 for verification of touchscreen working all over the place. There are two problems. First, I want to inter...
by WAGNERLIP
May 30, 2013 19:03
Forum: Beginners
Topic: Open "filename" for output as #1
Replies: 10
Views: 5635

Re: Open "filename" for output as #1

Seriously though, your config file doesn't need to be made hidden, just put it in a standard location like APPDATA. Normal users will never find it there. If there is sensitive data stored in the config file then you should encrypt it either using the winapi functions or a trusted 3rd party library...
by WAGNERLIP
May 29, 2013 19:22
Forum: Beginners
Topic: Open "filename" for output as #1
Replies: 10
Views: 5635

Re: Open "filename" for output as #1

Some tips ;) - first line in code- unneeded - "fb" is default choice - use 'freefile' for file handle, not constants - wrong using of 'close' - in block - bad way 'opening file 'immediate read/write actions 'closing file - missing 'declare' if coding in non-spaghetti style - use '()' with...
by WAGNERLIP
May 29, 2013 19:20
Forum: Beginners
Topic: #lang "qb" + Dim Varx as Byte
Replies: 9
Views: 2355

Re: #lang "qb" + Dim Varx as Byte

I think instead of RANDOM ... LEN=1, I would recommend using BINARY for reading bytes. This can be done using a __byte/__ubyte variable, or for a method that will also work in QB, a var-length string containing a single character. Dim A as String Dim B as __UByte Open "filename" for binar...
by WAGNERLIP
May 27, 2013 23:34
Forum: Beginners
Topic: #lang "qb" + Dim Varx as Byte
Replies: 9
Views: 2355

#lang "qb" + Dim Varx as Byte

Okay, I am trying to make a big QBasic file works in FreeBasic. It is 98% working, now just little bits of problems that is causing me to desperate. First: In QB I was using Open "filename" for Random as #1 len=1 Field #1, 1 as A$ Get #1 or Get #1,,A$ So, the "random" filename co...
by WAGNERLIP
May 27, 2013 19:08
Forum: Beginners
Topic: Open "filename" for output as #1
Replies: 10
Views: 5635

Re: Open "filename" for output as #1

The root directory is a protected directory and you would need admin permissions to write there. I would suggest storing your configuration files in %APPDATA%/yourapp, the directory is hidden by default. Thank you for the hint. Even if in a subdirectory, it doesn't work. #lang "fb" #INCLU...
by WAGNERLIP
May 27, 2013 6:51
Forum: Beginners
Topic: Open "filename" for output as #1
Replies: 10
Views: 5635

Open "filename" for output as #1

Hi friends, this is my first post in this forum. I've being programming in compiled basic from decades, and was using QuickBasic + BasicCompiler (BC.EXE) since then. Then, by complete accident I found FreeBasic, and wow, no words. I am still smiling for more than 48 hours already. I converted some o...