Campbell DSP4 Dokumentacja Strona 294

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 330
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 293
Section 11. String Functions
11-6
SplitStr Example
In the following example, a string is split into 5 different arrays using the
SplitStr instruction. The "," is used to split the search string.
Public SearchString As String * 50
Public ResultString(5) As String * 10
BeginProg
Scan (1,Sec,3,0)
SearchString="String1,String2,String3,String4,String5"
SplitStr (ResultString(1),SearchString,",",5,5)
NextScan
EndProg
StrComp (String1, String2)
The StrComp function is used to compare two strings by subtracting the
characters in one string from the characters in another.
Syntax
Variable = StrComp ( String1, String2 )
Remarks
The StrComp instruction is typically used to determine if two strings are
identical. Starting with the first character in each string, the characters in
String2 are subtracted from the characters in String1 until the difference is non-
zero or until the end of String2 is reached. The result of this instruction is an
integer in the range of -255 to +255. If 0 is returned, the strings are identical.
UpperCase (SourceString)
Returns an upper case string of SourceString
Przeglądanie stron 293
1 2 ... 289 290 291 292 293 294 295 296 297 298 299 ... 329 330

Komentarze do niniejszej Instrukcji

Brak uwag