![]() |
Forum Index : Microcontroller and PC projects : MMBasic for Windows 5.07.03B24 notes
Author | Message | ||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 288 |
Sorry boys, I feel ugly posting this as new thread. Found in MMB4W 5.07.03B24. Not a bug, still developers might want to mark this as "to fix someday" for better code compat. MID$(string$,patern$,1)="" would throw: >Error in line xx : Supplied string too short But would accept to do the same MID$(string$,patern$,1)=CHR$(0) My MMBasic 'sand box' |
||||
dMajo![]() Newbie ![]() Joined: 18/05/2020 Location: ItalyPosts: 27 |
In my opinion it could seems the same but it is not. in the first case we have a zero lenght (no characters) string, while in the second example the chr$ function returns 1 character string even if of binary value 0. ALLdataEE.com EDU Promos |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 3988 |
Looks like a bug. John |
||||
electricat![]() Senior Member ![]() Joined: 30/11/2020 Location: LithuaniaPosts: 288 |
Yes. Like I said it`s not a bug, but posted this, becouse Picomites in same situation would accept ="" and MMB4W (maybe) needs fix in some blurr future, for beter code compatibility. Thats it. My MMBasic 'sand box' |
||||
CaptainBoing![]() Guru ![]() Joined: 07/09/2016 Location: United KingdomPosts: 2137 |
in the first code example you say "substitute one character with this zero length string" Whether that makes sense or not is arguable (personally I don't have an issue with it and I can see it being useful), but it isn't allowed in MMB4W, therefore such discussion is moot. Unless I am missing something, I would say things are "as designed". h Edited 2025-04-24 20:14 by CaptainBoing |
||||
matherp Guru ![]() Joined: 11/12/2012 Location: United KingdomPosts: 10000 |
The PicoMite supports S$="12345678" mid$(s$,3,2)="" as a perfectly valid way of removing characters from within a string. I haven't updated MMB4W with this new functionality - one day perhaps.... CMM2 is the same as PicoMite Edited 2025-04-24 20:07 by matherp |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |