![]() |
Forum Index : Microcontroller and PC projects : Possible Bug in FIELD$ function in MMBasic 5.05.03
Author | Message | ||||
William Leue Guru ![]() Joined: 03/07/2020 Location: United StatesPosts: 405 |
The manual says that the string2 argument to FIELD$ can hold more than one delimiter. I interpret this to mean 'you can use any character in this string as a delimiter." (This is the usual way such a parser works in other language runtime libraries.) However, this does not work as I expect: rstr$ = "100, 100, 100" dstr$ = " ," c1$ = FIELD$(rstr$, 1, dstr$) c2$ = FIELD$(rstr$, 2, dstr$) c3$ = FIELD$(rstr$, 3, dstr$) If the delimiters in rstr$ are just spaces, then FIELD$ returns the correct fields for all 3 items. But if rstr$ has commas or any combination of spaces and commas, then only the first item is correct and the other two are null strings. Does anyone see the same thing? Is my interpretation of the desired behavior wrong? Thanks! |
||||
darthvader Regular Member ![]() Joined: 31/01/2020 Location: FrancePosts: 87 |
Hi , i just tested with v5.05.05b11 and it seem to work :) Theory is when we know everything but nothing work ... Practice is when everything work but no one know why ;) |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Works OK for me in V5.05.x but there is a mistake in the manual, not relevant to you problem. I tried all combinations of space and comma and it works as per the manual. The mistake is in the example: should be Jim VK7JH MMedit |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |