Это простой код, в котором вы можете использовать UCASE (String) для идентификации эха o Echo, не обращая внимания на регистр, а затем слово с:
mid (строка, начало как целое число, длина как целое число )
пример print mid ("Hello word!", 1, 5) (дать это сообщение: Hello)
' whe Declare a function where whe put all istruction
declare function view_echo(ByVal MyString as String)as Integer
' answer is a null variable we need only for take a result from a function
dim answer as integer
' make a function with name view_echo(string)
function view_echo(ByVal MyString as String)as Integer
'In this case we print only if ECHO is the first word of the string'
'MyWord is a string variable where we take the result after read the orign
Dim MyWord as String
MyWord = "" ' initalize MyWord with no content inside
' this work only if the first word is echo doesnt care if upper case or lower
if UCASE(Mid(MyString, 1, 5)) = "ECHO " Then
' len(MyString) give the lenght of MyString
' mid(MyString,1,5) give the word Echo
' this follow row put inside MyWord variable the content of MyString
' starting from the 6th char wiht len we can have le leght of entere
' string
MyWord = Mid(MyString, 6, len(MyString) - 5 )
end if
Print MyWord 'Print the content of MyWords
return 0
end function
'initializa the var line0 like string
dim line0 as String
' put inside line0 the string = Echo hello Word !
line0 ="Echo Hello Word !"
'Then answer ask the result to the function giving the line0 value string
'that let do the work where was make the function.
answer = view_echo(line0)