![]() |
Forum Index : Microcontroller and PC projects : TRIM
Author | Message | ||||
Teo1 Newbie ![]() Joined: 06/05/2023 Location: RomaniaPosts: 30 |
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: 6283 |
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 |
||||
Teo1 Newbie ![]() Joined: 06/05/2023 Location: RomaniaPosts: 30 |
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: 203 |
Teo - you write English much better than any of us write Romanian! Live in the Future. It's Just Starting Now! |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |