Search found 2413 matches

by srvaldez
Jun 21, 2020 11:15
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6302

Re: PHP-like associative arrays

however Zamaster's hashmap encountered no collisions in this test it generates 456976 items, so it takes a while #include "hashmap.bi" dsm_HashMap_define(zstring, integer) using dsm dim as HashMap(zstring, integer) ArrayItemID Dim Shared ItemID As String Dim Shared As Integer Collisions=0,...
by srvaldez
Jun 21, 2020 10:29
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6302

Re: PHP-like associative arrays

hello Makoto WATANABE I don't follow your logic, but in the following test there are 16 collisions #Include "assocarray.bi" DefineAssocArrayType( Integer ) Dim Shared As IntegerArray ArrayItemID Dim Shared ItemID As String Dim Shared As Integer Collisions=0, Counter, i, j, k Counter = 0 Fo...
by srvaldez
Jun 20, 2020 17:12
Forum: Beginners
Topic: Is FreeBasic A Decent Alternative To VisualBasic 6?
Replies: 12
Views: 530

Re: Is FreeBasic A Decent Alternative To VisualBasic 6?

@BadLarry
if you want a cross-platform solution that has the functionality of VB6 then I recommend Lazarus, it's Pascal but it's GUI designer works similar to VB6
alternately, you could give QB64 + Inform a try
by srvaldez
Jun 20, 2020 16:55
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6302

Re: PHP-like associative arrays

@ShawnLG
your corrected assocarray.bi works without a flaw, thanks a million :-)

@Zamaster
thank you for visiting and thanks for the link, will try your code a bit later :-)
by srvaldez
Jun 19, 2020 14:15
Forum: Community Discussion
Topic: @paul doe re: fb-dictionary
Replies: 4
Views: 256

Re: @paul doe re: fb-dictionary

thanks again :-)
by srvaldez
Jun 19, 2020 13:53
Forum: Community Discussion
Topic: @paul doe re: fb-dictionary
Replies: 4
Views: 256

Re: @paul doe re: fb-dictionary

paul doe wrote:Do you have a GitHub account? I can give you access to it if you want (as the repo is now private).

yes, the account is under the name srvaldez

thank you paul
by srvaldez
Jun 19, 2020 12:04
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6302

Re: PHP-like associative arrays

there's another hasmap implementation by Zamaster https://www.freebasic.net/forum/viewtopic.php?p=216439 but it works in 32-bit only, he uses inline-asm and the 64-bit parts are wrong however, I run the previous test using his hashmap and there were no problems #include "hashmap.bi" dsm_Ha...
by srvaldez
Jun 19, 2020 10:27
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6302

Re: PHP-like associative arrays

this implementation of associative array does not handle collisions, it reports them but does not resolve them, see my updated previous post
by srvaldez
Jun 19, 2020 10:11
Forum: Community Discussion
Topic: @paul doe re: fb-dictionary
Replies: 4
Views: 256

@paul doe re: fb-dictionary

Hi paul doe
is your fb-dictionary still avalable or was it part of the FreeBasic Framework ?
I really liked your dictionary class and would hate to see it disappear
by srvaldez
Jun 19, 2020 9:57
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6302

Re: PHP-like associative arrays

Hi Makoto WATANABE there's certainly a problem, try this variation of your code #Include "assocarray.bi" DefineAssocArrayType( Integer ) Dim Shared As IntegerArray ArrayItemID Dim Shared ItemID As String Dim Shared As Integer Counter, i, j Counter = 0 For i = Asc("A") To Asc(&quo...
by srvaldez
Jun 18, 2020 17:51
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6302

Re: PHP-like associative arrays

@Makoto WATANABE
it occurred to me that perhaps you are using Japanese fonts in the CharacterString, not sure it will work, but if that's the problem then others more knowledgeable than me will help you.
by srvaldez
Jun 18, 2020 16:25
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6302

Re: PHP-like associative arrays

I don't understand your problem, it works as the associative array should
when you do: CharacterString = "bla" and then array.Item(CharacterString) = 123 it's equivalent to array.Item("bla") = 123
by srvaldez
Jun 18, 2020 14:41
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6302

Re: PHP-like associative arrays

@Makoto WATANABE
I suggest that you also have a look at the mixed type by the same author, the corrected Mixed.bi can be found here viewtopic.php?p=273280#p273280
by srvaldez
Jun 18, 2020 14:40
Forum: Tips and Tricks
Topic: Mixed datatype
Replies: 46
Views: 5401

Re: Mixed datatype

adding more constructors were needed for enhanced functionality many thanks to fxm for correcting and enhancing the original Mixed.bi https://www.freebasic.net/forum/viewtopic.php?p=273217#p273217 I recommend that you use his version unless you feel adventurous or perhaps to try the Mixed-assocarray...
by srvaldez
Jun 18, 2020 14:21
Forum: Tips and Tricks
Topic: PHP-like associative arrays
Replies: 45
Views: 6302

Re: PHP-like associative arrays

something like this? #include "assocarray.bi" DefineAssocArrayType( Integer ) DefineAssocArrayType( String ) Dim As IntegerArray array Dim As StringArray s Dim as string stars="***" array.Item("bla") = 123 array.Item(123) = 124 array.Item(123) = 124324 Print array.Item(...

Go to advanced search