str_int

BAP Online Manuals : Library Reference : Library by Name : str_int
Previous: str_char
Next: str_len

6.2.126. str_int

converts a string into an integer or vice versa

SYNOPSIS

str_int("12",Int)
str_char(Str,20)

SYNTAX

str_char(String,Integer) (i,x) (x,i)

ARGUMENTS

string(string) (x) string containing only the number Int
integer(Int) (x) integer representing the value of the number in string

DESCRIPTION

Converts a string into an integer or vice versa. If string is bound, it must contain a single number for the predicate to succeed.

ERRORS

No runtime errors.

EXAMPLE

readln(String),
( str_int(String,Integer), write(Integer),nl ;
  write("was no integer."),nl
).

LAYERS

prolog-process, client-server, object

RELATED PREDICATES

fronttoken , prologtoken


BAP Online Manuals : Library Reference : Library by Name : str_int
Previous: str_char
Next: str_len