Search found 135 matches

by Boris the Old
Dec 17, 2018 3:03
Forum: General
Topic: Passing fixed-len string as arguments: possible but not recommended?
Replies: 19
Views: 1286

Re: Passing fixed-len string as arguments: possible but not recommended?

@dodicat

My example was not intended to be a real one, but was written in haste to show the type of problems encountered when performing business calculations. I forgot to mention that.

Many decimal numbers do map to floats, but many don't.

Rod
by Boris the Old
Dec 16, 2018 18:03
Forum: General
Topic: Passing fixed-len string as arguments: possible but not recommended?
Replies: 19
Views: 1286

Re: Passing fixed-len string as arguments: possible but not recommended?

... support for decimal arithmetic (floating point just isn't acceptable for business calculations)... What's wrong with floating point in FB? Could you be more specific? Carlos The problem is not with FB's floating point features - it's a problem because decimal numbers (base 10) cannot be mapped ...
by Boris the Old
Dec 16, 2018 3:45
Forum: General
Topic: Passing fixed-len string as arguments: possible but not recommended?
Replies: 19
Views: 1286

Re: Passing fixed-len string as arguments: possible but not recommended?

As it stands, "fixed length string" support in FB is non-existent. It is the one big failing of FB. For the past few years I've been looking around for a single language that will replace our current languages - COBOL, PowerBasic, and Assembler (that's what old guys call Assembly). We writ...
by Boris the Old
Dec 15, 2018 3:14
Forum: General
Topic: Fixed Length String handling
Replies: 39
Views: 1834

Re: Fixed Length String handling

I didn't notice this topic before. I'm surprised by the affirmation above because I was playing around with Unions those last 3 days and the one of the first thing I noticed is that a STRING*8 can be assigned 8 chars, while we need a ZSTRING*9 for the same job. So fixed-len strings are not exactly ...
by Boris the Old
Dec 15, 2018 2:37
Forum: General
Topic: Passing fixed-len string as arguments: possible but not recommended?
Replies: 19
Views: 1286

Re: Passing fixed-len string as arguments impossible?

I would suggest that fixed length string/zstring data not be used in FB code, except where it's necessary for communicating with the outside world. It's too easy to write data outside the limits of the fixed string fields, or attempt to do things that are not supported. We use FLTK, which requires z...
by Boris the Old
Dec 14, 2018 6:45
Forum: General
Topic: Fixed Length String handling
Replies: 39
Views: 1834

Re: Fixed Length String handling

There are two problems with FB's fixed string data type. Firstly, unlike other languages such as PowerBasic and COBOL, the FB fixed string is actually a ZString. And like a ZString, it doesn't allow embedded null characters. Secondly, the FB fixed string contains an extra null character to act as a ...
by Boris the Old
Oct 07, 2018 1:25
Forum: Projects
Topic: FBeauty.bas, a Geany custom command for code beautyfying
Replies: 21
Views: 9520

Re: FBeauty.bas, a Geany custom command for code beautyfying

....Also 80 column mark I often ignore. With today's wide screens and GUI based OS, its not so important. I don't even known where the 72 width comes from. I think I read it once, but forgot again. The 80 columns is from punched cards. Back in the '50s and '60s, each programming language had its ow...
by Boris the Old
Apr 18, 2018 3:21
Forum: Community Discussion
Topic: Speed of FreeBasic
Replies: 62
Views: 8366

Re: Speed of FreeBasic

Trying to optimize a program is like hunting for unicorns -- it seems like a good idea but the results are always disappointing. There's no significant difference in programming languages, since all code ultimately exists only as machine code. And since most applications spend 90% or more of their t...
by Boris the Old
Dec 12, 2017 21:17
Forum: Documentation
Topic: LOCK and UNLOCK in the Wiki/Manuals
Replies: 19
Views: 7205

Re: LOCK and UNLOCK in the Wiki/Manuals

Here are a few items to show how we handle file locking and data integrity. I hope it can be of use: 1) Overview Our proprietary file access module, DVSAM, (based on the original IBM ISAM) has features that help with reliability and error detection. I wrote it 30 years ago for use with BASIC and COB...
by Boris the Old
Dec 12, 2017 5:32
Forum: Documentation
Topic: LOCK and UNLOCK in the Wiki/Manuals
Replies: 19
Views: 7205

Re: LOCK and UNLOCK in the Wiki/Manuals

@Mike And, I also spent some years with IBM (but... way-back-when!), and I understand your comment! For lurkers, the development approach was to FULLY document each new program's tasks first. Also, superb docs were available on the OS environment, compilers, runtime environments, etc. (No "help...
by Boris the Old
Dec 11, 2017 18:44
Forum: Documentation
Topic: LOCK and UNLOCK in the Wiki/Manuals
Replies: 19
Views: 7205

Re: LOCK and UNLOCK in the Wiki/Manuals

Is there any consensus is on how best to deal with a "broken" lock - where an app places the lock (ie, Renames from OFF to ON), and then goes AWOL, and never "releases" the lock (Rename ON back to OFF)..........Presumably, where possible, it would be nice to recover from this me...
by Boris the Old
Dec 10, 2017 15:46
Forum: Documentation
Topic: LOCK and UNLOCK in the Wiki/Manuals
Replies: 19
Views: 7205

Re: LOCK and UNLOCK in the Wiki/Manuals

If you control all the applications that use a shared file, then 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 ...
by Boris the Old
Nov 20, 2017 16:20
Forum: Windows
Topic: Compiling, cross-compiling and testing for Windows
Replies: 12
Views: 1454

Re: Compiling, cross-compiling and testing for Windows

@xlucas

The following link is from the Wine FAQ. It explains how to remove the Wine environment from your home directory.

https://wiki.winehq.org/FAQ#How_do_I_wipe_the_virtual_Windows_installation.3F

rod
by Boris the Old
Nov 20, 2017 2:15
Forum: Windows
Topic: Compiling, cross-compiling and testing for Windows
Replies: 12
Views: 1454

Re: Compiling, cross-compiling and testing for Windows

VMs are very common today (for example in the cloud ) and used a lot for (automated) testing and similar stuff. If they are slow and buggy the fault is probably somewhere else. Virtual Machines are another layer of software between one's programs and the hardware, and are subject to all the failing...
by Boris the Old
Nov 19, 2017 19:02
Forum: Windows
Topic: Compiling, cross-compiling and testing for Windows
Replies: 12
Views: 1454

Re: Compiling, cross-compiling and testing for Windows

......I am a GNU/Linux user, but I often make my programs multi-platform. I used to have Wine installed, so before publishing, I would use it to compile for Windows and for testing how it worked. Now for some reason, I seem to be unable to install Wine (it looks like it installed, but then the &quo...

Go to advanced search