AMOS - The Creator User Guide - eBook-ENG

Page 69

II II II II II II

Normally the search will commence from the first character in your text string (d$). The second version of INSTR lets you test a specific section in the string at a time. p is now the position of the beginning of your search. All characters are numbered from left to right starting from zero. Therefore p ranges from 0 to LEN(s$). Examples:

Printlnstr("AMOS BASIC","S",O) 4 Printlnstr("AMOS BASIC","S",5) 8

=UPPER$

(Convert a string oftext to uppercase)

s$=UPPER$(n$) This function converts the string in n$ into upper case (capitals) and places the result into s$. Example:

Print Upper$("AmOs BaSic") AMOS BASIC

=LOWER$

(Convert a string to lower case)

II

s$=LOWER$(n$)

II

LOWER$ translates all the characters in n$ into lower case. This is especially useful in adventure games, as you can convert all the user's input into a standard format which is much easier to interpret. Examples:

II II II

Print Lower$("AMOS Basic") amos basic Input "Continue (ye!!No)";ANSWER$ ANSWER$=Lower$(ANSWER$) : II ANSWER$="no" Then Edit Print "Continuing with your program..."

=FLlP$

(Invert a string)

f$=FLlP$(n$) FLlP$ simply reverses the order of the characters held in n$. Example:

II II II

Print Flip$("AMOS Basic") cisaB SOMA

=SPACE$

(Space out a string)

s$=SPACE$(n)

57


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.