Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : TRIM
Author | Message | ||||
Teo1 Newbie Joined: 06/05/2023 Location: RomaniaPosts: 25 |
Hi all, From the manual : S$ = " ****23.56700 " PRINT Trim$(s$, " ") I have the error : "Error : TRIM is not declared" What did I do wrong ? Thanks in advance , Teo |
||||
TassyJim Guru Joined: 07/08/2011 Location: AustraliaPosts: 6098 |
Read the manual just before the example you are quoting ' trim any characters in c$ from the start and end of s$ FUNCTION Trim$(s$, c$) Trim$ = RTrim$(LTrim$(s$, c$), c$) END FUNCTION ' trim any characters in c$ from the end of s$ FUNCTION RTrim$(s$, c$) RTrim$ = s$ DO WHILE INSTR(c$, RIGHT$(RTrim$, 1)) RTrim$ = MID$(RTrim$, 1, LEN(RTrim$) - 1) LOOP END FUNCTION ' trim any characters in c$ from the start of s$ FUNCTION LTrim$(s$, c$) LTrim$ = s$ DO WHILE INSTR(c$, LEFT$(LTrim$, 1)) LTrim$ = MID$(LTrim$, 2) LOOP END FUNCTION Jim VK7JH MMedit MMBasic Help |
||||
Teo1 Newbie Joined: 06/05/2023 Location: RomaniaPosts: 25 |
Jim, thanks a lot. It's hard for me because English is not known to me and I'm just starting out with MMBASIC. Teo |
||||
NPHighview Senior Member Joined: 02/09/2020 Location: United StatesPosts: 200 |
Teo - you write English much better than any of us write Romanian! Live in the Future. It's Just Starting Now! |
||||
Print this page |