#ifset PRECOMPILED_LIBRARY
replace main
{
#endif
#ifclear PRECOMPILED_LIBRARY
routine main
{
#endif
local x
PrintStatusLine
!!! DEMO CODE Begins
print "\n\BThis is an example of the RIGHT$ routine:\b"
print "Original string : \"LeftMiddleRight\""
print "Right$(\"LeftMiddleRight\",5) : ";
x = right$("LeftMiddleRight", 5)
print "\"";stringprint(x);"\""
print "\n[PRESS ANY KEY...]"
pause
print "\n\BThis is an example of the RIGHT$ routine with replace:\b"
print "Original string : \"LeftMiddleRight\""
print "Replacement string : \"*****\""
print "Right$(\"LeftMiddleRight\",5,\"*****\") : ";
x = right$("LeftMiddleRight", 5, "*****")
print "\"";stringprint(x);"\""
print "\n[PRESS ANY KEY...]"
pause
print "\n\BThis is an example of the LEFT$ routine:\b"
print "Original string : \"LeftMiddleRight\""
print "Left$(\"LeftMiddleRight\",4) : ";
x = left$("LeftMiddleRight", 4)
print "\"";stringprint(x);"\""
print "\n[PRESS ANY KEY...]"
pause
print "\n\BThis is an example of the LEFT$ routine with replace:\b"
print "Original string : \"LeftMiddleRight\""
print "Replacement string : \"****\""
print "Left$(\"LeftMiddleRight\",4,\"****\") : ";
x = left$("LeftMiddleRight", 4, "****")
print "\"";stringprint(x);"\""
print "\n[PRESS ANY KEY...]"
pause
print "\n\BThis is an example of the MID$ routine:\b"
print "Original string : \"LeftMiddleRight\""
print "Mid$(\"LeftMiddleRight\",4,6) : ";
x = mid$("LeftMiddleRight", 4, 6)
print "\"";stringprint(x);"\""
print "\n[PRESS ANY KEY...]"
pause
print "\n\BThis is an example of the MID$ routine with replace:\b"
print "Original string : \"LeftMiddleRight\""
print "Replacement String : \"******\""
print "Mid$(\"LeftMiddleRight\",10,4,\"******\") : ";
x = mid$("LeftMiddleRight", 4,6, "******")
print "\"";stringprint(x);"\""
print "\n[PRESS ANY KEY...]"
pause
print "\n\BThis is an example of the ADD$ routine:\b"
print "First string : \"Hello, \""
print "Second String : \"Goodbye.\""
print "Add$(\"Hello, \",\"Goodbye.\") : ";
x = add$("Hello, ", "Goodbye.")
print "\"";stringprint(x);"\""
print "\n[PRESS ANY KEY...]"
pause
print "\n\BThis is an example of the SEARCH$ routine:\b"
print "Source string : \"Sample Search String.\""
print "Search string : \"a\""
x = search$("Sample Search String.", "a")
if not x
{
print "Search string not found."
}
else
{
print "Search text begins at position ";number (x);""
}
print "\n[PRESS ANY KEY...]"
pause
print "\n\BThis is an example of the SEARCH$ routine with offset:\b"
print "Source string : \"Sample Search String.\""
print "Search string : \"a\""
print "Search offset : 5"
x = search$("Sample Search String.", "a", 5)
if not x
{
print "Search string not found."
}
else
{
print "Search text begins at position ";number (x);""
}
print "\n[PRESS ANY KEY...]"
pause
print "\n\BThis is an example of the PRINTCENTER() routine:\b"
print "PrintCenter(string) :"
PrintCenter("Centered Text.")
print "\n[PRESS ANY KEY...]"
pause
print "\n\BThis is an example of the PRINTRIGHT() routine:\b"
print "PrintRight(string) : "
PrintRight("Right Justified Text.")
print "\n[PRESS ANY KEY...]"
pause
"\IThis concludes the strfnc.h demo.\i"
pause
return true
!!! DEMO CODE Ends
}
character you "you"
{
nouns "me", "myself"
capacity 100
long_desc {"Looking good."}
is plural ! for matching first-person verbs
is hidden ! for location descriptions
}
room emptyroom "[STRFNC.H] Seven New Hugo String Functions V1.5 by Jason Peter Brown."
{