My proposal to the community for Left and Right Function in String.h library
'Return the <SysCharCount> most left characters of a string
Function Left (in SysInString() , SysCharCount) as string
StringSize=SysInString(0)
If StringSize <= SysCharCount then
Left=SysInString() 'If the size of the string is less than or equal to SysCharCount the entire string is return
end if
if StringSize > SysCharCount then
SysInString(0)=SysCharCount
Left=SysInString()
end if
end function
'Return the <SysCharCount> most right characters of a string
Function Right(in SysInString() , SysCharCount) as string
StringSize=SysInString(0)
if StringSize <= SysCharCount then
Right=SysInString() 'If the size of the string is less than or equal to SysCharCount the entire string is return
end if
if StringSize > SysCharCount then
For counter = 1 to SysCharCount
Right(SysCharCount+1-counter)=SysInString(StringSize+1-counter)
next
Right(0)=SysCharCount
end if
end function
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What about the Mid Function below. Is Working just fine for me
'Return the section of a string which begin from SysCharStart with length SysCharCount
Function Mid (in SysInString() , SysCharStart , SysCharCount) as string
if (SysInString(0)<=SysCharCount) OR (SysInString(0)<SysCharStart) then
Mid(0)=0
Exit Function
end if
SysInString(0)=SysCharStart+SysCharCount-1
SysInStringSize=SysInString(0)
Mid=""
For i=0 to SysCharCount
Mid(SysCharCount-i)=SysInString(SysInStringSize-i)
next
Mid(0)=SysCharCount
end function
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for working on the string functions.
I will have to try them out.
With GPS and other devices returning strings, these functions will be useful for parsing out what you need.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
My proposal to the community for Left and Right Function in String.h library
'Return the <SysCharCount> most left characters of a string
Function Left (in SysInString() , SysCharCount) as string
StringSize=SysInString(0)
If StringSize <= SysCharCount then
Left=SysInString() 'If the size of the string is less than or equal to SysCharCount the entire string is return
end if
if StringSize > SysCharCount then
SysInString(0)=SysCharCount
Left=SysInString()
end if
end function
'Return the <SysCharCount> most right characters of a string
Function Right(in SysInString() , SysCharCount) as string
StringSize=SysInString(0)
if StringSize <= SysCharCount then
Right=SysInString() 'If the size of the string is less than or equal to SysCharCount the entire string is return
end if
if StringSize > SysCharCount then
For counter = 1 to SysCharCount
Right(SysCharCount+1-counter)=SysInString(StringSize+1-counter)
next
Right(0)=SysCharCount
end if
end function
What about the Mid Function below. Is Working just fine for me
'Return the section of a string which begin from SysCharStart with length SysCharCount
Function Mid (in SysInString() , SysCharStart , SysCharCount) as string
if (SysInString(0)<=SysCharCount) OR (SysInString(0)<SysCharStart) then
Mid(0)=0
Exit Function
end if
SysInString(0)=SysCharStart+SysCharCount-1
SysInStringSize=SysInString(0)
Mid=""
For i=0 to SysCharCount
Mid(SysCharCount-i)=SysInString(SysInStringSize-i)
next
Mid(0)=SysCharCount
end function
Thanks for working on the string functions.
I will have to try them out.
With GPS and other devices returning strings, these functions will be useful for parsing out what you need.