Search found 2893 matches
- Dec 04, 2018 23:03
- Forum: Tips and Tricks
- Topic: Get String Characters 4x Faster than Mid()
- Replies: 83
- Views: 2250
Re: Get String Characters 4x Faster than Mid()
You use byte, not string. I'm using, what you obviously don't understand ... Something like: s[n] returns a UByte , not any sort of string. Therefore, a UByte must be used for assignment, too. E.g. Asc("X") . ' assume s being a string Dim As UByte ub = s[n] ' get a "string-ch...
- Dec 04, 2018 22:48
- Forum: Tips and Tricks
- Topic: Get String Characters 4x Faster than Mid()
- Replies: 83
- Views: 2250
Re: Get String Characters 4x Faster than Mid()
Munair wrote:syntax s[6], which does not allow assignment to string
Which is of course, nonsense (see code example)!
- Dec 04, 2018 22:15
- Forum: Tips and Tricks
- Topic: Get String Characters 4x Faster than Mid()
- Replies: 83
- Views: 2250
Re: Get String Characters 4x Faster than Mid()
Consistency is with regards to the syntax s[6], which does not allow assignment to string. One unique syntax for both string and byte on one side, bot not on the other doesn't look consistent. Where is the inconsistency? String indexing = UByte return = ASCII value of string char, which can equally...
- Dec 03, 2018 16:34
- Forum: Tips and Tricks
- Topic: Get String Characters 4x Faster than Mid()
- Replies: 83
- Views: 2250
Re: Get String Characters 4x Faster than Mid()
I won't, don't worry ... (I'm not inclined to burn my fingers).But feel free to use them in any way you see fit.
- Dec 03, 2018 13:46
- Forum: Tips and Tricks
- Topic: Get String Characters 4x Faster than Mid()
- Replies: 83
- Views: 2250
Re: Get String Characters 4x Faster than Mid()
Why don't you, if you are insisting on unsafe #define 's coding, at least try to: 1) use parenthesis on parameters (to avoid precedence issues) 2) include the needed correction '- 1' (string pos. to index, conversion) As below: #Define GetChr(s, p) ( Chr((s)[(p) - 1]) ) #Define GetAsc(s, p) ( (s)[(p...
- Dec 03, 2018 1:21
- Forum: Tips and Tricks
- Topic: Get String Characters 4x Faster than Mid()
- Replies: 83
- Views: 2250
Re: Get String Characters 4x Faster than Mid()
It is not dangerous if used within the boundaries of the string, similar to array bounds.
It is dangerous, because those checks are NOT internal. (reread my initial post!)
- Dec 02, 2018 23:49
- Forum: Tips and Tricks
- Topic: Get String Characters 4x Faster than Mid()
- Replies: 83
- Views: 2250
Re: Getting String Characters 4x Faster than Mid()
The #Define of yours is dangerous, because it relies on externals (strings length checking). This is a different way to do that (without StrPtr also): Sub PrtChr( _ ByVal strg As String = "", _ ByVal nPos As UByte = 1, _ ByVal nSiz As UByte = 0 _ ) Static As String ts If strg = ""...
- Dec 01, 2018 22:16
- Forum: General
- Topic: Too restrictive compilation control on dynamic arrays in the main code?
- Replies: 30
- Views: 925
Re: Too restrictive compilation control on dynamic arrays in the main code?
A slight variation in the Sub (Boolean instead of Long). Since the Sub is "locked" after the first call, and unlocking isn't a option, there is just about this left ... Sub dothis static as boolean locked If locked then return print "Greetings from " + __function__ locked = TRUE ...
- Dec 01, 2018 14:26
- Forum: General
- Topic: Too restrictive compilation control on dynamic arrays in the main code?
- Replies: 30
- Views: 925
Re: Too restrictive compilation control on dynamic arrays in the main code?
Not sure, that this isn't opening yet another 'can of worms'.fxm wrote:Me, I propose just a complete unclamping everywhere if the option of compilation '-exx' is set
AFAIR, we've had a error report "more options allowed with -exx" (than otherwise)?
- Dec 01, 2018 12:45
- Forum: Tips and Tricks
- Topic: Double to String, with rounding and ...
- Replies: 4
- Views: 418
Re: Double to String, with rounding and ...
dodicat, thanks for the input, code in first post fixed now.
Your math. is faster, but fails on constant decimals length (no necessary "0" appended) in fourth place.
Your math. is faster, but fails on constant decimals length (no necessary "0" appended) in fourth place.
- Nov 30, 2018 14:21
- Forum: Tips and Tricks
- Topic: Double to String, with rounding and ...
- Replies: 4
- Views: 418
Re: Double to String, with rounding and ...
hello srvaldez, your license is very restrictive, why? personally, I like to share any code I write freely, ... Since I'm using FB for different purposes (commercial, recreational or just for fun/self education), code that I might later want to use in a commercial way, is restricted such, that I'm n...
- Nov 28, 2018 17:42
- Forum: Tips and Tricks
- Topic: Double to String, with rounding and ...
- Replies: 4
- Views: 418
Double to String, with rounding and ...
This is an example of using String Functions (most of them), to do Double rounding to String, with arbitrary chosen (almost: 1 to 9), number of decimals. The intended purpose is mainly, to show many String Functions, in action. edit: updated 2018-11-30 (code, license terms) edit: updated 2018-12-01 ...
- Nov 27, 2018 11:46
- Forum: Community Discussion
- Topic: Nominations for Forum Moderators
- Replies: 70
- Views: 4279
Re: Nominations for Forum Moderators
@coderJeff,
this thread, should be moved to News section for visibility to all, as well as to NOT
be always hidden again, by newer posts in Community Discussion section.
(the typical drawbacks, of a 'open' Forum)
this thread, should be moved to News section for visibility to all, as well as to NOT
be always hidden again, by newer posts in Community Discussion section.
(the typical drawbacks, of a 'open' Forum)
- Nov 24, 2018 21:00
- Forum: Projects
- Topic: GooData: diagrams for screen / printer / files
- Replies: 11
- Views: 1417
Re: GooData: diagrams for screen / printer / files
OK got it from GIT, it says 'Lesser GPL', which I find somewhat confusing,
should read 'LGPL', IMO. Apologies.
should read 'LGPL', IMO. Apologies.
- Nov 24, 2018 20:39
- Forum: Projects
- Topic: GooData: diagrams for screen / printer / files
- Replies: 11
- Views: 1417
Re: GooData: diagrams for screen / printer / files
Code: Select all
' This is file ex_3d_perpens.bas
'
' Licence: GPLv3
' (C) 2012 Thomas[ dot ]Freiherr[ at ]gmx[ dot ]net