Home > lang > comp 
 fr de es it nl pl pt pt_BR mk sq ca ar fa vi ja ru zh zh_TW eo
Previous  Next  Edit  Rename  Undo  Refresh  Search  Administration  
Documentation
History
 
Comp
Syntax
iResult = Comp ( String1 AS String , String2 AS String [ , Mode AS Integer ] ) AS Integer

Compares two strings, and returns:

The Mode parameter can be:
Don't forget that this function only deals with ASCII.

Examples

IF (Comp(command, "open") = 0) THEN open_file

DIM UserName AS String

PRINT "Please Enter Your User Name:";
INPUT UserName

IF Comp(UserName, "Akiti") = 0 THEN
PRINT "You Can Enter"
ELSE
PRINT "Sorry, You Cannot Enter"
ENDIF

' This is illustrative example only.
' To actually delete the file you will need to write the proper code.

DIM answer AS String

PRINT "Do you want to delte the file? [y/n]"
INPUT answer

IF Comp(answer, "y", gb.text) = 0 THEN

  '...... (code to delete the file)
  '......
  '......

  ' If succesfull we print the following message
  PRINT "File Deleted"

ELSE
  PRINT "File Not Deleted"
ENDIF

See also

String Functions