m.r.b.
09-03-2007, 06:47 PM
Hello All...
I am not in front of my 'development PC' right now.
I'm trying to work out Left$,Right$ and Mid$ functions
Will this work?? If its right, it might be useful to someone...
Or is there a faster/better way embedded into spin..
[code]
PUB LeftStr(SourcreStringPtr,DestStringPointer,RhsChop )
{{
· @DestStringPointer = LEFT$(@SourcreStringPtr,RhsChop)·················· ··
}}
· MidStr(SourcreStringPtr,DestStringPointer,0,RhsCho p)
PUB RightStr(SourcreStringPtr,DestStringPointer,LhsCho p)
{{
· @DestStringPointer = RIGHT$(@SourcreStringPtr,LhsChop)················· ···
}}
· MidStr(SourcreStringPtr,DestStringPointer,LhsChop, strsize(SourcreStringPtr))
PUB MidStr(SourcreStringPtr,DestStringPointer,LhsChop, RhsChop) | TempPointer
{{
· @DestStringPointer = MID$(@SourcreStringPtr,LhsChop,RhsChop)
· IE MID$("ABCDEFG",2,3) RETURNS "CD"····················
}}
· repeat TempPointer from (SourcreStringPtr+LhsChop) to (SourcreStringPtr+RhsChop)
···· byte[DestStringPointer++] := (byte[TempPointer])
· byte[DestStringPointer] := 0 'Add the zero terminator to the end of the string.
[code/]
Regards
M.R.B.
I am not in front of my 'development PC' right now.
I'm trying to work out Left$,Right$ and Mid$ functions
Will this work?? If its right, it might be useful to someone...
Or is there a faster/better way embedded into spin..
[code]
PUB LeftStr(SourcreStringPtr,DestStringPointer,RhsChop )
{{
· @DestStringPointer = LEFT$(@SourcreStringPtr,RhsChop)·················· ··
}}
· MidStr(SourcreStringPtr,DestStringPointer,0,RhsCho p)
PUB RightStr(SourcreStringPtr,DestStringPointer,LhsCho p)
{{
· @DestStringPointer = RIGHT$(@SourcreStringPtr,LhsChop)················· ···
}}
· MidStr(SourcreStringPtr,DestStringPointer,LhsChop, strsize(SourcreStringPtr))
PUB MidStr(SourcreStringPtr,DestStringPointer,LhsChop, RhsChop) | TempPointer
{{
· @DestStringPointer = MID$(@SourcreStringPtr,LhsChop,RhsChop)
· IE MID$("ABCDEFG",2,3) RETURNS "CD"····················
}}
· repeat TempPointer from (SourcreStringPtr+LhsChop) to (SourcreStringPtr+RhsChop)
···· byte[DestStringPointer++] := (byte[TempPointer])
· byte[DestStringPointer] := 0 'Add the zero terminator to the end of the string.
[code/]
Regards
M.R.B.