Author Topic: Instr function  (Read 10320 times)

dk_akj

  • Newbie
  • Posts: 7
    • View Profile
    • LK-tech
Instr function
« on: April 18, 2004, 11:37:59 AM »
Hi.

I receive a string from a modem.

The format is:
xxxx,yyy,,pnoneno, xyxyxy, text
or
xxxx,yyy,,pnoneno, xyxyxyxyxy, text

I need to obtain the caracters after the last ","

In VB i would do it like:

a = xxxx,yyy,,pnoneno, xyxyxyxyxy, text
b = right(a,len(a) - instrrev(a,","))

How do i do it with the MD 100 ??

Regards
Anders

dk_akj

  • Newbie
  • Posts: 7
    • View Profile
    • LK-tech
Re:Instr function
« Reply #1 on: April 19, 2004, 01:12:16 AM »
I've made my ovn instr cust function.

l = len(a$)
x$ = "start"
a = 0
for i = 1 to l

   for j = 1 to 15
      b$ = mid$(a$,i,j +1)
      b$ = strlwr$(b$)

      if strcmp(b$,x$) = 0 then
         a = 1
   
      else
         
      endif

   next
next


Hope someone else also can use it.

Regards
Anders