Search found 104 matches

by skystrick
Nov 07, 2018 1:41
Forum: General
Topic: How to grab escape-sequence keycodes?
Replies: 8
Views: 664

Re: How to grab escape-sequence keycodes?

D.J.Peters wrote:If you read from stdin you use

Open Cons For Input As #hFile

then my posted solution will work

if not why

you can post the code also

Joshy


Thank you D.J.Peters, your code solved my problem!
by skystrick
Nov 06, 2018 0:11
Forum: General
Topic: How to grab escape-sequence keycodes?
Replies: 8
Views: 664

Re: How to grab escape-sequence keycodes?

It seems, that we are talking about two different things. This needs some clarification first. If you are connecting to a hardware (physical) terminal, then I think: Joshi is correct (and the FB command is: Open COM) And, atachement to Linux Terminals IO streams, whould not be correct. The text ter...
by skystrick
Nov 05, 2018 22:52
Forum: General
Topic: How to grab escape-sequence keycodes?
Replies: 8
Views: 664

Re: How to grab escape-sequence keycodes?

"... Inkey, Getkey, and Multikey ..." What have this functions to do with a RS-232 connection ? In FreeBASIC a RS-232 connection is like a file read / write operation. KeyPgOpenCom Joshy The RS232 terminal is a text console, i.e. attached to Linux as stdin/stdout. It is accessed inside Fr...
by skystrick
Nov 05, 2018 0:41
Forum: Community Discussion
Topic: Donations
Replies: 4
Views: 510

Donations

I would like to donate to the developer crew that created FreeBASIC. I have gotten a lot of use and enjoyment out of FreeBASIC, and the community has been very responsive to my questions and needs. I am honored that one of my feature requests was included in FB! Is there a place I can PayPal or othe...
by skystrick
Nov 04, 2018 19:46
Forum: General
Topic: How to grab escape-sequence keycodes?
Replies: 8
Views: 664

How to grab escape-sequence keycodes?

Hi, I am running a console-mode program on an RS232 text dumb terminal. The terminal hardware sends escape sequence keycodes for the F-keys, arrow keys, etc. Example: Pressing F1 makes the terminal send: Ctrl+A, @, <CR> In other words Chr$(1), Chr$(64), Chr$(13) Problem: Inkey, Getkey, and Multikey ...
by skystrick
Dec 11, 2017 12:56
Forum: Documentation
Topic: LOCK and UNLOCK in the Wiki/Manuals
Replies: 19
Views: 6293

Re: LOCK and UNLOCK in the Wiki/Manuals

speedfixer wrote:My method, also.
I use a ramdisk in a common mapped directory for the lockfile to trim the time hit a little.
Windows and Linux.


David


Am I understanding that you read/write your lockfile on a ramdisk instead of a hard drive to speed up access times?

How much of a difference does this make?
by skystrick
Dec 11, 2017 11:59
Forum: Documentation
Topic: LOCK and UNLOCK in the Wiki/Manuals
Replies: 19
Views: 6293

Re: LOCK and UNLOCK in the Wiki/Manuals

You can simulate file locking by using a special lock file in conjunction with the "Name" statement. Start with a lock file name such as "lockfile.off". When an application needs to lock a file it should attempt to rename the lock file to something else. If the rename fails then...
by skystrick
Nov 24, 2017 11:39
Forum: Documentation
Topic: LOCK and UNLOCK in the Wiki/Manuals
Replies: 19
Views: 6293

Re: LOCK and UNLOCK in the Wiki/Manuals

Can we revisit this issue? I think it is important to be able to lock files for safe writing.

I am using files in RANDOM mode and would like to be able to lock entire files.
by skystrick
Oct 17, 2017 22:29
Forum: General
Topic: LONGINT causing problems
Replies: 18
Views: 868

Re: LONGINT causing problems

Code execution should be faster by using cumulative addition instead of multiplication inside the loop: S = 0 DO S = S + Y IF S = X THEN REMAINDER = "NO": EXIT DO IF S > X THEN REMAINDER = "YES": EXIT DO LOOP Ha! That's what I get for coding stoned. Love your solution. Thanks fx...
by skystrick
Oct 17, 2017 21:56
Forum: General
Topic: LONGINT causing problems
Replies: 18
Views: 868

Re: LONGINT causing problems

Without MOD, I need another way to determine whether Number X is evenly divisible by Number Y. Currently I test whether X MOD Y = 0 is true (if it is, there is no remainder for X DIV Y, thus it is evenly divisible). What is another way to do this without using MOD or DIV? I think I solved my own pr...
by skystrick
Oct 17, 2017 21:18
Forum: General
Topic: LONGINT causing problems
Replies: 18
Views: 868

Re: LONGINT causing problems

may I suggest that you use QB64 instead of FB http://www.qb64.net or https://www.qb64.org forum http://www.qb64.net/forum/index.php I depend on several commands/features supported only by FreeBASIC (even in -lang qb). 20,000+ lines of code in my program would be a lot to rewrite. Without MOD, I nee...
by skystrick
Oct 17, 2017 19:42
Forum: General
Topic: LONGINT causing problems
Replies: 18
Views: 868

Re: LONGINT causing problems

srvaldez wrote:if your code uses mod or division (have not tried the other operators) then there'a problem.



Nailed it!

I used MOD twice :)

Wait for a bugfix or is there a workaround for MOD in 64-bit lang QB?
by skystrick
Oct 17, 2017 19:30
Forum: General
Topic: LONGINT causing problems
Replies: 18
Views: 868

Re: LONGINT causing problems

hello skystrick this code compiles and runs ok using FreeBASIC Compiler - Version 1.06.0 (02-04-2017), built for linux-x86_64 (64bit) #lang "qb" dim as __LONGINT x input "enter x ";x print sqr(x) print "enter return to exit " sleep Your code does compile and run withou...
by skystrick
Oct 17, 2017 18:32
Forum: General
Topic: LONGINT causing problems
Replies: 18
Views: 868

Re: LONGINT causing problems

Hi, it looks like a bug with the -lang qb code generation on 64bit. I'm going to make a bug report. Thanks! Any suggestions for a workaround? Or just wait for a patch? EDIT: Maybe it has to do with the platform? I'm compiling under GNU/Linux 32bit. I'm compiling under Ubuntu Linux 64-bit using FBC ...
by skystrick
Oct 17, 2017 15:25
Forum: General
Topic: LONGINT causing problems
Replies: 18
Views: 868

LONGINT causing problems

Switched some variables in a program from INTEGER to __LONGINT (I am using -lang qb), now FBC compiler throws this error:

PROGRAM.o: In function 'main':
PROGRAM.c:(.text+0x2bdf3): undefined reference to '__moddi3'
PROGRAM.c:(.text+0x2be9e): undefined reference to '__moddi3'

Help?

Go to advanced search